[PATCH] D46302: [LV] Fix for PR37248, Broadcast codegen incorrectly assumed vector loop body is single basic block

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 4 06:01:13 PDT 2018


fhahn added inline comments.


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:1743
+  bool NewInstr = Instr &&
+                  !DT->dominates(Instr->getParent(), LoopVectorPreHeader);
   bool Invariant = OrigLoop->isLoopInvariant(V) && !NewInstr;
----------------
IIUC we want to check here if Instr is part of the vector loop, right? Wouldn't it be more straight forward to check if the vector loop header dominates Instr?


================
Comment at: test/Transforms/LoopVectorize/pr37248.ll:1
+; RUN: opt -passes='loop-vectorize' -force-vector-width=2 -S < %s
+;
----------------
Not sure if the property change above means that test/Transforms/LoopVectorize/pr37248.ll is marked as executable. If that's the case, it would be great if you could remove the property before committing.

Also, is it worth adding a simple check making sure the loop is vectorized?


Repository:
  rL LLVM

https://reviews.llvm.org/D46302





More information about the llvm-commits mailing list