Skip to content

Commit 81fee74

Browse files
authored
[Hexagon] Mark instructions as part of the frame setup to fix test sugared-constants.ll (#111795)
Added .setMIFlag(MachineInstr::FrameSetup) to all BuildMI calls in HexagonFrameLowering::insertAllocframe. This change ensures that the test sugared-constants.ll passes upstream by correctly marking instructions as part of the frame setup.
1 parent 84b99b4 commit 81fee74

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -906,22 +906,25 @@ void HexagonFrameLowering::insertAllocframe(MachineBasicBlock &MBB,
906906
if (NumBytes >= ALLOCFRAME_MAX) {
907907
// Emit allocframe(#0).
908908
BuildMI(MBB, InsertPt, dl, HII.get(Hexagon::S2_allocframe))
909-
.addDef(SP)
910-
.addReg(SP)
911-
.addImm(0)
912-
.addMemOperand(MMO);
909+
.addDef(SP)
910+
.addReg(SP)
911+
.addImm(0)
912+
.addMemOperand(MMO)
913+
.setMIFlag(MachineInstr::FrameSetup);
913914

914915
// Subtract the size from the stack pointer.
915916
Register SP = HRI.getStackRegister();
916917
BuildMI(MBB, InsertPt, dl, HII.get(Hexagon::A2_addi), SP)
917-
.addReg(SP)
918-
.addImm(-int(NumBytes));
918+
.addReg(SP)
919+
.addImm(-int(NumBytes))
920+
.setMIFlag(MachineInstr::FrameSetup);
919921
} else {
920922
BuildMI(MBB, InsertPt, dl, HII.get(Hexagon::S2_allocframe))
921-
.addDef(SP)
922-
.addReg(SP)
923-
.addImm(NumBytes)
924-
.addMemOperand(MMO);
923+
.addDef(SP)
924+
.addReg(SP)
925+
.addImm(NumBytes)
926+
.addMemOperand(MMO)
927+
.setMIFlag(MachineInstr::FrameSetup);
925928
}
926929
}
927930

llvm/test/DebugInfo/Generic/sugared-constants.ll

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
; xfail this test on hexagon because upstream llc is not emitting the
2-
; correct DWARF info. Downstream llc is.
3-
; XFAIL: target=hexagon-{{.*}}
4-
51
; RUN: %llc_dwarf -O0 -filetype=obj %s -o - | llvm-dwarfdump -v -debug-info - | FileCheck %s
62
; Use correct signedness when emitting constants of derived (sugared) types.
73

0 commit comments

Comments
 (0)