This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by lkail on Jun 23 2021, 12:12 AM.

Details

Summary

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

Diff Detail

Event Timeline

lkail created this revision.Jun 23 2021, 12:12 AM
lkail requested review of this revision.Jun 23 2021, 12:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 23 2021, 12:12 AM

Make sense to me. We should run this pass just before the assembly printer pass like the pass description says at the beginning of this file.

Otherwise, any (new added) transformation passes after this pass changing the instruction size would be at the risk of introducing performance or functionality issues.

This is presumably something that diverged from the original position for this pass. Please add a LIT test that will check the result of -debug-pass so we ensure that if anything gets added between the branch selector and the asm printer, it will cause a failure. Then we can evaluate on a case-by-case basis whether the pass may change the size/order of instructions/blocks and thereby whether it needs to be inserted elsewhere in the pipeline.

lkail updated this revision to Diff 354144.Jun 23 2021, 8:35 PM

Show pipeline change.

nemanjai accepted this revision.Jun 23 2021, 8:48 PM

LGTM. Thank you.

This revision is now accepted and ready to land.Jun 23 2021, 8:48 PM