Page MenuHomePhabricator

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

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



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

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.

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.


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?




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