diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp --- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp @@ -5248,8 +5248,9 @@ // TOC pointer at an ABI designated offset in the linkage area and the // linker will rewrite the nop to be a load of the TOC pointer from the // linkage area into gpr2. - RetOpc = callsShareTOCBase(&Caller, Callee, TM) ? PPCISD::CALL - : PPCISD::CALL_NOP; + RetOpc = callsShareTOCBase(&Caller, Callee, TM) + && Subtarget.getTargetTriple().getOS() != Triple::Lv2 ? PPCISD::CALL + : PPCISD::CALL_NOP; else RetOpc = PPCISD::CALL; if (IsStrictFPCall) {