[PATCH] D107280: [RISCV] Lower extern_weak symbols using the GOT for the medany model

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 2 09:38:05 PDT 2021


jrtc27 marked an inline comment as done.
jrtc27 added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:2736
+      // Extern weak symbols must be addressed indirectly as 0 may not be
+      // within 2GiB of PC. This generates the pattern (PseudoLA sym), which
+      // expands to (ld (addi (auipc %got_pcrel_hi(sym)) %pcrel_lo(auipc))).
----------------
MaskRay wrote:
> PseudoLGA
Already spotted and fixed :)


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:2759
+  bool IsExternWeak = GV->hasExternalWeakLinkage();
+  SDValue Addr = getAddr(N, DAG, IsLocal, IsExternWeak);
 
----------------
MaskRay wrote:
> IsExternWeak can be omitted
What do you mean? If it's omitted then it defaults to false and we get the old codegen


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107280



More information about the llvm-commits mailing list