This is an archive of the discontinued LLVM Phabricator instance.

[MBP] Enable duplicating return block to remove jump to return
ClosedPublic

Authored by Carrot on Jun 15 2023, 6:34 PM.

Details

Summary

Sometimes LLVM generates branch to return instruction, like PR63227.

It is because in function MachineBlockPlacement::canTailDuplicateUnplacedPreds we avoid duplicating a BB into another already placed BB to prevent destroying computed layout. But if the successor BB is a return block, duplicating it will only reduce taken branches without hurt to any other branches.

Diff Detail

Event Timeline

Carrot created this revision.Jun 15 2023, 6:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2023, 6:34 PM
Carrot requested review of this revision.Jun 15 2023, 6:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2023, 6:34 PM

is the bug number referenced valid?

is the bug number referenced valid?

The complete link is https://github.com/llvm/llvm-project/issues/63227.

This revision is now accepted and ready to land.Jun 20 2023, 12:22 PM
This revision was landed with ongoing or failed builds.Jun 21 2023, 11:57 AM
This revision was automatically updated to reflect the committed changes.