[llvm] [RISCV] Inserting indirect jumps with X7 for Zicfilp (PR #170683)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 4 09:09:48 PST 2025


================
@@ -1372,8 +1372,11 @@ void RISCVInstrInfo::insertIndirectBranch(MachineBasicBlock &MBB,
                           .addMBB(&DestBB, RISCVII::MO_CALL);
 
   RS->enterBasicBlockEnd(MBB);
+  const TargetRegisterClass *RC = &RISCV::GPRRegClass;
+  if (STI.hasStdExtZicfilp())
----------------
topperc wrote:

Doesn't this need to be based on the `cf-protection-branch` attribute? I thought the clang allows `cf-protection-branch` without Zicfilp?

https://github.com/llvm/llvm-project/pull/170683


More information about the llvm-commits mailing list