[PATCH] D75305: [AIX] Handle LinkOnceODRLinkage and llvm.global_ctors/dtors' AppendingLinkage

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 3 14:24:37 PST 2020


hubert.reinterpretcast added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1589
+  return StringSwitch<bool>(GV->getName())
+      .Cases("llvm.global_ctors", "llvm.global_dtors", true)
+      .Default(false);
----------------
Xiangling_L wrote:
> hubert.reinterpretcast wrote:
> > This list does not match `AsmPrinter::EmitSpecialLLVMGlobal`. I do not believe this function as it is named and implemented is okay.
> Thank you for pointing this out. 
> 
> 
> > This list does not match `AsmPrinter::EmitSpecialLLVMGlobal`
> 
> This is because I am thinking to limit the scope of current `AppendingLinkage` work to LNT test, where all `AppendingLinkage`failures are related to static init related `llvm.global_ctors` global array. Do you prefer to cover all `AppendingLinkage` related global arrays in this patch instead?
> 
> 
> 
> > I do not believe this function as it is named and implemented is okay.
> 
> Yes, you are right. Probably the `isSpecialLLVMGlobal` is misleading, cuz this function doesn't cover all LLVM global symbols. Would `isSpecialStaticInitGlobalArrays` or `isSpecialAIXStaticInitGlobalArrays` be better? Or do you have any other suggestions?
> 
> As for the implementation,  general LLVM implementation of `AsmPrinter::EmitSpecialLLVMGlobal` doesn't emit what we want for `llvm.global_ctors` and `llvm.global_dtors` on AIX. Since our initial patch of static init doesn't support `-qtwolink` similar behavior, we don't need to emit anything from these two arrays. 
> 
> 
> 
> 
> 
I agree that we should limit the cases where we skip generating code for symbols to cases that we are tracking.

Suggestion for the function name: `isSpecialLLVMGlobalArrayForStaticInit`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75305





More information about the llvm-commits mailing list