If a vrgather is using vid as its index, and they both have the same
mask and VL, then it can be replaced with a vmerge of the source and
passthru vectors.
Details
- Reviewers
craig.topper reames fakepaper56
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| llvm/test/CodeGen/RISCV/rvv/combine-gather.ll | ||
|---|---|---|
| 11 | The vmerge gets folded away at the pseudo instruction stage: https://reviews.llvm.org/D133255#inline-1283170 Perhaps the easiest thing to do here is just check for an all ones mask in this combine | |
| llvm/test/CodeGen/RISCV/rvv/combine-gather.ll | ||
|---|---|---|
| 18 | Yes, I think so. I was working on a patch for this, I’ll put it up later today. | |
Rather than optimise this case, I've uploaded D146711 to try and avoid the gathers in the first place
I'm not sure you want VP_MERGE_VL here. VP_MERGE_VL is supposed to be tail undisturbed. I think you want RISCVISD::VSELECT_VL.