diff --git a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp --- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp +++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp @@ -397,6 +397,7 @@ void addPreRegAlloc() override; void addPreSched2() override; void addPreEmitPass() override; + void addPreEmitPass2() override; // GlobalISEL bool addIRTranslator() override; bool addLegalizeMachineIR() override; @@ -535,6 +536,9 @@ if (getOptLevel() != CodeGenOpt::None) addPass(createPPCEarlyReturnPass()); +} + +void PPCPassConfig::addPreEmitPass2() { // Must run branch selection immediately preceding the asm printer. addPass(createPPCBranchSelectionPass()); } diff --git a/llvm/test/CodeGen/PowerPC/O3-pipeline.ll b/llvm/test/CodeGen/PowerPC/O3-pipeline.ll --- a/llvm/test/CodeGen/PowerPC/O3-pipeline.ll +++ b/llvm/test/CodeGen/PowerPC/O3-pipeline.ll @@ -193,10 +193,10 @@ ; CHECK-NEXT: PowerPC Pre-Emit Peephole ; CHECK-NEXT: PowerPC Expand ISEL Generation ; CHECK-NEXT: PowerPC Early-Return Creation -; CHECK-NEXT: PowerPC Branch Selector ; CHECK-NEXT: Contiguously Lay Out Funclets ; CHECK-NEXT: StackMap Liveness Analysis ; CHECK-NEXT: Live DEBUG_VALUE analysis +; CHECK-NEXT: PowerPC Branch Selector ; CHECK-NEXT: Lazy Machine Block Frequency Analysis ; CHECK-NEXT: Machine Optimization Remark Emitter ; CHECK-NEXT: Linux PPC Assembly Printer