[llvm] [Analysis] Extend llvm.experimental.cttz.elts to type-based-cost (PR #184578)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 05:48:48 PST 2026


================
@@ -2600,6 +2566,11 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
                                           CmpInst::ICMP_ULT, CostKind);
       return Cost;
     }
+    case Intrinsic::experimental_cttz_elts:
+      // Cannot know ZeroIsPoison value in type-based cost-analysis.
+      // Since this Intrinsic is mostly generated by VPlan (which sets it to
+      // false) use false as sensible default.
+      return getCttzEltsCost(ICA, /*ZeroIsPoison=*/false, CostKind);
----------------
lukel97 wrote:

ZeroIsPoison=false should be more expensive so I think this makes sense as a conservative default

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


More information about the llvm-commits mailing list