[all-commits] [llvm/llvm-project] f8a5f6: [RISCV] Use sspush/sspopchk mnemonics for shadow s...

Sergey Stepanov via All-commits all-commits at lists.llvm.org
Mon Jun 1 16:13:07 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f8a5f67e81e95c8007072c3cb307cf5b3bebfd64
      https://github.com/llvm/llvm-project/commit/f8a5f67e81e95c8007072c3cb307cf5b3bebfd64
  Author: Sergey Stepanov <23sas32 at gmail.com>
  Date:   2026-06-01 (Mon, 01 Jun 2026)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
    M llvm/lib/Target/RISCV/RISCVInstrInfoZicfiss.td
    M llvm/test/CodeGen/RISCV/shadowcallstack.ll

  Log Message:
  -----------
  [RISCV] Use sspush/sspopchk mnemonics for shadow stack codegen (#200182)

After PR #178609, SSPUSH/SSPOPCHK/C_SSPUSH became encodable under the
Zimop/Zcmop predicates alone (old Zicfiss requirement was relaxed to
Zimop).
Before that, the hw-shadow-stack codegen path introduced in PR #152251
needed PseudoMOP_* wrappers that expand to the base
MOP_RR_7/MOP_R_28/C_MOP_1, because the real SSPUSH/SSPOPCHK/C_SSPUSH
were gated by Zicfiss while the codegen path only required Zimop.
As a side effect, the assembler printed `mop.rr.7 zero, zero,
ra`/`mop.r.28 zero, ra` for hw-shadow-stack functions instead of the
proper `sspush ra`/`sspopchk ra` mnemonics from the CFI RISC-V spec
(while the disassembler already printed proper sspush/sspopchk.

With predicates now aligned, the pseudos are just plain wrappers with
identical predicates to the real instructions, so they became redundant.
This patch removes them and emits SSPUSH/SSPOPCHK/C_SSPUSH directly.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list