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.
Targets that require parens around identifiers that start with '$'
should always pass MCAsmInfo to MCExpr::print.
Therefore 'operator<<(raw_ostream &, MCExpr&)' should be avoided
because it calls MCExpr::print with nullptr MAI.
This is awkward.
Perhaps we should consider adding some sort of withMAI(F.getValue(), MAI) -> std::pair<MCExpr*, MCAsmInfo*> wrapper and an overloaded operator<< to catch it and pass MAI along to MCExpr::print().