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

Roger Ferrer Ibanez via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 3 03:55:10 PDT 2018


rogfer01 added a comment.

> If I'm understanding correctly, the problem here is that the lui has to have the address of the auipc as a parameter.

Yep, exactly that.

> Instead of using the basic block's label to compute the address of the auipc, could you assign a unique ID to each auipc, and convert that ID to a label in the AsmPrinter?  That seems more robust dealing with MI optimizations.

OK, let me see what I come up with.

Thanks @efriedma !



================
Comment at: lib/Target/RISCV/RISCVISelLowering.cpp:609
+
+  // Fold the offset to the load/stores so we can save the ADDI above.
+  SmallPtrSet<MachineInstr *, 2> FoldOffsetInstrs;
----------------
sabuasal wrote:
> We already have a peephole optimization, and a machine function pass (D47857), that do this. are you sure we need this?
Right, perhaps we don't. I will look into it. Thanks for the pointer!


https://reviews.llvm.org/D50634





More information about the llvm-commits mailing list