[PATCH] D9398: llvm.noalias - GetUnderlyingObjects to optionally collect noalias calls

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 9 15:09:04 PDT 2016


majnemer added a subscriber: majnemer.

================
Comment at: include/llvm/Analysis/ValueTracking.h:223-225
@@ -222,7 +222,5 @@
   /// be stripped off.
   Value *GetUnderlyingObject(Value *V, const DataLayout &DL,
-                             unsigned MaxLookup = 6);
-  static inline const Value *GetUnderlyingObject(const Value *V,
-                                                 const DataLayout &DL,
-                                                 unsigned MaxLookup = 6) {
-    return GetUnderlyingObject(const_cast<Value *>(V), DL, MaxLookup);
+                             unsigned MaxLookup = 6,
+                             SmallVectorImpl<Instruction *> *NoAlias = nullptr);
+  static inline
----------------
Perhaps the `NoAlias` parameter deserves a mention?

================
Comment at: lib/Analysis/ValueTracking.cpp:2985
@@ -2983,1 +2984,3 @@
     } else {
+      if (IntrinsicInst *I = dyn_cast<IntrinsicInst>(V))
+        if (I->getIntrinsicID() == Intrinsic::noalias) {
----------------
`auto *I`

================
Comment at: lib/Analysis/ValueTracking.cpp:2985
@@ -2983,1 +2984,3 @@
     } else {
+      if (IntrinsicInst *I = dyn_cast<IntrinsicInst>(V))
+        if (I->getIntrinsicID() == Intrinsic::noalias) {
----------------
majnemer wrote:
> `auto *I`
Should we assign `V` the value of `I->getOperand(0)` ?

================
Comment at: lib/Analysis/ValueTracking.cpp:2985-2986
@@ -2983,1 +2984,4 @@
     } else {
+      if (IntrinsicInst *I = dyn_cast<IntrinsicInst>(V))
+        if (I->getIntrinsicID() == Intrinsic::noalias) {
+          if (NoAlias)
----------------
majnemer wrote:
> majnemer wrote:
> > `auto *I`
> Should we assign `V` the value of `I->getOperand(0)` ?
The following might be a little shorter:
  if (match(V, m_Intrinsic<Intrinsic::noalias>())

================
Comment at: lib/Analysis/ValueTracking.cpp:2986
@@ +2985,3 @@
+      if (IntrinsicInst *I = dyn_cast<IntrinsicInst>(V))
+        if (I->getIntrinsicID() == Intrinsic::noalias) {
+          if (NoAlias)
----------------
Braces are unneeded.


http://reviews.llvm.org/D9398





More information about the llvm-commits mailing list