Skip to content

Commit fe42ebe

Browse files
committed
[AMDGPU][GlobalISel] Fix legalizing image intrinsics for new types
We no longer need to increase vector size to 16 for intrinsics that use more than 8 vgprs for addr. There is no image intrinsic that needs more than 12 so all currently existing cases will be covered. Using incorrect size was causing an error in instruction selection because instructions were updated to require new types (9x32, 10x32, 11x32, 12x32). Differential Revision: https://reviews.llvm.org/D139546
1 parent 7a76140 commit fe42ebe

File tree

2 files changed

+324
-8
lines changed

2 files changed

+324
-8
lines changed

llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4847,14 +4847,6 @@ static void convertImageAddrToPacked(MachineIRBuilder &B, MachineInstr &MI,
48474847

48484848
int NumAddrRegs = AddrRegs.size();
48494849
if (NumAddrRegs != 1) {
4850-
// Above 8 elements round up to next power of 2 (i.e. 16).
4851-
if (NumAddrRegs > 8 && !isPowerOf2_32(NumAddrRegs)) {
4852-
const int RoundedNumRegs = NextPowerOf2(NumAddrRegs);
4853-
auto Undef = B.buildUndef(S32);
4854-
AddrRegs.append(RoundedNumRegs - NumAddrRegs, Undef.getReg(0));
4855-
NumAddrRegs = RoundedNumRegs;
4856-
}
4857-
48584850
auto VAddr =
48594851
B.buildBuildVector(LLT::fixed_vector(NumAddrRegs, 32), AddrRegs);
48604852
MI.getOperand(DimIdx).setReg(VAddr.getReg(0));

0 commit comments

Comments
 (0)