[llvm] [AMDGPU] Extend SRA i64 simplification for shift amts in range [33:62] (PR #138913)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed May 21 14:29:12 PDT 2025


================
@@ -4153,22 +4153,23 @@ SDValue AMDGPUTargetLowering::performSraCombine(SDNode *N,
   SDLoc SL(N);
   unsigned RHSVal = RHS->getZExtValue();
 
-  // (sra i64:x, 32) -> build_pair x, (sra hi_32(x), 31)
-  if (RHSVal == 32) {
+  // For C >= 32
+  // (sra i64:x, C) -> build_pair (sra hi_32(x), C - 32), (sra hi_32(x), 31)
----------------
arsenm wrote:

This fails alive: https://alive2.llvm.org/ce/z/ohLB4J

We need a freeze somewhere, maybe this https://alive2.llvm.org/ce/z/kcwGVF (but need to scale it down to a smaller size to get this to complete) 

https://github.com/llvm/llvm-project/pull/138913


More information about the llvm-commits mailing list