]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Transforms/SimpleLoopUnswitch/exponential-behavior.ll
Vendor import of llvm trunk r351319 (just before the release_80 branch
[FreeBSD/FreeBSD.git] / test / Transforms / SimpleLoopUnswitch / exponential-behavior.ll
1 ; RUN: opt -simple-loop-unswitch -S < %s | FileCheck %s
2 ; RUN: opt -simple-loop-unswitch -enable-mssa-loop-dependency=true -verify-memoryssa -S < %s | FileCheck %s
3
4 define void @f(i32 %n, i32* %ptr) {
5 ; CHECK-LABEL: @f(
6 entry:
7   br label %loop
8
9 loop:
10   %iv = phi i32 [ 0, %entry ], [ %iv.inc, %be ]
11   %iv.inc = add i32 %iv, 1
12   %unswitch_cond_root = icmp ne i32 %iv.inc, 42
13   %us.0 = and i1 %unswitch_cond_root, %unswitch_cond_root
14   %us.1 = and i1 %us.0, %us.0
15   %us.2 = and i1 %us.1, %us.1
16   %us.3 = and i1 %us.2, %us.2
17   %us.4 = and i1 %us.3, %us.3
18   %us.5 = and i1 %us.4, %us.4
19   %us.6 = and i1 %us.5, %us.5
20   %us.7 = and i1 %us.6, %us.6
21   %us.8 = and i1 %us.7, %us.7
22   %us.9 = and i1 %us.8, %us.8
23   %us.10 = and i1 %us.9, %us.9
24   %us.11 = and i1 %us.10, %us.10
25   %us.12 = and i1 %us.11, %us.11
26   %us.13 = and i1 %us.12, %us.12
27   %us.14 = and i1 %us.13, %us.13
28   %us.15 = and i1 %us.14, %us.14
29   %us.16 = and i1 %us.15, %us.15
30   %us.17 = and i1 %us.16, %us.16
31   %us.18 = and i1 %us.17, %us.17
32   %us.19 = and i1 %us.18, %us.18
33   %us.20 = and i1 %us.19, %us.19
34   %us.21 = and i1 %us.20, %us.20
35   %us.22 = and i1 %us.21, %us.21
36   %us.23 = and i1 %us.22, %us.22
37   %us.24 = and i1 %us.23, %us.23
38   %us.25 = and i1 %us.24, %us.24
39   %us.26 = and i1 %us.25, %us.25
40   %us.27 = and i1 %us.26, %us.26
41   %us.28 = and i1 %us.27, %us.27
42   %us.29 = and i1 %us.28, %us.28
43   br i1 %us.29, label %leave, label %be
44
45 be:
46   store volatile i32 0, i32* %ptr
47   %becond = icmp ult i32 %iv.inc, %n
48   br i1 %becond, label %leave, label %loop
49
50 leave:
51   ret void
52 }