[llvm] [RISCV] 'Zalrsc' may permit non-base instructions (PR #165042)

via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 24 15:57:58 PDT 2025


================
@@ -682,6 +702,9 @@ bool RISCVExpandAtomicPseudo::expandAtomicMinMaxOp(
     MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
     AtomicRMWInst::BinOp BinOp, bool IsMasked, int Width,
     MachineBasicBlock::iterator &NextMBBI) {
+  // Using MIN(U)/MAX(U) is preferrable if permitted
+  if (STI->hasPermissiveZalrsc() && STI->hasStdExtZbb() && !IsMasked)
----------------
slachowsky wrote:

I don't think that is required, since all of the patterns which lower to the pseudos are already predicated by `HasStdExtZalrsc` in `RISCVInstructionInfoA.td`.

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


More information about the llvm-commits mailing list