@@ -44,16 +44,7 @@ struct LoadConfig {
44
44
unsigned Size;
45
45
const TargetRegisterClass *RegClass;
46
46
unsigned Opcode;
47
- Register LoadReg;
48
-
49
- // Constructor for the static config array
50
- constexpr LoadConfig (unsigned S, const TargetRegisterClass *RC, unsigned Op)
51
- : Size(S), RegClass(RC), Opcode(Op), LoadReg(AMDGPU::NoRegister) {}
52
-
53
- // Constructor for the return value
54
- constexpr LoadConfig (unsigned S, const TargetRegisterClass *RC, unsigned Op,
55
- Register Reg)
56
- : Size(S), RegClass(RC), Opcode(Op), LoadReg(Reg) {}
47
+ Register LoadReg = Register();
57
48
};
58
49
59
50
class AMDGPUPreloadKernArgProlog {
@@ -162,7 +153,7 @@ void AMDGPUPreloadKernArgProlog::createBackCompatBlock(
162
153
PadMBB->addSuccessor (&*KernelEntryMBB);
163
154
}
164
155
165
- // Find the largest possible load size that fits with SGRP alignment
156
+ // / Find the largest possible load size that fits with SGPR alignment
166
157
static LoadConfig getLoadParameters (const TargetRegisterInfo &TRI,
167
158
Register KernArgPreloadSGPR,
168
159
unsigned NumKernArgPreloadSGPRs) {
@@ -175,14 +166,17 @@ static LoadConfig getLoadParameters(const TargetRegisterInfo &TRI,
175
166
if (NumKernArgPreloadSGPRs >= Config.Size ) {
176
167
Register LoadReg = TRI.getMatchingSuperReg (KernArgPreloadSGPR,
177
168
AMDGPU::sub0, Config.RegClass );
178
- if (LoadReg != AMDGPU::NoRegister)
179
- return LoadConfig (Config.Size , Config.RegClass , Config.Opcode , LoadReg);
169
+ if (LoadReg) {
170
+ LoadConfig C (Config);
171
+ C.LoadReg = LoadReg;
172
+ return C;
173
+ }
180
174
}
181
175
}
182
176
183
177
// Fallback to a single register
184
- return LoadConfig ( 1 , &AMDGPU::SReg_32RegClass, AMDGPU::S_LOAD_DWORD_IMM,
185
- KernArgPreloadSGPR) ;
178
+ return LoadConfig{ 1 , &AMDGPU::SReg_32RegClass, AMDGPU::S_LOAD_DWORD_IMM,
179
+ KernArgPreloadSGPR} ;
186
180
}
187
181
188
182
void AMDGPUPreloadKernArgProlog::addBackCompatLoads (
0 commit comments