|
@@ -354,7 +354,6 @@ define void @unnatural_cfg2() {
|
|
|
; single-source GCC.
|
|
|
; CHECK-LABEL: unnatural_cfg2
|
|
|
; CHECK: %entry
|
|
|
-; CHECK: %loop.header
|
|
|
; CHECK: %loop.body1
|
|
|
; CHECK: %loop.body2
|
|
|
; CHECK: %loop.body4
|
|
@@ -362,6 +361,7 @@ define void @unnatural_cfg2() {
|
|
|
; CHECK: %loop.inner2.begin
|
|
|
; CHECK: %loop.body3
|
|
|
; CHECK: %loop.inner1.begin
|
|
|
+; CHECK: %loop.header
|
|
|
; CHECK: %bail
|
|
|
|
|
|
entry:
|
|
@@ -1491,54 +1491,6 @@ ret: ; preds = %endif, %then
|
|
|
ret void
|
|
|
}
|
|
|
|
|
|
-define i32 @not_rotate_if_extra_branch(i32 %count) {
|
|
|
-; Test checks that there is no loop rotation
|
|
|
-; if it introduces extra branch.
|
|
|
-; Specifically in this case because best exit is .header
|
|
|
-; but it has fallthrough to .middle block and last block in
|
|
|
-; loop chain .slow does not have afallthrough to .header.
|
|
|
-; CHECK-LABEL: not_rotate_if_extra_branch
|
|
|
-; CHECK: %.entry
|
|
|
-; CHECK: %.header
|
|
|
-; CHECK: %.middle
|
|
|
-; CHECK: %.backedge
|
|
|
-; CHECK: %.slow
|
|
|
-; CHECK: %.bailout
|
|
|
-; CHECK: %.stop
|
|
|
-.entry:
|
|
|
- %sum.0 = shl nsw i32 %count, 1
|
|
|
- br label %.header
|
|
|
-
|
|
|
-.header:
|
|
|
- %i = phi i32 [ %i.1, %.backedge ], [ 0, %.entry ]
|
|
|
- %sum = phi i32 [ %sum.1, %.backedge ], [ %sum.0, %.entry ]
|
|
|
- %is_exc = icmp sgt i32 %i, 9000000
|
|
|
- br i1 %is_exc, label %.bailout, label %.middle, !prof !13
|
|
|
-
|
|
|
-.bailout:
|
|
|
- %sum.2 = add nsw i32 %count, 1
|
|
|
- br label %.stop
|
|
|
-
|
|
|
-.middle:
|
|
|
- %pr.1 = and i32 %i, 1023
|
|
|
- %pr.2 = icmp eq i32 %pr.1, 0
|
|
|
- br i1 %pr.2, label %.slow, label %.backedge, !prof !14
|
|
|
-
|
|
|
-.slow:
|
|
|
- tail call void @effect(i32 %sum)
|
|
|
- br label %.backedge
|
|
|
-
|
|
|
-.backedge:
|
|
|
- %sum.1 = add nsw i32 %i, %sum
|
|
|
- %i.1 = add nsw i32 %i, 1
|
|
|
- %end = icmp slt i32 %i.1, %count
|
|
|
- br i1 %end, label %.header, label %.stop, !prof !15
|
|
|
-
|
|
|
-.stop:
|
|
|
- %sum.phi = phi i32 [ %sum.1, %.backedge ], [ %sum.2, %.bailout ]
|
|
|
- ret i32 %sum.phi
|
|
|
-}
|
|
|
-
|
|
|
declare void @effect(i32)
|
|
|
|
|
|
!5 = !{!"branch_weights", i32 84, i32 16}
|
|
@@ -1549,6 +1501,3 @@ declare void @effect(i32)
|
|
|
!10 = !{!"branch_weights", i32 90, i32 10}
|
|
|
!11 = !{!"branch_weights", i32 1, i32 1}
|
|
|
!12 = !{!"branch_weights", i32 5, i32 3}
|
|
|
-!13 = !{!"branch_weights", i32 1, i32 1}
|
|
|
-!14 = !{!"branch_weights", i32 1, i32 1023}
|
|
|
-!15 = !{!"branch_weights", i32 4095, i32 1}
|