[RISCV] Improve VMConstraint checking on more unary and nullary instructions.
authorCraig Topper <craig.topper@sifive.com>
Sun, 27 Dec 2020 02:47:58 +0000 (18:47 -0800)
committerCraig Topper <craig.topper@sifive.com>
Sun, 27 Dec 2020 02:47:59 +0000 (18:47 -0800)
commit76202f09b522b2c106b358570c97eee7797e1ba5
treea73dfd9cf3f96d0b37b4039989a4ba5f87cc8e6e
parent9eb3e564d3b1c772a64eef6ecaa3b1705d065218
[RISCV] Improve VMConstraint checking on more unary and nullary instructions.

We weren't consistently marking unary instructions as OneInput
and vid.v is really ZeroInput but we had no way to mark that.

This patch improves this by removing the error prone OneInput constraint.
Instead we just always look for the mask in the last operand.

It appears that the "CheckReg" variable used for the check on the broken
instruction was unitialized or garbage because it was also used for
VS1/VS2 constraints. I've scoped the variable locally to each check now.

I've gone through and set NoConstraint on instructions that don't have
a real VMConstraint and don't have a mask as the last operand.

I've also removed the unused enum values in RISCVBaseInfo.h. We
never use them in C++ and we have separate versions in a td file.

Reviewed By: HsiangKai

Differential Revision: https://reviews.llvm.org/D93784
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
llvm/lib/Target/RISCV/RISCVInstrFormats.td
llvm/lib/Target/RISCV/RISCVInstrInfoV.td
llvm/lib/Target/RISCV/Utils/RISCVBaseInfo.h
llvm/test/MC/RISCV/rvv/invalid.s