This patch introduces the vector-predicated version of the experimental_vector_splice intrinsic [1] at the IR level. It considers the active vector length for both vectors and and uses a vector mask to disable certain lanes in the result.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
As discussed on the call, maybe rename llvm.experimental.vp.vector.splice to llvm.experimental.vp.splice.. the "vector" is implied
Are evl1 and evl2 likely to be the same value? Do you have an example when they would be different?
For a first order reduction, using a tail-folded loop with VP, if the EVL is computed using target-specific instructions, there is no guarantee that the EVL for the previous iteration would be the same as the EVL for current iteration or even that it would be equal to the runtime VF. For a more specific example, for RISC-V, the constraints on the vset{i}vl{i} instruction allow the EVL for the last non-tail iteration to be less than the runtime VF and unequal to the EVL for the tail iteration.
Addressed @simoll's comment. Took the liberty to clang-format part of the test for memory ops.
for vp_splice, the implementation will be the same as the default case so I did not implement it explicitly. Did I miss anything?
You didn't. LGTM with nit.
llvm/docs/LangRef.rst | ||
---|---|---|
18675 | I think it's not totally obvious that %imm has to be an immediate. Eg, you could add immarg in the intrinsic declarations (Syntax section) and mention it again in the Arguments section. |
llvm/include/llvm/IR/VPIntrinsics.def | ||
---|---|---|
237 | +1 what lint said |
@simoll I believe there is a way to commit without changing the author, such that both phabricator and github show something like "authored by <author> and committed by <committer>".
That's what i normally do. There were some issues with arcanist and i had to commit manually.
I think it's not totally obvious that %imm has to be an immediate. Eg, you could add immarg in the intrinsic declarations (Syntax section) and mention it again in the Arguments section.