[llvm] [AArch64][SelectionDAG] Generate subs+csel for usub.sat (PR #193203)

Shreeyash Pandey via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 21 06:13:31 PDT 2026


================
@@ -3596,6 +3595,10 @@ class LLVM_ABI TargetLoweringBase {
     return false;
   }
 
+  /// Should usub.sat(X, 1) prefer the generic lowering X - zext(X != 0) over
+  /// the default overflow/select expansion?
+  virtual bool preferSubOfZextForUsubSatOne(EVT VT) const { return true; }
----------------
bojle wrote:

do you mean this function as a whole? what would the alternative be? revert the patch and implement the fold for each target where its applicable? 

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


More information about the llvm-commits mailing list