[PATCH] D27742: CodeGen: Allow small copyable blocks to "break" the CFG.

Kyle Butt via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 21 16:28:08 PST 2016


iteratee added inline comments.


================
Comment at: test/CodeGen/PowerPC/tail-dup-layout.ll:97
 
+; The block then2 is not unavoidable, but since it can be tail-duplicated, it
+; should be placed as a fallthrough from test2 and copied.
----------------
davidxl wrote:
> The intention of this test case is not clear. I expect a simpler and straightforward test case for instance just a control flow with two concatenated triangles.  The first triangle branch is annotated with profile data such that without this patch it will layout the blocks in topo order. 
The straightline test that you're asking for will be redundant as soon as D20505 lands. (It removes the outlining flags from this file, and verifies the single triangle case by just doing multiple triangles)

This test is basically as small as possible. It needs a block that:
a) has predecessors that can accept a tail-duplicated copy
b) wouldn't be chosen based on some outlining algorithm
c) has at least 2 successors

The block then2 has 2 predecessors: else1, and test2

It has 2 successors: end1 and end2
and test2 has an alternate path around then2: else2


================
Comment at: test/CodeGen/PowerPC/tail-dup-layout.ll:116
+; CHECK: bl c
+define void @avoidable_test(i32 %tag) {
+entry:
----------------
davidxl wrote:
> The term 'avoidable'/'unavoidable' is not well defined and can be confusing. I also suggest add this test case in a different patch.
The goal of the test is a block that wouldn't be chosen due to some outlining strategy. Do you have a name you prefer?


https://reviews.llvm.org/D27742





More information about the llvm-commits mailing list