[all-commits] [llvm/llvm-project] a98f37: [RISCV] Fix rlist grammar for cm.push, cm.popret, ...

Kiva via All-commits all-commits at lists.llvm.org
Mon Aug 14 10:06:56 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a98f374eea3135f82da439dbf730012a55c02918
      https://github.com/llvm/llvm-project/commit/a98f374eea3135f82da439dbf730012a55c02918
  Author: imkiva <imkiva at islovely.icu>
  Date:   2023-08-15 (Tue, 15 Aug 2023)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVInstrInfoZc.td

  Log Message:
  -----------
  [RISCV] Fix rlist grammar for cm.push, cm.popret, cm.popretz and cm.pop in RISCV zcmp Extension

The register list in the arg string is declared as `{$rlist}`. This patch removes the wrapping curly brackets because of the following:

- Curly brackets are the syntax for variant selection, e.g. given `X = {v0 | v1}`, the result after `CodeGenInstruction::FlattenAsmStringVariants` should be `X[AsmVariantNo]`.
- ARM also supports the register list, and they do not use the bracket wrapper.
- Parse of curly brackets are handled by `RISCVAsmParser::parseReglist`, the brackets in the td file do not correspond to asm syntax. Thus no testcase is affected.

So the curly brackets here are redundant and will become dangerous if RISCV needs more asm parser variants (took me several hours to figure out some wired assertion failures in a downstream fork)

Reviewed By: craig.topper

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




More information about the All-commits mailing list