[PATCH] D105031: [SLP]Fix non-determinism in PHI sorting.
Alexey Bataev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 19 03:03:44 PDT 2021
ABataev added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:8371
if (auto *I2 = dyn_cast<Instruction>(Opcodes2[I])) {
- if (I1->getParent() < I2->getParent())
- return true;
- if (I1->getParent() > I2->getParent())
- return false;
+ DomTreeNodeBase<BasicBlock> *NodeI1 = DT->getNode(I1->getParent());
+ DomTreeNodeBase<BasicBlock> *NodeI2 = DT->getNode(I2->getParent());
----------------
skatkov wrote:
> Please note that we met triggering this assert. The reduced by bugpoint reproducer looks as follows:
>
> ```
> define void @bar() {
> bb:
> %tmp = load atomic i8*, i8** undef unordered, align 8
> br label %bb6
>
> bb5: ; No predecessors!
> %tmp4 = load atomic i8*, i8** undef unordered, align 8
> br label %bb6
>
> bb6: ; preds = %bb5, %bb
> %tmp7 = phi i8* [ %tmp, %bb5 ], [ undef, %bb ]
> %tmp8 = phi i8* [ %tmp4, %bb5 ], [ undef, %bb ]
> ret void
> }
> ```
> It looks like we can reach this code with unreachable instruction and it is not guarded in optimization.
>
> Could you please fix it or revert the patch.
Will fix it ASAP.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105031/new/
https://reviews.llvm.org/D105031
More information about the llvm-commits
mailing list