diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2024-05-22 17:04:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-22 17:04:17 +0200 |
commit | d41dde70c44a10f9761242df73fdd288c4660c8d (patch) | |
tree | 7264d27fbef0c3b881ea81022ccaa1f87a534481 /llvm/lib/CodeGen/LiveRangeEdit.cpp | |
parent | a70ecfb267e1fe7d72c94a3cf1675b1f8df99860 (diff) | |
download | llvm-d41dde70c44a10f9761242df73fdd288c4660c8d.zip llvm-d41dde70c44a10f9761242df73fdd288c4660c8d.tar.gz llvm-d41dde70c44a10f9761242df73fdd288c4660c8d.tar.bz2 |
LiveRangeEdit: Replace setIsDead with an assert (#92964)
I noticed this was possibly buggy with implicit operands with the same
dest register, and should maybe be using addRegisterDead. However, this
is never called in a situation where the operand wasn't already marked
dead. This is eliminateDeadDef, implying the def was already known to be
dead.
Add an assert to detect inconsistencies in dead flags. This was
apparently added in 9a16d655c71826bef98b7d6e9590e4494ac0e1a9.
Diffstat (limited to 'llvm/lib/CodeGen/LiveRangeEdit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveRangeEdit.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveRangeEdit.cpp b/llvm/lib/CodeGen/LiveRangeEdit.cpp index 643370f..7b7b545 100644 --- a/llvm/lib/CodeGen/LiveRangeEdit.cpp +++ b/llvm/lib/CodeGen/LiveRangeEdit.cpp @@ -414,7 +414,7 @@ void LiveRangeEdit::eliminateDeadDef(MachineInstr *MI, ToShrinkSet &ToShrink) { DeadRemats->insert(MI); const TargetRegisterInfo &TRI = *MRI.getTargetRegisterInfo(); MI->substituteRegister(Dest, NewLI.reg(), 0, TRI); - MI->getOperand(0).setIsDead(true); + assert(MI->registerDefIsDead(NewLI.reg(), &TRI)); } else { if (TheDelegate) TheDelegate->LRE_WillEraseInstruction(MI); |