Skip to content

Commit

Permalink
[Hexagon] Mark instructions as part of the frame setup to fix test su…
Browse files Browse the repository at this point in the history
…gared-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.
  • Loading branch information
pkarveti authored Oct 14, 2024
1 parent 84b99b4 commit 81fee74
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
23 changes: 13 additions & 10 deletions llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -906,22 +906,25 @@ void HexagonFrameLowering::insertAllocframe(MachineBasicBlock &MBB,
if (NumBytes >= ALLOCFRAME_MAX) {
// Emit allocframe(#0).
BuildMI(MBB, InsertPt, dl, HII.get(Hexagon::S2_allocframe))
.addDef(SP)
.addReg(SP)
.addImm(0)
.addMemOperand(MMO);
.addDef(SP)
.addReg(SP)
.addImm(0)
.addMemOperand(MMO)
.setMIFlag(MachineInstr::FrameSetup);

// Subtract the size from the stack pointer.
Register SP = HRI.getStackRegister();
BuildMI(MBB, InsertPt, dl, HII.get(Hexagon::A2_addi), SP)
.addReg(SP)
.addImm(-int(NumBytes));
.addReg(SP)
.addImm(-int(NumBytes))
.setMIFlag(MachineInstr::FrameSetup);
} else {
BuildMI(MBB, InsertPt, dl, HII.get(Hexagon::S2_allocframe))
.addDef(SP)
.addReg(SP)
.addImm(NumBytes)
.addMemOperand(MMO);
.addDef(SP)
.addReg(SP)
.addImm(NumBytes)
.addMemOperand(MMO)
.setMIFlag(MachineInstr::FrameSetup);
}
}

Expand Down
4 changes: 0 additions & 4 deletions llvm/test/DebugInfo/Generic/sugared-constants.ll
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
; xfail this test on hexagon because upstream llc is not emitting the
; correct DWARF info. Downstream llc is.
; XFAIL: target=hexagon-{{.*}}

; RUN: %llc_dwarf -O0 -filetype=obj %s -o - | llvm-dwarfdump -v -debug-info - | FileCheck %s
; Use correct signedness when emitting constants of derived (sugared) types.

Expand Down

0 comments on commit 81fee74

Please sign in to comment.