[all-commits] [llvm/llvm-project] 78d70a: [NVPTX] Disable parens for identifiers starting wi...

Andrew Savonichev via All-commits all-commits at lists.llvm.org
Thu Apr 14 11:08:08 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 78d70a1c976934587e6d4c5698c348b8f09d9d96
  Author: Andrew Savonichev <andrew.savonichev at gmail.com>
  Date:   2022-04-14 (Thu, 14 Apr 2022)

  Changed paths:
    M llvm/include/llvm/MC/MCAsmInfo.h
    M llvm/lib/MC/MCExpr.cpp
    M llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.cpp
    A llvm/test/CodeGen/NVPTX/no-extra-parens.ll

  Log Message:
  [NVPTX] Disable parens for identifiers starting with '$'

ptxas fails to parse such syntax:

    mov.u64 %rd1, ($str);
    fatal   : Parsing error near '$str': syntax error

A new MCAsmInfo option was added because InParens parameter of
MCExpr::print is not sufficient to disable parens
completely. MCExpr::print resets it to false for a recursive call in
case of unary or binary expressions.

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

More information about the All-commits mailing list