[llvm] [RISCV] Adapt the element type of EVec into ContainerVT in lowerBUILD_VECTOR (PR #159373)
Min-Yih Hsu via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 18 13:18:24 PDT 2025
mshockwave wrote:
> > How does this compare to just not do the slideup optimization (i.e. fallback to the original slidedown lowering) upon mismatching element types?
>
> I am not an expert in the cost of RVV instructions. Looks like it's better to enable the slideup optimization. For your information, you can view the diff of the new commit.
With an additional element type cast instruction, it's almost certain that the optimization added in #154847 , which folded extract_element + vslide1up into vslideup of 1 and thus eliminated most of the `vmv.x.s` / `vfmv.f.s`, will not kick in, therefore it's likely that you'll end up roughly the same number of instructions as the vslide1down lowering. If that's the case, we definitely prefer vslide1down because it doesn't have the register overlapping restriction vslide1up has (in vslide1up/vslideup, destination register cannot overlap the source)
https://github.com/llvm/llvm-project/pull/159373
More information about the llvm-commits
mailing list