[PowerPC] Move PPCBranchSelector as close to asm printer as possible

Currently, PPCBranchSelector is not immediately preceding asm printer pass. `-debug-pass=Structure` gives
```
      PowerPC Branch Selector
      Contiguously Lay Out Funclets
      StackMap Liveness Analysis
      Live DEBUG_VALUE analysis
      Lazy Machine Block Frequency Analysis
      Machine Optimization Remark Emitter
      Linux PPC Assembly Printer
```
After the patch
```
      Contiguously Lay Out Funclets
      StackMap Liveness Analysis
      Live DEBUG_VALUE analysis
      PowerPC Branch Selector
      Lazy Machine Block Frequency Analysis
      Machine Optimization Remark Emitter
      Linux PPC Assembly Printer
```

Reviewed By: nemanjai, #powerpc

Differential Revision: https://reviews.llvm.org/D104762
This commit is contained in:
Kai Luo 2021-06-25 01:43:31 +00:00
parent f3ef4f5bff
commit b904574b3d
2 changed files with 5 additions and 1 deletions

View File

@ -397,6 +397,7 @@ public:
void addPreRegAlloc() override;
void addPreSched2() override;
void addPreEmitPass() override;
void addPreEmitPass2() override;
// GlobalISEL
bool addIRTranslator() override;
bool addLegalizeMachineIR() override;
@ -535,6 +536,9 @@ void PPCPassConfig::addPreEmitPass() {
if (getOptLevel() != CodeGenOpt::None)
addPass(createPPCEarlyReturnPass());
}
void PPCPassConfig::addPreEmitPass2() {
// Must run branch selection immediately preceding the asm printer.
addPass(createPPCBranchSelectionPass());
}

View File

@ -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