[llubi] Implements arithmetic and reduction VP intrinsic #246938
Move the logic into the caller.
This doesn't follow the logical-and semantics in https://github.com/llvm/llvm-project/pull/241182.
vp.udiv/vp.sdiv/vp.urem/vp.srem are also included here even though they're not speculatable. They can still cause UB if division by zero or overflow occurs on any lane even when EVL > number of elts.
? handleFMFFlags(Args[0], FMF, /*IsInput=*/true)
I think this doesn't work when all lanes are disabled.
For FP min/max reductions, this can flip the sign of zero when nsz is set. According to current LangRef, nsz must not flip same-sign zeros for FP min/max, so nsz should be cleared before calling handleFMFFlags.
Ditto. I think we should pass a copy of FMF with nsz cleared to visitFPBinOpWithResult while keeping FMF.noSignedZeros() for applyFPMinMax here.
I think we should not skip Mask == BooleanKind::False when EVL is poison, since %EVLmask is all-poison in that case, so M = select %EVLmask, %mask, false is poison even on lanes where %mask is false.
I'm not sure if a poison mask lane means a poison result, since we recently updated the langref to clarify that the effective mask is M = select <W x i1> %EVLmask, <W x i1> %mask, <W x i1> splat (i1 false). I.e. it's a logical and that blocks poison propagation. So I think it's only poison if the poison mask lane is < EVL.
dtcxzyw
nofe1248
This PR implements arithmetic and reduction vector predication intrinsic.