[llvm] [ARM] Select ssat for saturating clamps with a non-zero offset (PR #203854)

David Green via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 20 23:27:13 PDT 2026


================
@@ -18099,19 +18099,50 @@ static SDValue PerformMinMaxToSatCombine(SDValue Op, SelectionDAG &DAG,
   APInt MinC = Min.getConstantOperandAPInt(1);
   APInt MaxC = Max.getConstantOperandAPInt(1);
 
-  if (Min.getOpcode() != ISD::SMIN || Max.getOpcode() != ISD::SMAX ||
-      !(MinC + 1).isPowerOf2())
+  if (Min.getOpcode() != ISD::SMIN || Max.getOpcode() != ISD::SMAX)
     return SDValue();
----------------
davemgreen wrote:

Can you move this up next to the swap now that it doesn't look at the constants.

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


More information about the llvm-commits mailing list