[llvm] [VPlan] Use predicated intrinsics for trapping divisors (PR #154076)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 27 07:05:13 PDT 2026


================
@@ -1961,6 +1961,10 @@ class TargetTransformInfo {
   /// maximum register pressure exceeds getNumberOfRegisters.
   LLVM_ABI bool shouldConsiderVectorizationRegPressure() const;
 
+  /// \returns True if the target supports lowering the @llvm.vp.udiv,
+  /// @llvm.vp.sdiv, @llvm.vp.urem and @llvm.vp.srem intrinsics.
+  LLVM_ABI bool supportsPredicatedDivRem() const;
----------------
fhahn wrote:

Do we need a new hook for that? Can we instead just check the cost of the intrinsic and don't use if it is larger than the safe-divisor variant/invalid?

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


More information about the llvm-commits mailing list