diff options
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/LLVMTargetMachine.cpp | 9 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 7 |
2 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp index 1d10a6c9afd..886ae7e94ad 100644 --- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp +++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp @@ -201,6 +201,15 @@ bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM, return true; if (!TargetPassConfig::willCompleteCodeGenPipeline()) { + if (this->getTargetTriple().isOSAIX()) { + // On AIX, we might manifest MCSymbols during SDAG lowering. For MIR + // testing to be meaningful, we need to ensure that the symbols created + // are MCSymbolXCOFF variants, which requires that + // the TargetLoweringObjectFile instance has been initialized. + MCContext &Ctx = MMI->getContext(); + const_cast<TargetLoweringObjectFile &>(*this->getObjFileLowering()) + .Initialize(Ctx, *this); + } PM.add(createPrintMIRPass(Out)); } else if (addAsmPrinter(PM, Out, DwoOut, FileType, MMI->getContext())) return true; diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index d887ed73c44..72c4c0d8293 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -1877,6 +1877,13 @@ bool FastISel::selectOperator(const User *I, unsigned Opcode) { return false; case Instruction::Call: + // On AIX, call lowering uses the DAG-ISEL path currently so that the + // callee of the direct function call instruction will be mapped to the + // symbol for the function's entry point, which is distinct from the + // function descriptor symbol. The latter is the symbol whose XCOFF symbol + // name is the C-linkage name of the source level function. + if (TM.getTargetTriple().isOSAIX()) + return false; return selectCall(I); case Instruction::BitCast: |