Skip to content

Commit 44c9e46

Browse files
[InstrRef] Fix mismatch between LiveDebugValues and salvageCopySSA (llvm#124233)
The LiveDebugValues pass and the instruction selector (which calls salvageCopySSA) need to be consistent on what they consider a copy instruction. With llvm#75184, the definition of what a copy instruction is was narrowed for AArch64 to exclude a w->x ORR and treat it as a zero-extend rather than a copy However, to make sure LiveDebugValues still treats a w->x ORR as a copy, the new function, isCopyLikeInstr was created. We need to make sure that salvageCopySSA also calls that function. This patch addresses this mismatch.
1 parent e7de603 commit 44c9e46

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/CodeGen/MachineFunction.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,7 @@ auto MachineFunction::salvageCopySSA(
10541054
// Check whether this copy-like instruction has already been salvaged into
10551055
// an operand pair.
10561056
Register Dest;
1057-
if (auto CopyDstSrc = TII.isCopyInstr(MI)) {
1057+
if (auto CopyDstSrc = TII.isCopyLikeInstr(MI)) {
10581058
Dest = CopyDstSrc->Destination->getReg();
10591059
} else {
10601060
assert(MI.isSubregToReg());
@@ -1138,7 +1138,7 @@ auto MachineFunction::salvageCopySSAImpl(MachineInstr &MI)
11381138
CurInst = Inst.getIterator();
11391139

11401140
// Any non-copy instruction is the defining instruction we're seeking.
1141-
if (!Inst.isCopyLike() && !TII.isCopyInstr(Inst))
1141+
if (!Inst.isCopyLike() && !TII.isCopyLikeInstr(Inst))
11421142
break;
11431143
State = GetRegAndSubreg(Inst);
11441144
};

0 commit comments

Comments
 (0)