[PATCH] D12838: [GlobalsAA] Teach GlobalsAA about memory intrinsics

Arnaud de Grandmaison via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 14 09:56:10 PDT 2015


aadg added inline comments.

================
Comment at: lib/Analysis/GlobalsModRef.cpp:776-782
@@ +775,9 @@
+  default:
+    return MRI_ModRef;
+  case Intrinsic::memset:
+    return (Operands[0] ? MRI_Mod : MRI_NoModRef);
+  case Intrinsic::memcpy:
+  case Intrinsic::memmove:
+    return static_cast<ModRefInfo>((Operands[0] ? MRI_Mod : MRI_NoModRef) |
+                                   (Operands[1] ? MRI_Ref : MRI_NoModRef));
+  }
----------------
hfinkel wrote:
> sanjoy wrote:
> > aadg wrote:
> > > Shouldn't we also handle the isVolatile argument ? As anything could happen when this is a volatile operation, I think we should always return MRI_ModRef when it is set.
> > Can we do something more precise here if the intrinsic is readonly or readnone?
> I agree with James's response (from the list, which is seems did not make it into Phabricator); volatility and aliasing are orthogonal concepts, and while we do imply aliasing affects to volatile operations (and atomics) in various places (for reasons that I'm sure seemed convenient at the time), it is really not a good thing, and I see no reason to do so here.
> 
Ok, I agree checking the volatileness should not be done here, but at the place where the aliasing information is used.


Repository:
  rL LLVM

http://reviews.llvm.org/D12838





More information about the llvm-commits mailing list