================
@@ -5743,6 +5747,14 @@
LoongArchTargetLowering::shouldExpandAtomicRMWInIR(AtomicRMWInst *AI) const {
}
unsigned Size = AI->getType()->getPrimitiveSizeInBits();
+ if (Subtarget.hasLAMCAS()) {
+ if (AI->getOperation() == AtomicRMWInst::Nand ||
+ (Size < 32 /*&& (AI->getOperation() != AtomicRMWInst::Or &&
----------------
tangaac wrote:
atomicrmw nand & i8 / i16 atomicrmw add / sub / [u]min / [u]max should be
converted to amcas.
i8 / i16 atomicrmw and / or / xor shouldn't be converted to amcas because they
can use am(and / or / xor).w to expand.
But after feature LAMCAS enabled, all i8,i16 atomicrmw operations will be
converted to amcas,
how to fix it?
https://github.com/llvm/llvm-project/pull/114189
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits