[all-commits] [llvm/llvm-project] 88e589: [RISCV] When parsing vsetvli in the assembler, use...

Craig Topper via All-commits all-commits at lists.llvm.org
Tue Dec 8 11:27:21 PST 2020


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

  Changed paths:
    M llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
    M llvm/test/MC/RISCV/rvv/invalid.s

  Log Message:
  -----------
  [RISCV] When parsing vsetvli in the assembler, use StringRef::getAsInteger instead of APInt's string constructor

APInt's string constructor asserts on error. Since this is the parser and we don't yet know if the string is a valid integer we shouldn't use that.

Instead use StringRef::getAsInteger which returns a bool to indicate success or failure.

Since we no longer need APInt, use 'unsigned' instead.

Differential Revision: https://reviews.llvm.org/D92801


  Commit: fb5b611af917f02337b69727fb8082e1ea3b22d5
      https://github.com/llvm/llvm-project/commit/fb5b611af917f02337b69727fb8082e1ea3b22d5
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2020-12-08 (Tue, 08 Dec 2020)

  Changed paths:
    M llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
    M llvm/test/MC/RISCV/rvv/invalid.s

  Log Message:
  -----------
  [RISCV] Detect more errors when parsing vsetvli in the assembler

-Reject an "mf1" lmul
-Make sure tail agnostic is exactly "tu" or "ta" not just that it starts with "tu" or "ta"
-Make sure mask agnostic is exactly "mu" or "ma" not just that it starts with "mu" or "ma"

Differential Revision: https://reviews.llvm.org/D92805


Compare: https://github.com/llvm/llvm-project/compare/fc750f609dfb...fb5b611af917


More information about the All-commits mailing list