aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveRangeEdit.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2023-12-05 10:40:13 +0700
committerGitHub <noreply@github.com>2023-12-05 10:40:13 +0700
commit74c00d432944ca4ada5f105b0d396b55f2692f05 (patch)
tree190d185400a89404450f573ecb3dff3921b0c90a /llvm/lib/CodeGen/LiveRangeEdit.cpp
parent90681d3a41c0f8e12b51b73f1bfa9c366f8189d8 (diff)
downloadllvm-74c00d432944ca4ada5f105b0d396b55f2692f05.zip
llvm-74c00d432944ca4ada5f105b0d396b55f2692f05.tar.gz
llvm-74c00d432944ca4ada5f105b0d396b55f2692f05.tar.bz2
LiveRangeEdit: Clear all dead flags when rematerializing (#73933)
It's allowed to rematerialize instructions with implicit-defs of the same register as the single explicit def. If this happened, it was only clearing the dead flags on the one main result.
Diffstat (limited to 'llvm/lib/CodeGen/LiveRangeEdit.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveRangeEdit.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveRangeEdit.cpp b/llvm/lib/CodeGen/LiveRangeEdit.cpp
index ff49e08..0203034 100644
--- a/llvm/lib/CodeGen/LiveRangeEdit.cpp
+++ b/llvm/lib/CodeGen/LiveRangeEdit.cpp
@@ -190,7 +190,7 @@ SlotIndex LiveRangeEdit::rematerializeAt(MachineBasicBlock &MBB,
// DestReg of the cloned instruction cannot be Dead. Set isDead of DestReg
// to false anyway in case the isDead flag of RM.OrigMI's dest register
// is true.
- (*--MI).getOperand(0).setIsDead(false);
+ (*--MI).clearRegisterDeads(DestReg);
Rematted.insert(RM.ParentVNI);
++NumReMaterialization;