[RISCV] Initial support of LoopVectorizer for RISC-V Vector.
authorHsiangkai Wang <kai.wang@sifive.com>
Wed, 27 Jan 2021 07:00:46 +0000 (15:00 +0800)
committerHsiangkai Wang <kai.wang@sifive.com>
Mon, 8 Feb 2021 22:32:18 +0000 (06:32 +0800)
commita5b07a221a5772c0d3733a0bc8ff0b57dd5705de
tree2528697f8167eaebd1fb13d8ab30cf76038f14b9
parent87e280110d91edda0353eddb621cb96f72c7ece3
[RISCV] Initial support of LoopVectorizer for RISC-V Vector.

Define an option -riscv-vector-bits-max to specify the maximum vector
bits for vectorizer. Loop vectorizer will use the value to check if it
is safe to use the whole vector registers to vectorize the loop.

It is not the optimum solution for loop vectorizing for scalable vector.
It assumed the whole vector registers will be used to vectorize the code.
If it is possible, we should configure vl to do vectorize instead of
using whole vector registers.

We only consider LMUL = 1 in this patch.

This patch just an initial work for loop vectorizer for RISC-V Vector.

Differential Revision: https://reviews.llvm.org/D95659
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/lib/Target/RISCV/RISCVISelLowering.h
llvm/lib/Target/RISCV/RISCVSubtarget.cpp
llvm/lib/Target/RISCV/RISCVSubtarget.h
llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
llvm/test/Transforms/LoopVectorize/RISCV/lit.local.cfg [new file with mode: 0644]
llvm/test/Transforms/LoopVectorize/RISCV/scalable-vf-hint.ll [new file with mode: 0644]