[PATCH] D62532: [AIX] Implement function descriptor on SDAG

Xiangling Liao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 4 14:33:13 PDT 2019


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


================
Comment at: llvm/lib/CodeGen/LLVMTargetMachine.cpp:204
   if (!TargetPassConfig::willCompleteCodeGenPipeline()) {
+    if (TargetPassConfig::willInitMCObjectFile()) {
+      MCContext &Ctx = MMI->getContext();
----------------
sfertile wrote:
> We either need to:
> 1) initialize the MCObjectFileInfo to be able to use mir tests with call instructions on AIX
> 2) Be able to add the requisite info the the MCSymbol base class, and not need to cast callee operands to an MCSymbolXCOFF during lowering.
> 
> //If its safe// to initialize MCObjectFileInfo even when we don't have an AsmPrinter, then maybe we should just always do so for MIR output on AIX. 
Some concerns as I discussed with Sean:
> The base class implementation is not a pure virtual:
> 
> 
> ```
> virtual TargetLoweringObjectFile *getObjFileLowering() const {
>     return nullptr;
>   }
> ```
> 
>  not sure if something like that is expected to have a non-null TLOF.

Put some of my thoughts about doing target lowering object file code here:

> 
> ```
> [line 206]const_cast<TargetLoweringObjectFile&(*this->getObjFileLowering())
>           .Initialize(Ctx, *this);
> ```
>  is extracted from generic AsmPrinter::doInitialization (lib/CodeGen/AsmPrinter/AsmPrinter.cpp:258), which means any backend that can init an AsmPrinter will have a non-null TLOF for sure, given that it seems all xxxAsmPrinter::doInitialization will finally call AsmPrinter::doInitialization. And back to our case here, it looks like the backends which will go through this path are only those who can add an AsmPrinter pass to, so I think it won't have a non-null TLOF.












Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62532





More information about the llvm-commits mailing list