mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-23 22:23:00 +00:00
Propagate TargetLibraryInfo throughout ConstantFolding.cpp and
InstructionSimplify.cpp. Other fixups as needed. Part of rdar://10500969 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145559 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -74,6 +74,7 @@
|
||||
#include "llvm/Analysis/ValueTracking.h"
|
||||
#include "llvm/Assembly/Writer.h"
|
||||
#include "llvm/Target/TargetData.h"
|
||||
#include "llvm/Target/TargetLibraryInfo.h"
|
||||
#include "llvm/Support/CommandLine.h"
|
||||
#include "llvm/Support/ConstantRange.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
@@ -108,6 +109,7 @@ INITIALIZE_PASS_BEGIN(ScalarEvolution, "scalar-evolution",
|
||||
"Scalar Evolution Analysis", false, true)
|
||||
INITIALIZE_PASS_DEPENDENCY(LoopInfo)
|
||||
INITIALIZE_PASS_DEPENDENCY(DominatorTree)
|
||||
INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfo)
|
||||
INITIALIZE_PASS_END(ScalarEvolution, "scalar-evolution",
|
||||
"Scalar Evolution Analysis", false, true)
|
||||
char ScalarEvolution::ID = 0;
|
||||
@@ -3116,7 +3118,7 @@ const SCEV *ScalarEvolution::createNodeForPHI(PHINode *PN) {
|
||||
// PHI's incoming blocks are in a different loop, in which case doing so
|
||||
// risks breaking LCSSA form. Instcombine would normally zap these, but
|
||||
// it doesn't have DominatorTree information, so it may miss cases.
|
||||
if (Value *V = SimplifyInstruction(PN, TD, DT))
|
||||
if (Value *V = SimplifyInstruction(PN, TD, TLI, DT))
|
||||
if (LI->replacementPreservesLCSSAForm(PN, V))
|
||||
return getSCEV(V);
|
||||
|
||||
@@ -6560,6 +6562,7 @@ bool ScalarEvolution::runOnFunction(Function &F) {
|
||||
this->F = &F;
|
||||
LI = &getAnalysis<LoopInfo>();
|
||||
TD = getAnalysisIfAvailable<TargetData>();
|
||||
TLI = &getAnalysis<TargetLibraryInfo>();
|
||||
DT = &getAnalysis<DominatorTree>();
|
||||
return false;
|
||||
}
|
||||
@@ -6596,6 +6599,7 @@ void ScalarEvolution::getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
AU.setPreservesAll();
|
||||
AU.addRequiredTransitive<LoopInfo>();
|
||||
AU.addRequiredTransitive<DominatorTree>();
|
||||
AU.addRequired<TargetLibraryInfo>();
|
||||
}
|
||||
|
||||
bool ScalarEvolution::hasLoopInvariantBackedgeTakenCount(const Loop *L) {
|
||||
|
||||
Reference in New Issue
Block a user