[llvm] [IR] Add llvm.masked.load.first.fault intrinsic (PR #156470)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 17 06:18:55 PST 2026


fhahn wrote:

> > IIUC the new intrinsic has the same semantics as `llvm.vp.load.ff`, modulo the extra EVL argument?
> > If so, it would be nice if it would be possible to unify them if possible, not sure if we could have an optional EVL argument, which defaults to the number of elements of the vector type if omitted?
> > If that's not possible, it would be good to try to keep the names consistent (`load.ff` vs `load.first.fault`) and possibly share the wording for the semantics definition somehow, possibly referencing `vp.load.ff`
> 
> Sure, I can use `.ff`, I just figured it might be a little more obvious what it was spelled out. Looks like I can also remove the alignment arg and just use metadata from the ptr arg.
> 
> It returns a mask instead of a new evl, but that mask would be a 'prefix' mask so could be synthesized from the returned evl.
> 
> As far as the overlap in functionality goes, it's pretty much the same as llvm.masked.load vs. llvm.vp.load, or store,gather,scatter,etc.
> 
> Would operand bundles be the way to make an argument optional?
> 

It would be possible to make it a variable argument intrinsic, but that isn't nice I think unfortunately, as it would require spelling out the full function type for each call IIRC. Operand bundles may be a way, but I am not sure if they are super well supported everywhere. 

Maybe for the new intrinsic as first step, it would be sufficient to share the description of the semantics, and link between them in the LangRef?

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


More information about the llvm-commits mailing list