From 9980b8a0bd4c5dfb67909a2de7720076881e6525 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sat, 5 Jan 2013 10:00:09 +0000 Subject: [PATCH] Switch LoopIdiomRecognize to directly use the TargetTransformInfo interface rather than the ScalarTargetTransformInterface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171616 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/LoopIdiomRecognize.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/lib/Transforms/Scalar/LoopIdiomRecognize.cpp index 7f1833f8fbc..999bf57500d 100644 --- a/lib/Transforms/Scalar/LoopIdiomRecognize.cpp +++ b/lib/Transforms/Scalar/LoopIdiomRecognize.cpp @@ -135,12 +135,12 @@ namespace { DominatorTree *DT; ScalarEvolution *SE; TargetLibraryInfo *TLI; - const ScalarTargetTransformInfo *STTI; + const TargetTransformInfo *TTI; public: static char ID; explicit LoopIdiomRecognize() : LoopPass(ID) { initializeLoopIdiomRecognizePass(*PassRegistry::getPassRegistry()); - TD = 0; DT = 0; SE = 0; TLI = 0; STTI = 0; + TD = 0; DT = 0; SE = 0; TLI = 0; TTI = 0; } bool runOnLoop(Loop *L, LPPassManager &LPM); @@ -195,12 +195,10 @@ namespace { return TLI ? TLI : (TLI = &getAnalysis()); } - const ScalarTargetTransformInfo *getScalarTargetTransformInfo() { - if (!STTI) { - TargetTransformInfo *TTI = getAnalysisIfAvailable(); - if (TTI) STTI = TTI->getScalarTargetTransformInfo(); - } - return STTI; + const TargetTransformInfo *getTargetTransformInfo() { + if (!TTI) + TTI = getAnalysisIfAvailable(); + return TTI; } Loop *getLoop() const { return CurLoop; } @@ -312,8 +310,8 @@ NclPopcountRecognize::NclPopcountRecognize(LoopIdiomRecognize &TheLIR): } bool NclPopcountRecognize::preliminaryScreen() { - const ScalarTargetTransformInfo *STTI = LIR.getScalarTargetTransformInfo(); - if (STTI->getPopcntHwSupport(32) != ScalarTargetTransformInfo::Fast) + const TargetTransformInfo *TTI = LIR.getTargetTransformInfo(); + if (TTI->getPopcntHwSupport(32) != TargetTransformInfo::Fast) return false; // Counting population are usually conducted by few arithmetic instrutions. @@ -631,7 +629,7 @@ CallInst *NclPopcountRecognize::createPopcntIntrinsic(IRBuilderTy &IRBuilder, /// call, and return true; otherwise, return false. bool NclPopcountRecognize::recognize() { - if (!LIR.getScalarTargetTransformInfo()) + if (!LIR.getTargetTransformInfo()) return false; LIR.getScalarEvolution(); -- 2.34.1