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

Hideki Saito via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 16 13:35:03 PST 2018


hsaito added inline comments.


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


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


================
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));
           })) {
----------------
ashutosh.nema wrote:
> need to correct indentation
Fixed long line. Or did you mean the indentation at line 5570?


https://reviews.llvm.org/D43323





More information about the llvm-commits mailing list