[llvm] 7c09c17 - AMDGPU/GlobalISel: Reorder G_CONSTANT legality rules

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 26 07:16:07 PDT 2020


Author: Matt Arsenault
Date: 2020-07-26T10:05:05-04:00
New Revision: 7c09c173a294698d06bcd1cd8c95fd331a31ccdc

URL: https://github.com/llvm/llvm-project/commit/7c09c173a294698d06bcd1cd8c95fd331a31ccdc
DIFF: https://github.com/llvm/llvm-project/commit/7c09c173a294698d06bcd1cd8c95fd331a31ccdc.diff

LOG: AMDGPU/GlobalISel: Reorder G_CONSTANT legality rules

The legal cases should be the first rules.

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
index c21414d59ba0..c2200f4b2d61 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
@@ -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})


        


More information about the llvm-commits mailing list