[all-commits] [llvm/llvm-project] 76202f: [RISCV] Improve VMConstraint checking on more unar...

Craig Topper via All-commits all-commits at lists.llvm.org
Sat Dec 26 19:41:34 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 76202f09b522b2c106b358570c97eee7797e1ba5
      https://github.com/llvm/llvm-project/commit/76202f09b522b2c106b358570c97eee7797e1ba5
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2020-12-26 (Sat, 26 Dec 2020)

  Changed paths:
    M llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
    M llvm/lib/Target/RISCV/RISCVInstrFormats.td
    M llvm/lib/Target/RISCV/RISCVInstrInfoV.td
    M llvm/lib/Target/RISCV/Utils/RISCVBaseInfo.h
    M llvm/test/MC/RISCV/rvv/invalid.s

  Log Message:
  -----------
  [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




More information about the All-commits mailing list