This is an archive of the discontinued LLVM Phabricator instance.

[BranchFolding] Update UnavoidableBlocks for OutlineOptionalBranches
AbandonedPublic

Authored by haicheng on Jun 23 2016, 10:08 PM.

Details

Reviewers
mssimpso
Summary

The experimental code OutlineOptionalBranches of machine block placement requires updated UnavoidableBlocks if tail merging is called during the placement.

OutlineOptionalBranches partitions blocks into two groups, unavoidable blocks which dominates all the return blocks and the rest. During the layout, blocks in each group are placed consecutively. Unavoidable blocks are placed at the top and the rest blocks are at the bottom.

This patch caches and maintains the set of UnavoidableBlocks during tail merging so that we don't need to recalculate it when the layout is called again.

Diff Detail

Repository
rL LLVM

Event Timeline

haicheng updated this revision to Diff 61757.Jun 23 2016, 10:08 PM
haicheng retitled this revision from to [BranchFolding] Update UnavoidableBlocks for OutlineOptionalBranches.
haicheng updated this object.
haicheng added reviewers: mcrosier, mssimpso.
haicheng set the repository for this revision to rL LLVM.
haicheng added subscribers: iteratee, llvm-commits, echristo.
haicheng updated this revision to Diff 61792.Jun 24 2016, 8:14 AM
haicheng updated this object.

Add a missing check.

iteratee requested changes to this revision.Jun 24 2016, 10:32 AM
iteratee added a reviewer: iteratee.
iteratee edited edge metadata.

Updating just unavoidable blocks is insufficient.

See D20505 for an example of why.

This revision now requires changes to proceed.Jun 24 2016, 10:33 AM

I'm also looking at this, and it doesn't even correctly update the list of unavoidable blocks. Consider merging 2 identical blocks, neither of which is unavoidable, but the merged block is. There are other examples, but that's probably the simplest one to describe in a comment.

I'm also looking at this, and it doesn't even correctly update the list of unavoidable blocks. Consider merging 2 identical blocks, neither of which is unavoidable, but the merged block is. There are other examples, but that's probably the simplest one to describe in a comment.

Tail merging merges predecessors so that it is possible that an avoidable blocks can be promoted to be unavoidable, but I don't think an unavoidable block can become avoidable.

It does not make things worse if the block can be promoted remains in the avoidable area. Tail merging always make things better although maybe not best. I think you tail duplication patch can at least live with this patch and move on. If you want precise update, I can do it for you in the next patch.

mcrosier resigned from this revision.Jul 26 2016, 10:37 AM
mcrosier removed a reviewer: mcrosier.

@haicheng, are you still interested in trying to get this landed or is this something that can be abandon?

haicheng abandoned this revision.Aug 29 2016, 7:31 PM

Abandon it since it is not used.