mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-15 09:33:39 +00:00
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
This commit is contained in:
parent
9eac3912d3
commit
9980b8a0bd
@ -135,12 +135,12 @@ namespace {
|
|||||||
DominatorTree *DT;
|
DominatorTree *DT;
|
||||||
ScalarEvolution *SE;
|
ScalarEvolution *SE;
|
||||||
TargetLibraryInfo *TLI;
|
TargetLibraryInfo *TLI;
|
||||||
const ScalarTargetTransformInfo *STTI;
|
const TargetTransformInfo *TTI;
|
||||||
public:
|
public:
|
||||||
static char ID;
|
static char ID;
|
||||||
explicit LoopIdiomRecognize() : LoopPass(ID) {
|
explicit LoopIdiomRecognize() : LoopPass(ID) {
|
||||||
initializeLoopIdiomRecognizePass(*PassRegistry::getPassRegistry());
|
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);
|
bool runOnLoop(Loop *L, LPPassManager &LPM);
|
||||||
@ -195,12 +195,10 @@ namespace {
|
|||||||
return TLI ? TLI : (TLI = &getAnalysis<TargetLibraryInfo>());
|
return TLI ? TLI : (TLI = &getAnalysis<TargetLibraryInfo>());
|
||||||
}
|
}
|
||||||
|
|
||||||
const ScalarTargetTransformInfo *getScalarTargetTransformInfo() {
|
const TargetTransformInfo *getTargetTransformInfo() {
|
||||||
if (!STTI) {
|
if (!TTI)
|
||||||
TargetTransformInfo *TTI = getAnalysisIfAvailable<TargetTransformInfo>();
|
TTI = getAnalysisIfAvailable<TargetTransformInfo>();
|
||||||
if (TTI) STTI = TTI->getScalarTargetTransformInfo();
|
return TTI;
|
||||||
}
|
|
||||||
return STTI;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Loop *getLoop() const { return CurLoop; }
|
Loop *getLoop() const { return CurLoop; }
|
||||||
@ -312,8 +310,8 @@ NclPopcountRecognize::NclPopcountRecognize(LoopIdiomRecognize &TheLIR):
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool NclPopcountRecognize::preliminaryScreen() {
|
bool NclPopcountRecognize::preliminaryScreen() {
|
||||||
const ScalarTargetTransformInfo *STTI = LIR.getScalarTargetTransformInfo();
|
const TargetTransformInfo *TTI = LIR.getTargetTransformInfo();
|
||||||
if (STTI->getPopcntHwSupport(32) != ScalarTargetTransformInfo::Fast)
|
if (TTI->getPopcntHwSupport(32) != TargetTransformInfo::Fast)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Counting population are usually conducted by few arithmetic instrutions.
|
// 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.
|
/// call, and return true; otherwise, return false.
|
||||||
bool NclPopcountRecognize::recognize() {
|
bool NclPopcountRecognize::recognize() {
|
||||||
|
|
||||||
if (!LIR.getScalarTargetTransformInfo())
|
if (!LIR.getTargetTransformInfo())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
LIR.getScalarEvolution();
|
LIR.getScalarEvolution();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user