[llvm] [IR][RFC] Add @llvm.mask.beforefirst intrinsic (PR #203874)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 29 04:41:41 PDT 2026
lukel97 wrote:
> Right, that is something that would be good to agree on either way. Another class of examples are various in-loop reductions, for which we do not have intrinsics, but have particular target instructions in mind when we generate IR. The current infrastructure we have (expression recipes, TTI hook) seems to give OK results. If we agree that intrinsics are the way to go, then those operations may also need revisiting for consistency.
The partial reduction VPExpressionRecipes are somewhat halfway to an intrinsic since they have dedicated SelectionDAG nodes which are matched in DAGCombiner. Maybe we could lift those nodes to full intrinsics and remove the TTI costing hooks, but I haven't looked at them that closely.
> Did you ever share this on discourse? If not, I think this would benefit from extra visibility beyond the people tagged the PR.
Put up an RFC at https://discourse.llvm.org/t/rfc-add-a-llvm-mask-beforefirst-intrinsic-and-when-should-we-create-a-new-intrinsic/91419
https://github.com/llvm/llvm-project/pull/203874
More information about the llvm-commits
mailing list