Skip to content

Commit 3a76960

Browse files
rofirrimwangpc-pp
andcommitted
Apply suggestions from code review
Co-authored-by: Pengcheng Wang <[email protected]>
1 parent 82367f4 commit 3a76960

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
@@ -7486,7 +7486,7 @@ SDValue RISCVTargetLowering::lowerINIT_TRAMPOLINE(SDValue Op,
74867486
// Loads the function address into t0. Note that we are using offsets
74877487
// pc-relative to the first instruction of the trampoline.
74887488
MCInst LD_X5_TargetFunctionOffset_Inst =
7489-
MCInstBuilder(RISCV::LD).addReg(RISCV::X5).addReg(RISCV::X7).addImm(24);
7489+
MCInstBuilder(RISCV::LD).addReg(RISCV::X5).addReg(RISCV::X7).addImm(FunctionAddressOffset);
74907490
uint32_t LD_X5_TargetFunctionOffset =
74917491
GetEncoding(LD_X5_TargetFunctionOffset_Inst);
74927492
Addr = DAG.getNode(ISD::ADD, dl, MVT::i64, Trmp,
@@ -7498,7 +7498,7 @@ SDValue RISCVTargetLowering::lowerINIT_TRAMPOLINE(SDValue Op,
74987498
// ld t2, 16(t2)
74997499
// Load the value of the static chain.
75007500
MCInst LD_X7_StaticChainOffset_Inst =
7501-
MCInstBuilder(RISCV::LD).addReg(RISCV::X7).addReg(RISCV::X7).addImm(16);
7501+
MCInstBuilder(RISCV::LD).addReg(RISCV::X7).addReg(RISCV::X7).addImm(StaticChainOffset);
75027502
uint32_t LD_X7_StaticChainOffset = GetEncoding(LD_X7_StaticChainOffset_Inst);
75037503
Addr = DAG.getNode(ISD::ADD, dl, MVT::i64, Trmp,
75047504
DAG.getConstant(8, dl, MVT::i64));

0 commit comments

Comments
 (0)