Diff Detail
Event Timeline
Sometimes the CurrList may have two identical instructions that will be coalesced later. Once the first one coalesced, it will be removed from its parent, this will make the second identical instruction become illegal at the same time which getParent will be a nullptr. In this case, we should avoid coalescing erased instruction.<br>
The test case will trigger an Assertion like the following:
llvm-project/llvm/include/llvm/CodeGen/MachineOperand.h:359: llvm::Register llvm::MachineOperand::getReg() const: Assertion `isReg() && "This is not a register operand!"' failed.
Also recorded in Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=50919
llvm/lib/CodeGen/RegisterCoalescer.cpp | ||
---|---|---|
3869 |
When that happens the instruction should be part of ErasedInst and we would skip it in the next conditional block. Why is it not happening? BTW
It is removed or erased? If the latter, accessing the pointer is UB, so testing getParent is invalid. |
When that happens the instruction should be part of ErasedInst and we would skip it in the next conditional block.
Why is it not happening?
BTW
It is removed or erased? If the latter, accessing the pointer is UB, so testing getParent is invalid.