mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
[PM/AA] Split the location computation out of getArgLocation so the
virtual interface on AliasAnalysis only deals with ModRef information. This interface was both computing memory locations by using TLI and other tricks to estimate the size of memory referenced by an operand, and computing ModRef information through similar investigations. This change narrows the scope of the virtual interface on AliasAnalysis slightly. Note that all of this code could live in BasicAA, and be done with a single investigation of the argument, if it weren't for the fact that the generic code in AliasAnalysis::getModRefBehavior for a callsite calls into the virtual aspect of (now) getArgModRefInfo. But this patch's arrangement seems a not terrible way to go for now. The other interesting wrinkle is how we could reasonably extend LLVM with support for custom memory location sizes and mod/ref behavior for library routines. After discussions with Hal on the review, the conclusion is that this would be best done by fleshing out the much desired support for extensions to TLI, and support these types of queries in that interface where we would likely be doing other library API recognition and analysis. Differential Revision: http://reviews.llvm.org/D10259 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239884 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -228,13 +228,12 @@ public:
|
||||
UnknownModRefBehavior = Anywhere | ModRef
|
||||
};
|
||||
|
||||
/// Get the location associated with a pointer argument of a callsite.
|
||||
/// The mask bits are set to indicate the allowed aliasing ModRef kinds.
|
||||
/// Note that these mask bits do not necessarily account for the overall
|
||||
/// behavior of the function, but rather only provide additional
|
||||
/// per-argument information.
|
||||
virtual Location getArgLocation(ImmutableCallSite CS, unsigned ArgIdx,
|
||||
ModRefResult &Mask);
|
||||
/// Get the ModRef info associated with a pointer argument of a callsite. The
|
||||
/// result's bits are set to indicate the allowed aliasing ModRef kinds. Note
|
||||
/// that these bits do not necessarily account for the overall behavior of
|
||||
/// the function, but rather only provide additional per-argument
|
||||
/// information.
|
||||
virtual ModRefResult getArgModRefInfo(ImmutableCallSite CS, unsigned ArgIdx);
|
||||
|
||||
/// getModRefBehavior - Return the behavior when calling the given call site.
|
||||
virtual ModRefBehavior getModRefBehavior(ImmutableCallSite CS);
|
||||
|
||||
@@ -26,6 +26,7 @@ class LoadInst;
|
||||
class StoreInst;
|
||||
class MemTransferInst;
|
||||
class MemIntrinsic;
|
||||
class TargetLibraryInfo;
|
||||
|
||||
/// Representation for a specific memory location.
|
||||
///
|
||||
@@ -87,6 +88,10 @@ public:
|
||||
/// transfer.
|
||||
static MemoryLocation getForDest(const MemIntrinsic *MI);
|
||||
|
||||
/// Return a location representing a particular argument of a call.
|
||||
static MemoryLocation getForArgument(ImmutableCallSite CS, unsigned ArgIdx,
|
||||
const TargetLibraryInfo &TLI);
|
||||
|
||||
explicit MemoryLocation(const Value *Ptr = nullptr,
|
||||
uint64_t Size = UnknownSize,
|
||||
const AAMDNodes &AATags = AAMDNodes())
|
||||
|
||||
Reference in New Issue
Block a user