AMDGPU/GlobalISel: Reorder G_CONSTANT legality rules
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Sat, 25 Jul 2020 15:14:27 +0000 (11:14 -0400)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Sun, 26 Jul 2020 14:05:05 +0000 (10:05 -0400)
The legal cases should be the first rules.

llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp

index c21414d..c2200f4 100644 (file)
@@ -525,9 +525,9 @@ AMDGPULegalizerInfo::AMDGPULegalizerInfo(const GCNSubtarget &ST_,
   getActionDefinitionsBuilder(G_CONSTANT)
     .legalFor({S1, S32, S64, S16, GlobalPtr,
                LocalPtr, ConstantPtr, PrivatePtr, FlatPtr })
+    .legalIf(isPointer(0))
     .clampScalar(0, S32, S64)
-    .widenScalarToNextPow2(0)
-    .legalIf(isPointer(0));
+    .widenScalarToNextPow2(0);
 
   getActionDefinitionsBuilder(G_FCONSTANT)
     .legalFor({S32, S64, S16})