mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
[PM] Separate the TargetLibraryInfo object from the immutable pass.
The pass is really just a means of accessing a cached instance of the TargetLibraryInfo object, and this way we can re-use that object for the new pass manager as its result. Lots of delta, but nothing interesting happening here. This is the common pattern that is developing to allow analyses to live in both the old and new pass manager -- a wrapper pass in the old pass manager emulates the separation intrinsic to the new pass manager between the result and pass for analyses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226157 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -468,7 +468,7 @@ namespace {
|
||||
void getAnalysisUsage(AnalysisUsage &AU) const override {
|
||||
AU.addRequired<AliasAnalysis>();
|
||||
AU.addRequired<AssumptionCacheTracker>();
|
||||
AU.addRequired<TargetLibraryInfo>();
|
||||
AU.addRequired<TargetLibraryInfoWrapperPass>();
|
||||
}
|
||||
|
||||
AliasResult alias(const Location &LocA, const Location &LocB) override {
|
||||
@@ -591,7 +591,7 @@ INITIALIZE_AG_PASS_BEGIN(BasicAliasAnalysis, AliasAnalysis, "basicaa",
|
||||
"Basic Alias Analysis (stateless AA impl)",
|
||||
false, true, false)
|
||||
INITIALIZE_PASS_DEPENDENCY(AssumptionCacheTracker)
|
||||
INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfo)
|
||||
INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfoWrapperPass)
|
||||
INITIALIZE_AG_PASS_END(BasicAliasAnalysis, AliasAnalysis, "basicaa",
|
||||
"Basic Alias Analysis (stateless AA impl)",
|
||||
false, true, false)
|
||||
@@ -718,7 +718,8 @@ BasicAliasAnalysis::getModRefBehavior(const Function *F) {
|
||||
if (F->onlyReadsMemory())
|
||||
Min = OnlyReadsMemory;
|
||||
|
||||
const TargetLibraryInfo &TLI = getAnalysis<TargetLibraryInfo>();
|
||||
const TargetLibraryInfo &TLI =
|
||||
getAnalysis<TargetLibraryInfoWrapperPass>().getTLI();
|
||||
if (isMemsetPattern16(F, TLI))
|
||||
Min = OnlyAccessesArgumentPointees;
|
||||
|
||||
@@ -730,7 +731,8 @@ AliasAnalysis::Location
|
||||
BasicAliasAnalysis::getArgLocation(ImmutableCallSite CS, unsigned ArgIdx,
|
||||
ModRefResult &Mask) {
|
||||
Location Loc = AliasAnalysis::getArgLocation(CS, ArgIdx, Mask);
|
||||
const TargetLibraryInfo &TLI = getAnalysis<TargetLibraryInfo>();
|
||||
const TargetLibraryInfo &TLI =
|
||||
getAnalysis<TargetLibraryInfoWrapperPass>().getTLI();
|
||||
const IntrinsicInst *II = dyn_cast<IntrinsicInst>(CS.getInstruction());
|
||||
if (II != nullptr)
|
||||
switch (II->getIntrinsicID()) {
|
||||
|
||||
Reference in New Issue
Block a user