[PATCH] D19575: [BasicAA] Guard intrinsics don't write to memory

George Burgess IV via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 28 23:47:54 PDT 2016


george.burgess.iv added a subscriber: george.burgess.iv.

================
Comment at: lib/Analysis/BasicAliasAnalysis.cpp:783-787
@@ -782,1 +782,7 @@
 
+  // Like assumes, guard intrinsics are also marked as arbitrarily writing so
+  // that proper control dependencies are maintained but they never alias any
+  // particular memory location.
+  if (isIntrinsicCall(CS, Intrinsic::experimental_guard))
+    return MRI_Ref;
+
----------------
sanjoy wrote:
> chandlerc wrote:
> > Why MRI_Ref instead of NoModRef? And in general, why anything different from assume?
> Guards have deoptimization state (via `"deopt"` operand bundles) and are thus allowed to read all memory.  If a guard fails then, at the time of failure, the heap better look like it was supposed to look like in the original program.  E.g. see `@test6` in D19578.
Can you add a comment in the code noting this, please? :)


http://reviews.llvm.org/D19575





More information about the llvm-commits mailing list