66 lines · plain
1; Disable this test in profcheck because the first run would cause profcheck to fail.2; REQUIRES: !profcheck3; RUN: opt -p "print<block-freq>,loop-unroll,print<block-freq>" -scev-cheap-expansion-budget=3 -S %s -profcheck-disable-metadata-fixes 2>&1 | FileCheck %s --check-prefixes=COMMON,BAD4; RUN: opt -p "print<block-freq>,loop-unroll,print<block-freq>" -scev-cheap-expansion-budget=3 -S %s 2>&1 | FileCheck %s --check-prefixes=COMMON,GOOD5 6define i32 @test_expansion_cost_2(i32 %start, i32 %end) !prof !0 {7entry:8 %sub = add i32 %end, -19 br label %loop.header10 11loop.header:12 %iv = phi i32 [ %start, %entry ], [ %iv.next, %loop.latch ]13 %c = icmp eq i32 %iv, %sub14 br i1 %c, label %then, label %loop.latch, !prof !115 16then:17 br label %loop.latch18 19loop.latch:20 %iv.next = add nsw i32 %iv, 121 %ec = icmp eq i32 %iv.next, %end22 br i1 %ec, label %exit, label %loop.header, !prof !223 24exit:25 ret i32 026}27 28!0 = !{!"function_entry_count", i32 10}29!1 = !{!"branch_weights", i32 2, i32 3}30!2 = !{!"branch_weights", i32 1, i32 50}31 32; COMMON: block-frequency-info: test_expansion_cost_233; COMMON-NEXT: entry: float = 1.034; COMMON-NEXT: loop.header: float = 51.035; COMMON-NEXT: then: float = 20.436; COMMON-NEXT: loop.latch: float = 51.037; COMMON-NEXT: exit: float = 1.038 39; COMMON: block-frequency-info: test_expansion_cost_240; GOOD-NEXT: entry: float = 1.041; GOOD-NEXT: entry.split: float = 0.9803942; GOOD-NEXT: loop.header: float = 50.043; GOOD-NEXT: then: float = 20.044; GOOD-NEXT: loop.latch: float = 50.045; GOOD-NEXT: exit.peel.begin.loopexit: float = 0.9803946; GOOD-NEXT: exit.peel.begin: float = 1.047; GOOD-NEXT: loop.header.peel: float = 1.048; GOOD-NEXT: then.peel: float = 0.449; GOOD-NEXT: loop.latch.peel: float = 1.050; GOOD-NEXT: exit.peel.next: float = 1.051; GOOD-NEXT: loop.header.peel.next: float = 1.052; GOOD-NEXT: exit: float = 1.053 54; BAD-NEXT: entry: float = 1.055; BAD-NEXT: entry.split: float = 0.62556; BAD-NEXT: loop.header: float = 31.87557; BAD-NEXT: then: float = 12.7558; BAD-NEXT: loop.latch: float = 31.87559; BAD-NEXT: exit.peel.begin.loopexit: float = 0.62560; BAD-NEXT: exit.peel.begin: float = 1.061; BAD-NEXT: loop.header.peel: float = 1.062; BAD-NEXT: then.peel: float = 0.463; BAD-NEXT: loop.latch.peel: float = 1.064; BAD-NEXT: exit.peel.next: float = 1.065; BAD-NEXT: loop.header.peel.next: float = 1.066; BAD-NEXT: exit: float = 1.0