[PATCH] D43323: [NFC] Consolidate six getPointerOperand() utility functions into one place

Ashutosh Nema via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 15 21:47:34 PST 2018


ashutosh.nema added a comment.

Mostly looks OK, just few minor comment.



================
Comment at: lib/Analysis/DependenceAnalysis.cpp:3169
                                     SmallVectorImpl<Subscript> &Pair) {
-  Value *SrcPtr = getPointerOperand(Src);
-  Value *DstPtr = getPointerOperand(Dst);
+  assert(isLoadOrStore(Src));
+  assert(isLoadOrStore(Dst));
----------------
Its good to assert with a message, i.e. "Instruction is not load or store Instruction"


================
Comment at: lib/Analysis/DependenceAnalysis.cpp:3297
 
-  Value *SrcPtr = getPointerOperand(Src);
-  Value *DstPtr = getPointerOperand(Dst);
+  assert(isLoadOrStore(Src));
+  assert(isLoadOrStore(Dst));
----------------
Please add assert message !


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:5572
             return !TheLoop->contains(J) || Worklist.count(J) ||
-                   (OI == getPointerOperand(J) && isUniformDecision(J, VF));
+                   (OI == getLoadStorePointerOperand(J) && isUniformDecision(J, VF));
           })) {
----------------
need to correct indentation


Repository:
  rL LLVM

https://reviews.llvm.org/D43323





More information about the llvm-commits mailing list