[PATCH] D16857: More detailed memory dependence checking between volatile and non-volatile accesses

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 22 14:20:16 PST 2016

reames accepted this revision.
reames added a comment.
This revision is now accepted and ready to land.

LGTM w/comment addressed.

Comment at: lib/Analysis/MemoryDependenceAnalysis.cpp:654
@@ -653,2 +653,3 @@
       if (SI->isVolatile())
-        return MemDepResult::getClobber(SI);
+        if (!QueryInst || isNonSimpleLoadOrStore(QueryInst))
+          return MemDepResult::getClobber(SI);
Huh, there's actually another bug here I hadn't noticed.  We should be checking to see if the query instruction is another (potentially volatile) memory access.  Simple reusing the isOtherMemoryAccess helper function would fix this.

(To be clear, this is not a new bug, but since we'll be exercising the code more, we should fix it here.  Please add a test case as well.)



More information about the llvm-commits mailing list