Skip to content

Commit 3b9a82f

Browse files
committed
AMDGPU/GlobalISel: Remove leftover setAction
Also move G_GEP actions together. llvm-svn: 352168
1 parent 3e08b77 commit 3b9a82f

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,6 @@ AMDGPULegalizerInfo::AMDGPULegalizerInfo(const GCNSubtarget &ST,
9393

9494
setAction({G_BRCOND, S1}, Legal);
9595

96-
setAction({G_ASHR, S32}, Legal);
97-
setAction({G_ASHR, 1, S32}, Legal);
98-
9996
getActionDefinitionsBuilder({G_ADD, G_SUB, G_MUL, G_UMULH, G_SMULH})
10097
.legalFor({S32})
10198
.scalarize(0);
@@ -186,6 +183,14 @@ AMDGPULegalizerInfo::AMDGPULegalizerInfo(const GCNSubtarget &ST,
186183
setAction({G_GEP, 1, IdxTy}, Legal);
187184
}
188185

186+
// FIXME: When RegBankSelect inserts copies, it will only create new registers
187+
// with scalar types. This means we can end up with G_LOAD/G_STORE/G_GEP
188+
// instruction with scalar types for their pointer operands. In assert builds,
189+
// the instruction selector will assert if it sees a generic instruction which
190+
// isn't legal, so we need to tell it that scalar types are legal for pointer
191+
// operands
192+
setAction({G_GEP, S64}, Legal);
193+
189194
setAction({G_BLOCK_ADDR, CodePtr}, Legal);
190195

191196
getActionDefinitionsBuilder({G_ICMP, G_FCMP})
@@ -288,14 +293,6 @@ AMDGPULegalizerInfo::AMDGPULegalizerInfo(const GCNSubtarget &ST,
288293
Shifts.clampScalar(0, S32, S64);
289294
Shifts.clampScalar(1, S32, S32);
290295

291-
// FIXME: When RegBankSelect inserts copies, it will only create new
292-
// registers with scalar types. This means we can end up with
293-
// G_LOAD/G_STORE/G_GEP instruction with scalar types for their pointer
294-
// operands. In assert builds, the instruction selector will assert
295-
// if it sees a generic instruction which isn't legal, so we need to
296-
// tell it that scalar types are legal for pointer operands
297-
setAction({G_GEP, S64}, Legal);
298-
299296
for (unsigned Op : {G_EXTRACT_VECTOR_ELT, G_INSERT_VECTOR_ELT}) {
300297
unsigned VecTypeIdx = Op == G_EXTRACT_VECTOR_ELT ? 1 : 0;
301298
unsigned EltTypeIdx = Op == G_EXTRACT_VECTOR_ELT ? 0 : 1;

0 commit comments

Comments
 (0)