[llvm] [MIPS]: Rework atomic max/min expand for subword (PR #89575)

YunQiang Su via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 23 22:10:09 PDT 2024


================
@@ -473,48 +476,38 @@ bool MipsExpandPseudo::expandAtomicBinOpSubword(
     unsigned SELOldVal = IsMax ? SELEQZ : SELNEZ;
     unsigned MOVIncr = IsMax ? MOVN : MOVZ;
 
-    // For little endian we need to clear uninterested bits.
-    if (STI->isLittle()) {
-      if (!IsUnsigned) {
-        BuildMI(loopMBB, DL, TII->get(Mips::SRAV), OldVal)
-            .addReg(OldVal)
-            .addReg(ShiftAmnt);
-        BuildMI(loopMBB, DL, TII->get(Mips::SRAV), Incr)
-            .addReg(Incr)
----------------
wzssyqa wrote:

It seems it's safe to use `RegState::Kill` for something like `a <- op(a)`.
I guess it is even more friendly to register allocator, Since the register allocator can even use different hardware register for before/after this `RegState::Kill` note.

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


More information about the llvm-commits mailing list