[PATCH] D150133: [RISCV] Support constant immediate for la pseudo instruction
Jessica Clarke via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 22 09:13:53 PDT 2023
jrtc27 added inline comments.
================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.td:1613
+let hasSideEffects = 0, mayLoad = 1, mayStore = 0, Size = 32,
+ isCodeGenOnly = 0, isAsmParserOnly = 1 in
----------------
Size = 32 probably warrants a comment pointing back at PseudoLI's explanation
mayLoad should be 0?
================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.td:1615
+ isCodeGenOnly = 0, isAsmParserOnly = 1 in
+def PseudoLAImm : Pseudo<(outs GPR:$rd), (ins ixlenimm_la:$imm), [],
+ "la", "$rd, $imm">;
----------------
Why can't we just reuse ixlenimm_li?
================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.td:1616
+def PseudoLAImm : Pseudo<(outs GPR:$rd), (ins ixlenimm_la:$imm), [],
+ "la", "$rd, $imm">;
+
----------------
Indentation
================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.td:1618
+
+def : InstAlias<"li $rd, $imm", (PseudoLAImm GPR:$rd, ixlenimm_li:$imm), 3>;
+
----------------
Why? We expand li during parsing, so we should never be trying to print 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