[VP][SelectionDAG][RISCV] Add get_vector_length intrinsics and generic SelectionDAG...
authorCraig Topper <craig.topper@sifive.com>
Fri, 26 May 2023 16:01:28 +0000 (09:01 -0700)
committerCraig Topper <craig.topper@sifive.com>
Fri, 26 May 2023 16:06:38 +0000 (09:06 -0700)
commitc5e6c886aabb36ab66b4ed835da243c2a3455ade
treeb60da4c9c196b204ae89af3b34e77a2e04fa6e08
parentbfb1ba752655bf09b35c486f6cc9817dbedfb1bb
[VP][SelectionDAG][RISCV] Add get_vector_length intrinsics and generic SelectionDAG support.

The generic implementation is umin(TC, VF * vscale).

Lowering to vsetvli for RISC-V will come in a future patch.

This patch is a pre-requisite to be able to CodeGen vectorized code from
D99750.

Reviewed By: reames, frasercrmck

Differential Revision: https://reviews.llvm.org/D149916
llvm/docs/LangRef.rst
llvm/include/llvm/CodeGen/SelectionDAG.h
llvm/include/llvm/CodeGen/TargetLowering.h
llvm/include/llvm/IR/Intrinsics.td
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/lib/IR/Verifier.cpp
llvm/test/CodeGen/AArch64/get_vector_length.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rvv/get_vector_length.ll [new file with mode: 0644]
llvm/test/Verifier/get_vector_length.ll [new file with mode: 0644]