[PATCH] D49928: [SLP] Fix PR38339: Instruction does not dominate all uses!

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 31 13:25:44 PDT 2018


ABataev added inline comments.


================
Comment at: llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp:3116
+            Builder.SetInsertPoint(I->getParent(),
+                                   std::next(I->getIterator()));
+          else
----------------
efriedma wrote:
> I don't think `std::next(I->getIterator())` is a valid insertion point in all cases.  V could be a phi, or an invoke, or some exception-handling instruction.
What if something like this:
```
auto It = std::next(I->getIterator());
for (auto E = I->getParent()->end(); It != E; ++It) {
  if (!isa<PHINode>(&*It)) {
    if (It->isEHPad())
      ++It;
    break; 
  }
}
Builder.SetInsertPoint(I->getParent(), It);
```
?


Repository:
  rL LLVM

https://reviews.llvm.org/D49928





More information about the llvm-commits mailing list