This is an archive of the discontinued LLVM Phabricator instance.

CodeGen: Tail-duplicate longer blocks that end with indirect branches.
AbandonedPublic

Authored by iteratee on Aug 30 2016, 10:56 AM.

Details

Reviewers
davidxl
Summary

Specifically, this is currently done for tail-duplication before
register allocation, and is now done for tail-duplication during layout.

A similar change was necessary for tail-merging during layout to prevent
the two from being in conflict.

Diff Detail

Event Timeline

iteratee updated this revision to Diff 69726.Aug 30 2016, 10:56 AM
iteratee retitled this revision from to CodeGen: Tail-duplicate longer blocks that end with indirect branches..
iteratee updated this object.
iteratee added a reviewer: davidxl.
iteratee set the repository for this revision to rL LLVM.
iteratee added subscribers: llvm-commits, echristo, timshen.
davidxl added inline comments.Aug 30 2016, 2:49 PM
lib/CodeGen/TailDuplicator.cpp
569

I asked the question before: can you use back.isIndirectBranch() && !back.isReturn() ?

iteratee marked an inline comment as done.Aug 30 2016, 3:06 PM
iteratee added inline comments.
lib/CodeGen/TailDuplicator.cpp
569

Sorry if the reply got lost in splitting this out.
I checked, and no, that's not something that works. There are platforms where lowered returns don't set isReturn()

It's unfortunate, but it's what's there.

davidxl accepted this revision.Aug 31 2016, 1:54 PM
davidxl edited edge metadata.

lgtm

This revision is now accepted and ready to land.Aug 31 2016, 1:54 PM
iteratee marked an inline comment as done.Oct 12 2016, 3:01 PM

It's been a while, because of dependencies. Are you still fine with this going in?

Need a test case.

Also do you have any performance data?

lib/CodeGen/BranchFolding.cpp
709

!empty()

713

This basically disabled tailMerging for blocks with indirect branch. Is there a way to override that? If not, why not simply disable TailMerge for such blocks directly?

iteratee abandoned this revision.May 2 2017, 4:38 PM