[clang] [llvm] [RISCV] Add partial support for -fzero-call-used-regs (PR #194883)

Sam Elliott via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 4 16:12:17 PDT 2026


================
@@ -3936,6 +3936,23 @@ MachineBasicBlock::iterator RISCVInstrInfo::insertOutlinedCall(
   return It;
 }
 
+void RISCVInstrInfo::buildClearRegister(Register Reg, MachineBasicBlock &MBB,
+                                        MachineBasicBlock::iterator Iter,
+                                        DebugLoc &DL,
+                                        bool AllowSideEffects) const {
+
+  const MachineFunction &MF = *MBB.getParent();
+  const RISCVSubtarget &STI = MF.getSubtarget<RISCVSubtarget>();
----------------
lenary wrote:

This should already be available as the `STI` member.

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


More information about the cfe-commits mailing list