Skip to content

Commit f03ba98

Browse files
committed
Remove the MMO instead in LiveRangeEdit.
1 parent c5df1fd commit f03ba98

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

llvm/lib/CodeGen/LiveRangeEdit.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ void LiveRangeEdit::eliminateDeadDef(MachineInstr *MI, ToShrinkSet &ToShrink) {
385385
continue;
386386
MI->removeOperand(i-1);
387387
}
388+
MI->dropMemRefs(*MI->getMF());
388389
LLVM_DEBUG(dbgs() << "Converted physregs to:\t" << *MI);
389390
} else {
390391
// If the dest of MI is an original reg and MI is reMaterializable,

llvm/lib/CodeGen/MachineVerifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2271,7 +2271,7 @@ void MachineVerifier::visitMachineInstrBefore(const MachineInstr *MI) {
22712271

22722272
// Check the MachineMemOperands for basic consistency.
22732273
for (MachineMemOperand *Op : MI->memoperands()) {
2274-
if (Op->isLoad() && (!MI->mayLoad() && !MI->isKill()))
2274+
if (Op->isLoad() && !MI->mayLoad())
22752275
report("Missing mayLoad flag", MI);
22762276
if (Op->isStore() && !MI->mayStore())
22772277
report("Missing mayStore flag", MI);

llvm/test/CodeGen/SystemZ/machine-ver-kill-memop.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z16 -disable-machine-dce \
22
; RUN: -verify-machineinstrs -O3
33
;
4-
; Test that this passes the verifier even though a KILL instruction with a
5-
; dangling memory operand emerges.
4+
; Test that the MemoryOperand of the produced KILL instruction is removed
5+
; and as a result the machine verifier succeeds.
66

77
define void @fun(ptr %Src, ptr %Dst) {
88
br label %2

0 commit comments

Comments
 (0)