[PATCH] D44885: [RISCV] Expand function call to "call" pseudoinstruction

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 23 09:13:48 PDT 2018


asb accepted this revision.
asb added a comment.
This revision is now accepted and ready to land.

Thanks Shiva. I think just two outstanding issues. Some of the test files in test/CodeGen/RISCV that weren't generated with update_llc_test_checks.py have unwanted changes in this patch. With that fixed, this is looking good to me.



================
Comment at: lib/Target/RISCV/RISCVInstrInfo.td:636-637
 // PseudoCALL is a pseudo instruction which will eventually expand to auipc
-// and jalr. Define AsmString because we want assembler could print "call"
-// when compile with -S. Define isCodeGenOnly = 0 because we want parser
-// could parsing assembly "call" instruction.
-let isCall = 1, Defs = [X1], isCodeGenOnly = 0,
-    hasSideEffects = 0, mayLoad = 0, mayStore = 0 in
+// and jalr while encoding. auipc and jalr could relax to jal when linker
+// relaxation enabled and the offset fit in signed 21-bit immediate.
+// Define AsmString to print "call" when compile with -S flag.
----------------
I'd change the second sentence to "This is desirable, as an auipc+jalr pair with R_RISCV_CALL and R_RISCV_RELAX relocations can be be relaxed by the linker if the offset fits in a signed 21-bit immediate."


Repository:
  rL LLVM

https://reviews.llvm.org/D44885





More information about the llvm-commits mailing list