[llvm] [MIPS]: Rework atomic max/min expand for subword (PR #89575)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 23 20:41:48 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)
----------------
yingopq wrote:
@wzssyqa Do I need to remove the ```RegState::Kill``` of ```StoreVal```? The current test has not found any problems related to this. But I once encountered a problem related to ```RegState::Kill``` when I create a new reg like ```Scratch``` in function ```MachineBasicBlock *MipsTargetLowering::emitAtomicBinaryPartword``` and use it in function ```bool MipsExpandPseudo::expandAtomicBinOpSubword``` to replace ```OldVal```, and when the code is executed to ```slt```, an error is reported.
https://github.com/llvm/llvm-project/pull/89575
More information about the llvm-commits
mailing list