[llvm] 66c710e - [AMDGPU] Do not bother adding reserved registers to liveins (#79436)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 25 07:17:10 PST 2024
Author: Jay Foad
Date: 2024-01-25T15:17:06Z
New Revision: 66c710ec9dcdbdec6cadd89b972d8945983dc92f
URL: https://github.com/llvm/llvm-project/commit/66c710ec9dcdbdec6cadd89b972d8945983dc92f
DIFF: https://github.com/llvm/llvm-project/commit/66c710ec9dcdbdec6cadd89b972d8945983dc92f.diff
LOG: [AMDGPU] Do not bother adding reserved registers to liveins (#79436)
Tweak the implementation of llvm.amdgcn.wave.id to not add TTMP8 to the
function liveins.
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
index e98ede88a7e2db..17ffb7ec988f0a 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
@@ -6890,9 +6890,7 @@ bool AMDGPULegalizerInfo::legalizeWaveID(MachineInstr &MI,
return false;
LLT S32 = LLT::scalar(32);
Register DstReg = MI.getOperand(0).getReg();
- Register TTMP8 =
- getFunctionLiveInPhysReg(B.getMF(), B.getTII(), AMDGPU::TTMP8,
- AMDGPU::SReg_32RegClass, B.getDebugLoc(), S32);
+ auto TTMP8 = B.buildCopy(S32, Register(AMDGPU::TTMP8));
auto LSB = B.buildConstant(S32, 25);
auto Width = B.buildConstant(S32, 5);
B.buildUbfx(DstReg, TTMP8, LSB, Width);
diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
index 4cf9cafedf28fe..ae0f0605a4a338 100644
--- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
@@ -7927,8 +7927,7 @@ SDValue SITargetLowering::lowerWaveID(SelectionDAG &DAG, SDValue Op) const {
return {};
SDLoc SL(Op);
MVT VT = MVT::i32;
- SDValue TTMP8 = CreateLiveInRegister(DAG, &AMDGPU::SReg_32RegClass,
- AMDGPU::TTMP8, VT, SL);
+ SDValue TTMP8 = DAG.getCopyFromReg(DAG.getEntryNode(), SL, AMDGPU::TTMP8, VT);
return DAG.getNode(AMDGPUISD::BFE_U32, SL, VT, TTMP8,
DAG.getConstant(25, SL, VT), DAG.getConstant(5, SL, VT));
}
More information about the llvm-commits
mailing list