summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-08-15 21:56:39 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-08-15 21:56:39 +0000
commit4419cd2464fcad10665524e1e1f504c985a03700 (patch)
treed1fe2946643823c36e8a8cfeb6fce6f9f018692a /llvm/lib/Analysis
parentcbe7feeab99395287ecafbca05a1f45e798d43f2 (diff)
downloadbcm5719-llvm-4419cd2464fcad10665524e1e1f504c985a03700.tar.gz
bcm5719-llvm-4419cd2464fcad10665524e1e1f504c985a03700.zip
Add some comments here because the lack of a check for volatile/atomic here is a bit unusual.
llvm-svn: 137662
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/Loads.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/Loads.cpp b/llvm/lib/Analysis/Loads.cpp
index 18f3a3465b5..0e6bcbfae4f 100644
--- a/llvm/lib/Analysis/Loads.cpp
+++ b/llvm/lib/Analysis/Loads.cpp
@@ -188,12 +188,16 @@ Value *llvm::FindAvailableLoadedValue(Value *Ptr, BasicBlock *ScanBB,
--ScanFrom;
// If this is a load of Ptr, the loaded value is available.
+ // (This is true even if the load is volatile or atomic, although
+ // those cases are unlikely.)
if (LoadInst *LI = dyn_cast<LoadInst>(Inst))
if (AreEquivalentAddressValues(LI->getOperand(0), Ptr))
return LI;
if (StoreInst *SI = dyn_cast<StoreInst>(Inst)) {
// If this is a store through Ptr, the value is available!
+ // (This is true even if the store is volatile or atomic, although
+ // those cases are unlikely.)
if (AreEquivalentAddressValues(SI->getOperand(1), Ptr))
return SI->getOperand(0);
OpenPOWER on IntegriCloud