[llvm-branch-commits] [llvm] Backport 45d2d7757feb386186f69af6ef57bde7b5adc2db to release/18.x (PR #79839)

Jay Foad via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Jan 29 09:35:51 PST 2024


================
@@ -6883,6 +6883,23 @@ bool AMDGPULegalizerInfo::legalizeStackSave(MachineInstr &MI,
   return true;
 }
 
+bool AMDGPULegalizerInfo::legalizeWaveID(MachineInstr &MI,
+                                         MachineIRBuilder &B) const {
+  // With architected SGPRs, waveIDinGroup is in TTMP8[29:25].
+  if (!ST.hasArchitectedSGPRs())
+    return false;
+  LLT S32 = LLT::scalar(32);
+  Register DstReg = MI.getOperand(0).getReg();
+  Register TTMP8 =
+      getFunctionLiveInPhysReg(B.getMF(), B.getTII(), AMDGPU::TTMP8,
----------------
jayfoad wrote:

True, 66c710ec9dcdbdec6cadd89b972d8945983dc92f improved this to avoid adding liveins. I wasn't going to bother backporting that since I didn't think it was required for correctness. But I have cherry-picked it into this PR now.

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


More information about the llvm-branch-commits mailing list