[llvm] [AMDGPU] - Generate s_bitreplicate_b64_b32 (PR #69209)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 23 23:03:51 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:
Emitting readfirstlane is just wrong, you have to emulate the operation with a VALU expansion if needed
https://github.com/llvm/llvm-project/pull/69209
More information about the llvm-commits
mailing list