[llvm] [RISCV] Loosen the requirement of shadow stack codegen to Zimop (PR #152251)

Ming-Yi Lai via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 25 00:16:12 PDT 2025


https://github.com/mylai-mtk commented:

Given that Zcmop insns are not the compressed form of Zimop insns, it's a pity that with the current infrastructure we could not compress `PseudoMOP_SSPUSH` with TableGen rules. The formal solution of this would be to create infrastructures of compressing pseudo insns, but I believe that would be a change too big compared with the simple purpose of this patch.

However, I would still like to provide a workaround that is more probable in the near future: Model hardware shadow stack support as a target feature and predicate TableGen `CompressPat<MOP, CMOP>` based on that target feature. I'm currently modeling Zicfilp CFI as target features, so I now have some ideas about the pros and cons of modeling module flags as target features, which I plan to list out in my PR and link it to here. Nevertheless, I'm OK with the current approach of this PR regarding SSPUSH compression.

By the way, I like the idea of completely replacing Zicfiss SSPUSH with Zimop PseudoMOP_SSPUSH. This consolidates the divergent cases. 

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


More information about the llvm-commits mailing list