[llvm] AMDGPU: Handle folding frame indexes into s_add_i32 (PR #101694)
Christudasan Devadasan via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 9 00:17:57 PDT 2024
================
@@ -2268,7 +2268,78 @@ bool SIRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator MI,
MI->eraseFromParent();
return true;
}
+ case AMDGPU::S_ADD_I32: {
+ // TODO: Handle s_or_b32, s_and_b32.
+ MachineOperand &OtherOp = MI->getOperand(FIOperandNum == 1 ? 2 : 1);
+ assert(FrameReg || MFI->isBottomOfStack());
+
+ MachineOperand &DstOp = MI->getOperand(0);
+ const DebugLoc &DL = MI->getDebugLoc();
+ Register MaterializedReg = FrameReg;
+
+ // Defend against live scc, which should never happen in practice.
+ bool DeadSCC = MI->getOperand(3).isDead();
+
+ // Do an in-place scale of the wave offset to the lane offset.
----------------
cdevadas wrote:
I guess this isn't in-place. You're using a TmpReg in certain cases.
https://github.com/llvm/llvm-project/pull/101694
More information about the llvm-commits
mailing list