[RISCV][NFC] Unify compatibility checks under one function
authorFraser Cormack <fraser@codeplay.com>
Thu, 26 May 2022 14:11:02 +0000 (15:11 +0100)
committerFraser Cormack <fraser@codeplay.com>
Fri, 27 May 2022 10:21:54 +0000 (11:21 +0100)
commit3e450d9cbbc00b78eebe122cdbec70bd315167e3
treec0d58816d218bea8ae16d6b73f1cdf1edd9781a2
parentf168a65943f934bcb161e01a600b9bb4e4340c24
[RISCV][NFC] Unify compatibility checks under one function

Split off from D125021.

We were duplicating logic across different phases. Since we want to
ensure a consistency of logic across phases for correctness, this patch
combines our multiple compatibility checks into one function to better
convey this.

Several methods were made const too.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D126472
llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp