mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
Extend the AliasAnalysis::pointsToConstantMemory interface to allow it
to optionally look for constant or local (alloca) memory. Teach BasicAliasAnalysis::pointsToConstantMemory to look through Select and Phi nodes, and to support looking for local memory. Remove FunctionAttrs' PointsToLocalOrConstantMemory function, now that AliasAnalysis knows all the tricks that it knew. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118412 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -138,7 +138,7 @@ namespace {
|
||||
private:
|
||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
|
||||
virtual AliasResult alias(const Location &LocA, const Location &LocB);
|
||||
virtual bool pointsToConstantMemory(const Location &Loc);
|
||||
virtual bool pointsToConstantMemory(const Location &Loc, bool OrLocal);
|
||||
virtual ModRefResult getModRefInfo(ImmutableCallSite CS,
|
||||
const Location &Loc);
|
||||
virtual ModRefResult getModRefInfo(ImmutableCallSite CS1,
|
||||
@ -225,19 +225,20 @@ TypeBasedAliasAnalysis::alias(const Location &LocA,
|
||||
return NoAlias;
|
||||
}
|
||||
|
||||
bool TypeBasedAliasAnalysis::pointsToConstantMemory(const Location &Loc) {
|
||||
bool TypeBasedAliasAnalysis::pointsToConstantMemory(const Location &Loc,
|
||||
bool OrLocal) {
|
||||
if (!EnableTBAA)
|
||||
return AliasAnalysis::pointsToConstantMemory(Loc);
|
||||
return AliasAnalysis::pointsToConstantMemory(Loc, OrLocal);
|
||||
|
||||
const MDNode *M = Loc.TBAATag;
|
||||
if (!M) return AliasAnalysis::pointsToConstantMemory(Loc);
|
||||
if (!M) return AliasAnalysis::pointsToConstantMemory(Loc, OrLocal);
|
||||
|
||||
// If this is an "immutable" type, we can assume the pointer is pointing
|
||||
// to constant memory.
|
||||
if (TBAANode(M).TypeIsImmutable())
|
||||
return true;
|
||||
|
||||
return AliasAnalysis::pointsToConstantMemory(Loc);
|
||||
return AliasAnalysis::pointsToConstantMemory(Loc, OrLocal);
|
||||
}
|
||||
|
||||
AliasAnalysis::ModRefResult
|
||||
|
Reference in New Issue
Block a user