Skip to content

Commit 6d7b402

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. (cherry picked from commit 44c9e46)
1 parent 578d2a2 commit 6d7b402

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
@@ -1066,7 +1066,7 @@ auto MachineFunction::salvageCopySSA(
10661066
// Check whether this copy-like instruction has already been salvaged into
10671067
// an operand pair.
10681068
Register Dest;
1069-
if (auto CopyDstSrc = TII.isCopyInstr(MI)) {
1069+
if (auto CopyDstSrc = TII.isCopyLikeInstr(MI)) {
10701070
Dest = CopyDstSrc->Destination->getReg();
10711071
} else {
10721072
assert(MI.isSubregToReg());
@@ -1150,7 +1150,7 @@ auto MachineFunction::salvageCopySSAImpl(MachineInstr &MI)
11501150
CurInst = Inst.getIterator();
11511151

11521152
// Any non-copy instruction is the defining instruction we're seeking.
1153-
if (!Inst.isCopyLike() && !TII.isCopyInstr(Inst))
1153+
if (!Inst.isCopyLike() && !TII.isCopyLikeInstr(Inst))
11541154
break;
11551155
State = GetRegAndSubreg(Inst);
11561156
};

0 commit comments

Comments
 (0)