Skip to content

Commit 8308d47

Browse files
committed
[RISCV][MC] Set Ra for PseudoCALL in if-else clause
1 parent b0e68a9 commit 8308d47

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,12 @@ void RISCVMCCodeEmitter::expandFunctionCall(const MCInst &MI,
125125
MCRegister Ra;
126126
if (MI.getOpcode() == RISCV::PseudoTAIL) {
127127
Func = MI.getOperand(0);
128-
Ra = RISCV::X6;
129128
// For Zicfilp, PseudoTAIL should be expanded to a software guarded branch.
130129
// It means to use t2(x7) as rs1 of JALR to expand PseudoTAIL.
131130
if (STI.hasFeature(RISCV::FeatureStdExtZicfilp))
132131
Ra = RISCV::X7;
132+
else
133+
Ra = RISCV::X6;
133134
} else if (MI.getOpcode() == RISCV::PseudoCALLReg) {
134135
Func = MI.getOperand(1);
135136
Ra = MI.getOperand(0).getReg();

0 commit comments

Comments
 (0)