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

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 28 22:08:00 PDT 2016


chandlerc added inline comments.

================
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;
+
----------------
Why MRI_Ref instead of NoModRef? And in general, why anything different from assume?

================
Comment at: lib/Analysis/BasicAliasAnalysis.cpp:802-813
@@ -794,1 +801,14 @@
 
+  // 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.
+
+  // NB! This function is *not* commutative, so we specical case two
+  // possibilities for guard intrinsics.
+
+  if (isIntrinsicCall(CS1, Intrinsic::experimental_guard))
+    return getModRefBehavior(CS2) & MRI_Mod ? MRI_Ref : MRI_NoModRef;
+
+  if (isIntrinsicCall(CS2, Intrinsic::experimental_guard))
+    return getModRefBehavior(CS1) & MRI_Mod ? MRI_Mod : MRI_NoModRef;
+
----------------
Again, why different behavior from assume?


http://reviews.llvm.org/D19575





More information about the llvm-commits mailing list