[llvm] [SLP]Remove operands upon marking instruction for deletion. (PR #97409)
Martin Storsjö via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 9 02:07:21 PDT 2024
mstorsjo wrote:
This change has caused failed asserts. Strangely enough, the failed asserts aren't entirely deterministic though. Reduced testcase:
```c
int b;
float c;
int e;
void f(float p1[]) {
float *j = &b;
for (e = 0; e < 2;) {
float a;
float d;
{
a += p1[e] * 0;
d += e * j[e];
}
e = a;
c = d;
}
}
```
To reproduce:
```
$ clang -target i686-linux-gnu -c repro.c -O2 -g
clang: ../lib/IR/Instruction.cpp:153: void llvm::Instruction::insertBefore(llvm:
:BasicBlock&, llvm::iplist_impl<llvm::simple_ilist<llvm::Instruction, llvm::ilis
t_iterator_bits<true>, llvm::ilist_parent<llvm::BasicBlock> >, llvm::SymbolTable
ListTraits<llvm::Instruction, llvm::ilist_iterator_bits<true>, llvm::ilist_paren
t<llvm::BasicBlock> > >::iterator): Assertion `!isa<PHINode>(this) && "Inserting
PHI after debug-records!"' failed.
```
Please have a look, and consider reverting if fixing takes a long time.
https://github.com/llvm/llvm-project/pull/97409
More information about the llvm-commits
mailing list