Use "isa" since the variable isn't used.
[llvm-complete.git] / test / Transforms / SimpleLoopUnswitch / exponential-nontrivial-unswitch.ll
blob142974c5b8113359dad54ee0c5d4021041d7a1dc
2 ; There should be just a single copy of loop when strictest mutiplier candidates
3 ; formula (unscaled candidates == 0) is enforced:
5 ; RUN: opt < %s -enable-unswitch-cost-multiplier=true \
6 ; RUN:     -unswitch-num-initial-unscaled-candidates=0 -unswitch-siblings-toplevel-div=1 \
7 ; RUN:     -passes='loop(unswitch<nontrivial>),print<loops>' -disable-output 2>&1 | FileCheck %s --check-prefixes=LOOP1
9 ; RUN: opt < %s -enable-unswitch-cost-multiplier=true \
10 ; RUN:     -unswitch-num-initial-unscaled-candidates=0 -unswitch-siblings-toplevel-div=8 \
11 ; RUN:     -passes='loop(unswitch<nontrivial>),print<loops>' -disable-output 2>&1 | FileCheck %s --check-prefixes=LOOP1
13 ; With relaxed candidates multiplier (unscaled candidates == 8) we should allow
14 ; some unswitches to happen until siblings multiplier starts kicking in:
16 ; RUN: opt < %s -enable-unswitch-cost-multiplier=true \
17 ; RUN:     -unswitch-num-initial-unscaled-candidates=8 -unswitch-siblings-toplevel-div=1 \
18 ; RUN:     -passes='loop(unswitch<nontrivial>),print<loops>' -disable-output 2>&1 | FileCheck %s --check-prefixes=LOOP5
20 ; With relaxed candidates multiplier (unscaled candidates == 8) and with relaxed
21 ; siblings multiplier for top-level loops (toplevel-div == 8) we should get
22 ;    2^(num conds) == 2^5 == 32
23 ; copies of the loop:
25 ; RUN: opt < %s -enable-unswitch-cost-multiplier=true \
26 ; RUN:     -unswitch-num-initial-unscaled-candidates=8 -unswitch-siblings-toplevel-div=8 \
27 ; RUN:     -passes='loop(unswitch<nontrivial>),print<loops>' -disable-output 2>&1 | FileCheck %s --check-prefixes=LOOP32
29 ; Similarly get
30 ;    2^(num conds) == 2^5 == 32
31 ; copies of the loop when cost multiplier is disabled:
33 ; RUN: opt < %s -enable-unswitch-cost-multiplier=false \
34 ; RUN:     -passes='loop(unswitch<nontrivial>),print<loops>' -disable-output 2>&1 | FileCheck %s --check-prefixes=LOOP32
37 ; Single loop, not unswitched
38 ; LOOP1:     Loop at depth 1 containing:
39 ; LOOP1-NOT: Loop at depth 1 containing:
41 ; 5 loops, unswitched 4 times
42 ; LOOP5-COUNT-5: Loop at depth 1 containing:
43 ; LOOP5-NOT:     Loop at depth 1 containing:
45 ; 32 loops, fully unswitched
46 ; LOOP32-COUNT-32: Loop at depth 1 containing:
47 ; LOOP32-NOT:     Loop at depth 1 containing:
49 define void @loop_simple5(i32* %addr, i1 %c1, i1 %c2, i1 %c3, i1 %c4, i1 %c5) {
50 entry:
51   br label %loop
52 loop:
53   %iv = phi i32 [0, %entry], [%iv.next, %loop_latch]
54   %iv.next = add i32 %iv, 1
55   br i1 %c1, label %loop_next1, label %loop_next1_right
56 loop_next1_right:
57   br label %loop_next1
58 loop_next1:
59   br i1 %c2, label %loop_next2, label %loop_next2_right
60 loop_next2_right:
61   br label %loop_next2
62 loop_next2:
63   br i1 %c3, label %loop_next3, label %loop_next3_right
64 loop_next3_right:
65   br label %loop_next3
66 loop_next3:
67   br i1 %c4, label %loop_next4, label %loop_next4_right
68 loop_next4_right:
69   br label %loop_next4
70 loop_next4:
71   br i1 %c5, label %loop_latch, label %loop_latch_right
72 loop_latch_right:
73   br label %loop_latch
74 loop_latch:
75   store volatile i32 0, i32* %addr
76   %test_loop = icmp slt i32 %iv, 50
77   br i1 %test_loop, label %loop, label %exit
78 exit:
79   ret void