[PATCH] D50634: [RISCV] Add support for local PIC addressing

Roger Ferrer Ibanez via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 14 05:59:02 PDT 2018


rogfer01 added inline comments.


================
Comment at: lib/Target/RISCV/RISCVISelLowering.cpp:372
   } else {
-    report_fatal_error("Unable to lowerConstantPool");
+    return DAG.getNode(RISCVISD::WRAPPER_PIC, DL, Ty,
+                       DAG.getTargetConstantPool(CPA, Ty, Alignment, Offset,
----------------
efriedma wrote:
> rogfer01 wrote:
> > I don't have a test for this case yet. I have been unable get SelectionDAGBuiler to generate a constantpool from LLVM IR.
> > 
> > Suggestions?
> Try a floating-point constant?
Thanks a lot @efriedma

Indeed a floating point constant helped, I just had to try harder and come up with a less naive testcase.


================
Comment at: lib/Target/RISCV/RISCVISelLowering.cpp:387
 
   if (isPositionIndependent() || Subtarget.is64Bit())
     report_fatal_error("Unable to lowerExternalSymbol");
----------------
I'm not sure how `ExternalSymbol` must be dealt. Like `GlobalAddress` or they should always use the GOT?


https://reviews.llvm.org/D50634





More information about the llvm-commits mailing list