diff options
author | Chris Lattner <sabre@nondot.org> | 2003-12-14 04:52:11 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-12-14 04:52:11 +0000 |
commit | e26092456a6532c5352021ee9043aa22436479ff (patch) | |
tree | 4261431db52d137ca43e843bb9bb535349b05d08 /lib | |
parent | bb8f4769a2ee48b82c30de52083942781e920dd9 (diff) | |
download | external_llvm-e26092456a6532c5352021ee9043aa22436479ff.zip external_llvm-e26092456a6532c5352021ee9043aa22436479ff.tar.gz external_llvm-e26092456a6532c5352021ee9043aa22436479ff.tar.bz2 |
Finegrainify namespacification
Add capability to represent volatile AliasSet's
Propagate this information from loads&stores into the aliassets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10457 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/AliasSetTracker.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/Analysis/AliasSetTracker.cpp b/lib/Analysis/AliasSetTracker.cpp index 4a29344..a3d58d9 100644 --- a/lib/Analysis/AliasSetTracker.cpp +++ b/lib/Analysis/AliasSetTracker.cpp @@ -20,8 +20,7 @@ #include "llvm/Target/TargetData.h" #include "llvm/Assembly/Writer.h" #include "llvm/Support/InstIterator.h" - -namespace llvm { +using namespace llvm; /// mergeSetIn - Merge the specified alias set into this alias set... /// @@ -190,16 +189,21 @@ AliasSet &AliasSetTracker::getAliasSetForPointer(Value *Pointer, unsigned Size){ } void AliasSetTracker::add(LoadInst *LI) { - addPointer(LI->getOperand(0), - AA.getTargetData().getTypeSize(LI->getType()), AliasSet::Refs); + AliasSet &AS = + addPointer(LI->getOperand(0), + AA.getTargetData().getTypeSize(LI->getType()), AliasSet::Refs); + if (LI->isVolatile()) AS.setVolatile(); } void AliasSetTracker::add(StoreInst *SI) { - addPointer(SI->getOperand(1), - AA.getTargetData().getTypeSize(SI->getOperand(0)->getType()), - AliasSet::Mods); + AliasSet &AS = + addPointer(SI->getOperand(1), + AA.getTargetData().getTypeSize(SI->getOperand(0)->getType()), + AliasSet::Mods); + if (SI->isVolatile()) AS.setVolatile(); } + void AliasSetTracker::add(CallSite CS) { AliasSet *AS = findAliasSetForCallSite(CS); if (!AS) { @@ -263,6 +267,7 @@ void AliasSet::print(std::ostream &OS) const { case ModRef : OS << "Mod/Ref "; break; default: assert(0 && "Bad value for AccessTy!"); } + if (isVolatile()) OS << "[volatile] "; if (Forward) OS << " forwarding to " << (void*)Forward; @@ -329,5 +334,3 @@ namespace { RegisterPass<AliasSetPrinter> X("print-alias-sets", "Alias Set Printer", PassInfo::Analysis | PassInfo::Optimization); } - -} // End llvm namespace |