[clang] [llvm] [RISCV] Add stack clash protection (PR #117612)

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 25 14:58:27 PST 2024


================
@@ -1939,3 +2049,72 @@ bool RISCVFrameLowering::isSupportedStackID(TargetStackID::Value ID) const {
 TargetStackID::Value RISCVFrameLowering::getStackIDForScalableVectors() const {
   return TargetStackID::ScalableVector;
 }
+
+// Synthesize the probe loop.
+static void emitStackProbeInline(MachineFunction &MF, MachineBasicBlock &MBB,
+                                 MachineBasicBlock::iterator MBBI,
+                                 DebugLoc DL) {
+
+  auto &Subtarget = MF.getSubtarget<RISCVSubtarget>();
+  const RISCVInstrInfo *TII = Subtarget.getInstrInfo();
+  bool IsRV64 = Subtarget.hasFeature(RISCV::Feature64Bit);
----------------
topperc wrote:

Subtarget.is64Bit()?

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


More information about the cfe-commits mailing list