[PATCH] D101872: [AArch64][ELF] Prefer to lower MC_GlobalAddress operands to .Lfoo$local

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 6 10:54:45 PDT 2021


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

LGTM



================
Comment at: llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp:592
   assert(MO.isGlobal() && "caller should check MO.isGlobal");
-  getSymbol(MO.getGlobal())->print(OS, MAI);
+  getSymbolPreferLocal(*MO.getGlobal())->print(OS, MAI);
   printOffset(MO.getOffset(), OS);
----------------
MaskRay wrote:
> efriedma wrote:
> > MaskRay wrote:
> > > efriedma wrote:
> > > > This is target-independent code; what targets does it affect?
> > > Only aarch64. No-op for others.
> > > 
> > > With D101873, aarch64 will behave like x86: -fpic -fno-semantic-interposition will set dso_local on default visibility external linkage definitions.
> > > 
> > Do you mean this code is unreachable for non-aarch64 targets?  Or that getSymbolPreferLocal() does the same thing as getSymbol() on other targets?  Or that clang won't emit IR that's impacted by this change?
> On other targets, clang doesn't emit IR which may observe different behavior due to getSymbol -> getSymbolPreferLocal.
> 
> On aarch64, D101873 will cause clang to emit IR which may observe different behavior.
Okay.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101872



More information about the llvm-commits mailing list