[PATCH] D156200: [RISCV] Don't print a tab after mnemonics that don't have operands.

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 24 22:25:56 PDT 2023


jrtc27 added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrFormats.td:165
   dag InOperandList = ins;
-  let AsmString = opcodestr # "\t" # argstr;
+  let AsmString = !if(!empty(argstr), opcodestr, opcodestr # "\t" # argstr);
   let Pattern = pattern;
----------------
jrtc27 wrote:
> Surely that's backwards? Anyway, if this works it's shorter and feels more natural to me.
Oh, right, !empty is the function, not a negated empty... not confusing at all. Then flip it for:
```
let AsmString = opcodestr # !if(!empty(argstr), "", "\t" # argstr);
```
?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156200/new/

https://reviews.llvm.org/D156200



More information about the llvm-commits mailing list