[llvm] [RISCV][ISel] Add codegen support for the experimental zabha extension (PR #80192)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 31 12:31:58 PST 2024
================
@@ -19519,8 +19522,14 @@ RISCVTargetLowering::shouldExpandAtomicRMWInIR(AtomicRMWInst *AI) const {
return AtomicExpansionKind::None;
unsigned Size = AI->getType()->getPrimitiveSizeInBits();
- if (Size == 8 || Size == 16)
- return AtomicExpansionKind::MaskedIntrinsic;
+ if (Size == 8 || Size == 16) {
+ if (!Subtarget.hasStdExtZabha())
+ return AtomicExpansionKind::MaskedIntrinsic;
+ else if (AI->getOperation() == AtomicRMWInst::Nand)
+ return Subtarget.hasStdExtZacas() ? AtomicExpansionKind::CmpXChg
----------------
dtcxzyw wrote:
Related patch: https://github.com/llvm/llvm-project/pull/80119
https://github.com/llvm/llvm-project/pull/80192
More information about the llvm-commits
mailing list