[PATCH] D44067: [LV] Improving "Control-Flow-Select" Vectorization remark.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 19 10:32:26 PDT 2018


fhahn added a comment.

There are a few issues with formatting (trailing spaces, using tabs, lines > 80 chars, see https://llvm.org/docs/CodingStandards.html). Could you use clang-format to format the diff?



================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:1652
   /// and we know that we can read from them without segfault.
-  bool blockCanBePredicated(BasicBlock *BB, SmallPtrSetImpl<Value *> &SafePtrs);
+  bool blockCanBePredicated(BasicBlock *BB, SmallPtrSetImpl<Value *> &SafePtrs, Instruction **SelectRemarkInstruction);
 
----------------
You could use a reference to an instruction pointer here I think (`Instruction *&SelectRemarkInstruction`). This would simplify the code slightly (a few less * and &) with the bonus of not being able to pass in nullptr).


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:4803
     if (blockNeedsPredication(BB)) {
-      if (!blockCanBePredicated(BB, SafePointes)) {
-        ORE->emit(createMissedAnalysis("NoCFGForSelect", BB->getTerminator())
-                  << "control flow cannot be substituted for a select");
+      Instruction *SelectRemarkInstruction;	    
+      if (!blockCanBePredicated(BB, SafePointes, &SelectRemarkInstruction)) {
----------------
I think we should initialize this with nullptr. So things fall over quickly if we miss a case in blockCanBePredicated.


https://reviews.llvm.org/D44067





More information about the llvm-commits mailing list