[PATCH] D150133: [RISCV] Support constant immediate for la pseudo instruction

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 1 16:25:59 PDT 2023


jrtc27 added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.td:1619
+    isCodeGenOnly = 0, isAsmParserOnly = 1 in
+def PseudoLAImm : Pseudo<(outs GPR:$rd), (ins ixlenimm_la:$imm), [],
+                         "la", "$rd, $imm">;
----------------
I don't understand why you need a new pseudo rather than teaching the existing one to also accept an integer


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.td:1622
+
+def : InstAlias<"li $rd, $imm",  (PseudoLAImm GPR:$rd, ixlenimm_li:$imm)>;
+
----------------
You marked my "Why? We expand li during parsing, so we should never be trying to print it." comment as done yet this is still here. I do not see why we would ever want it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150133



More information about the llvm-commits mailing list