Skip to content

Commit 8e9227a

Browse files
authored
[RISCV] Use X9 instead of X27 in RISCVInstrInfo::insertIndirectBranch for RVE (#139214)
Fixes #139168.
1 parent 56c3ef1 commit 8e9227a

File tree

2 files changed

+553
-2
lines changed

2 files changed

+553
-2
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,8 +1264,8 @@ void RISCVInstrInfo::insertIndirectBranch(MachineBasicBlock &MBB,
12641264
else {
12651265
// The case when there is no scavenged register needs special handling.
12661266

1267-
// Pick s11 because it doesn't make a difference.
1268-
TmpGPR = RISCV::X27;
1267+
// Pick s11(or s1 for rve) because it doesn't make a difference.
1268+
TmpGPR = STI.hasStdExtE() ? RISCV::X9 : RISCV::X27;
12691269

12701270
int FrameIndex = RVFI->getBranchRelaxationScratchFrameIndex();
12711271
if (FrameIndex == -1)

0 commit comments

Comments
 (0)