[llvm-commits] [llvm] r171616 - /llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
Chandler Carruth
chandlerc at gmail.com
Sat Jan 5 02:00:09 PST 2013
Author: chandlerc
Date: Sat Jan 5 04:00:09 2013
New Revision: 171616
URL: http://llvm.org/viewvc/llvm-project?rev=171616&view=rev
Log:
Switch LoopIdiomRecognize to directly use the TargetTransformInfo
interface rather than the ScalarTargetTransformInterface.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp?rev=171616&r1=171615&r2=171616&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp Sat Jan 5 04:00:09 2013
@@ -135,12 +135,12 @@
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 @@
return TLI ? TLI : (TLI = &getAnalysis<TargetLibraryInfo>());
}
- const ScalarTargetTransformInfo *getScalarTargetTransformInfo() {
- if (!STTI) {
- TargetTransformInfo *TTI = getAnalysisIfAvailable<TargetTransformInfo>();
- if (TTI) STTI = TTI->getScalarTargetTransformInfo();
- }
- return STTI;
+ const TargetTransformInfo *getTargetTransformInfo() {
+ if (!TTI)
+ TTI = getAnalysisIfAvailable<TargetTransformInfo>();
+ return TTI;
}
Loop *getLoop() const { return CurLoop; }
@@ -312,8 +310,8 @@
}
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 @@
/// call, and return true; otherwise, return false.
bool NclPopcountRecognize::recognize() {
- if (!LIR.getScalarTargetTransformInfo())
+ if (!LIR.getTargetTransformInfo())
return false;
LIR.getScalarEvolution();
More information about the llvm-commits
mailing list