Add some comments here because the lack of a check for volatile/atomic here is a...
authorEli Friedman <eli.friedman@gmail.com>
Mon, 15 Aug 2011 21:56:39 +0000 (21:56 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Mon, 15 Aug 2011 21:56:39 +0000 (21:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137662 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/Loads.cpp

index 18f3a3465b5d2d01cfa2bf887f8ec6dfde9fc9ac..0e6bcbfae4f6546ddf2f5d383df17bb70783c894 100644 (file)
@@ -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);