[RISCV] Add initial support for converting fixed vectors to scalable vectors during...
authorCraig Topper <craig.topper@sifive.com>
Mon, 8 Feb 2021 18:32:32 +0000 (10:32 -0800)
committerCraig Topper <craig.topper@sifive.com>
Mon, 8 Feb 2021 18:41:30 +0000 (10:41 -0800)
commita719b667a9794ec0dc820d0c5a3fd18340521ad9
tree96e714cde08cacc640ff7e02d40b95f857f3d2fc
parenteea34aae2e74e9b6fbdd5b95f479bc7f397bf387
[RISCV] Add initial support for converting fixed vectors to scalable vectors during lowering to use RVV instructions.

This is an alternative to D95563.

This is modeled after a similar feature for AArch64's SVE that uses
predicated scalable vector instructions.a

Rather than use predication, this patch uses an explicit VL operand.
I've limited it to always use LMUL=1 for now, but we can improve this
in the future.

This requires a bunch of new ISD opcodes to carry the VL operand.
I think we can probably lower intrinsics to these ISD opcodes to
cut down on the size of the isel table. Which is why I've added
patterns for all integer/float types and not just LMUL=1.

I'm only testing one vector width right now, but the width is
programmable via the command line.

Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D95705
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/lib/Target/RISCV/RISCVISelLowering.h
llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td [new file with mode: 0644]
llvm/lib/Target/RISCV/RISCVSubtarget.cpp
llvm/lib/Target/RISCV/RISCVSubtarget.h
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fp.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-int.ll [new file with mode: 0644]