diff options
author | Hal Finkel <hfinkel@anl.gov> | 2014-07-24 12:16:19 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2014-07-24 12:16:19 +0000 |
commit | cc39b675308922229f7e16ceb47e8d9b5b2e8dcd (patch) | |
tree | 8f00abe761e89b654d46a79dd14dcd45a3d27777 /llvm/lib/Analysis/Loads.cpp | |
parent | 545ff90d47c241e5dc6869be9377a75f718aa4c1 (diff) | |
download | bcm5719-llvm-cc39b675308922229f7e16ceb47e8d9b5b2e8dcd.tar.gz bcm5719-llvm-cc39b675308922229f7e16ceb47e8d9b5b2e8dcd.zip |
AA metadata refactoring (introduce AAMDNodes)
In order to enable the preservation of noalias function parameter information
after inlining, and the representation of block-level __restrict__ pointer
information (etc.), additional kinds of aliasing metadata will be introduced.
This metadata needs to be carried around in AliasAnalysis::Location objects
(and MMOs at the SDAG level), and so we need to generalize the current scheme
(which is hard-coded to just one TBAA MDNode*).
This commit introduces only the necessary refactoring to allow for the
introduction of other aliasing metadata types, but does not actually introduce
any (that will come in a follow-up commit). What it does introduce is a new
AAMDNodes structure to hold all of the aliasing metadata nodes associated with
a particular memory-accessing instruction, and uses that structure instead of
the raw MDNode* in AliasAnalysis::Location, etc.
No functionality change intended.
llvm-svn: 213859
Diffstat (limited to 'llvm/lib/Analysis/Loads.cpp')
-rw-r--r-- | llvm/lib/Analysis/Loads.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/Loads.cpp b/llvm/lib/Analysis/Loads.cpp index 005d309894c..f4a4c8aff0b 100644 --- a/llvm/lib/Analysis/Loads.cpp +++ b/llvm/lib/Analysis/Loads.cpp @@ -133,14 +133,14 @@ bool llvm::isSafeToLoadUnconditionally(Value *V, Instruction *ScanFrom, /// it is set to 0, it will scan the whole block. You can also optionally /// specify an alias analysis implementation, which makes this more precise. /// -/// If TBAATag is non-null and a load or store is found, the TBAA tag from the -/// load or store is recorded there. If there is no TBAA tag or if no access +/// If AATags is non-null and a load or store is found, the AA tags from the +/// load or store are recorded there. If there are no AA tags or if no access /// is found, it is left unmodified. Value *llvm::FindAvailableLoadedValue(Value *Ptr, BasicBlock *ScanBB, BasicBlock::iterator &ScanFrom, unsigned MaxInstsToScan, AliasAnalysis *AA, - MDNode **TBAATag) { + AAMDNodes *AATags) { if (MaxInstsToScan == 0) MaxInstsToScan = ~0U; // If we're using alias analysis to disambiguate get the size of *Ptr. @@ -169,7 +169,7 @@ Value *llvm::FindAvailableLoadedValue(Value *Ptr, BasicBlock *ScanBB, // those cases are unlikely.) if (LoadInst *LI = dyn_cast<LoadInst>(Inst)) if (AreEquivalentAddressValues(LI->getOperand(0), Ptr)) { - if (TBAATag) *TBAATag = LI->getMetadata(LLVMContext::MD_tbaa); + if (AATags) LI->getAAMetadata(*AATags); return LI; } @@ -178,7 +178,7 @@ Value *llvm::FindAvailableLoadedValue(Value *Ptr, BasicBlock *ScanBB, // (This is true even if the store is volatile or atomic, although // those cases are unlikely.) if (AreEquivalentAddressValues(SI->getOperand(1), Ptr)) { - if (TBAATag) *TBAATag = SI->getMetadata(LLVMContext::MD_tbaa); + if (AATags) SI->getAAMetadata(*AATags); return SI->getOperand(0); } |