[PATCH] D20017: Aggressive choosing best loop top

David Li via llvm-commits llvm-commits at lists.llvm.org
Wed May 11 22:33:47 PDT 2016


davidxl added inline comments.

================
Comment at: test/CodeGen/X86/code_placement_loop_rotation2.ll:8
@@ -7,1 +7,3 @@
 ; CHECK-LABEL: foo:
+; CHECK: jmp
+; CHECK: callq h
----------------
By the way, this example shows that the new expected layout is not as optimal as the one when -force-precise-rotation-cost is on (see below CHECK-PROFILE). 

The total branch cost of the optimal layout [e, f, c, d, h, b, g ] is:

C(c->e) + C(f->h) + C(d->f) + C(h->exit) + C(b->c)  + C(g->h)

while the total cost of aggressive loop top layout [h, b, g, f, c, d, e] is

C(c->e) + C(f->h) + C(d->f) + C(h->exit) + C(b->c)  + C(g->h) + C(e->f)

Edge e->f is in the inner loop and it is a hot edge , the additional cost of C(e->f) can be high.


http://reviews.llvm.org/D20017





More information about the llvm-commits mailing list