Skip to content

Commit 14e4c4e

Browse files
rofirrimwangpc-pp
andcommitted
Apply suggestions from code review
Co-authored-by: Pengcheng Wang <[email protected]>
1 parent 34d0efb commit 14e4c4e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7350,7 +7350,7 @@ SDValue RISCVTargetLowering::lowerINIT_TRAMPOLINE(SDValue Op,
73507350
// Loads the function address into t0. Note that we are using offsets
73517351
// pc-relative to the first instruction of the trampoline.
73527352
MCInst LD_X5_TargetFunctionOffset_Inst =
7353-
MCInstBuilder(RISCV::LD).addReg(RISCV::X5).addReg(RISCV::X7).addImm(24);
7353+
MCInstBuilder(RISCV::LD).addReg(RISCV::X5).addReg(RISCV::X7).addImm(FunctionAddressOffset);
73547354
uint32_t LD_X5_TargetFunctionOffset =
73557355
GetEncoding(LD_X5_TargetFunctionOffset_Inst);
73567356
Addr = DAG.getNode(ISD::ADD, dl, MVT::i64, Trmp,
@@ -7362,7 +7362,7 @@ SDValue RISCVTargetLowering::lowerINIT_TRAMPOLINE(SDValue Op,
73627362
// ld t2, 16(t2)
73637363
// Load the value of the static chain.
73647364
MCInst LD_X7_StaticChainOffset_Inst =
7365-
MCInstBuilder(RISCV::LD).addReg(RISCV::X7).addReg(RISCV::X7).addImm(16);
7365+
MCInstBuilder(RISCV::LD).addReg(RISCV::X7).addReg(RISCV::X7).addImm(StaticChainOffset);
73667366
uint32_t LD_X7_StaticChainOffset = GetEncoding(LD_X7_StaticChainOffset_Inst);
73677367
Addr = DAG.getNode(ISD::ADD, dl, MVT::i64, Trmp,
73687368
DAG.getConstant(8, dl, MVT::i64));

0 commit comments

Comments
 (0)