[llvm] [AMDGPU] - Add s_bitreplicate intrinsic (PR #69209)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 27 03:10:22 PDT 2023


================
@@ -6297,6 +6297,14 @@ SIInstrInfo::legalizeOperands(MachineInstr &MI,
     return CreatedBB;
   }
 
+  // Legalize S_BITREPLICATE
+  if (MI.getOpcode() == AMDGPU::S_BITREPLICATE_B64_B32) {
+    MachineOperand &Src = MI.getOperand(1);
+    if (Src.isReg() && RI.hasVectorRegisters(MRI.getRegClass(Src.getReg())))
+      Src.setReg(readlaneVGPRToSGPR(Src.getReg(), MI, MRI));
+    return CreatedBB;
+  }
----------------
arsenm wrote:

No, that just maybe will prevent the optimizer from introducing new divergences. You cannot guarantee any arbitrary input was uniform from the start

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


More information about the llvm-commits mailing list