[clang][RISCV] Set vscale_range attribute based on VLEN
authorPhilip Reames <preames@rivosinc.com>
Wed, 19 Oct 2022 23:05:39 +0000 (16:05 -0700)
committerPhilip Reames <listmail@philipreames.com>
Wed, 19 Oct 2022 23:14:33 +0000 (16:14 -0700)
commit9a8f3b113d05d94d9aaacdf511365dde4e35ce4f
treeba064cb967c31cd6ac96a898aa2bc56781189bc1
parent33dda45dde678f6f2efa24d7ca837cd6ad8f44d7
[clang][RISCV] Set vscale_range attribute based on VLEN

Follow up on D135894, restructure code to work in terms of minimum and maximum VLEN coming from RISCVISAInfo.cpp. In the original review, I'd mentioned that MinVLEN was sometimes zero. This turns out to be a case of human error, combined with really bad (lack of) error reporting.

This patch adds appropriate tests for various vector extension combinations to show the mechanism works, but doesn't try to provide exhaustive coverage of the extension interactions. Presumably, that is already covered in existing tests elsewhere.

Differential Revision: https://reviews.llvm.org/D136106
clang/lib/Basic/Targets/RISCV.cpp
clang/test/CodeGen/riscv-vector-bits-vscale-range.c
llvm/include/llvm/Support/RISCVISAInfo.h