Follow up to d0858bffa11, add missing REQUIRES x86
[llvm-project.git] / llvm / test / Transforms / IndVarSimplify / pr40454.ll
blobd77ec74b330c107680092c11bff40f7505e4c92a
1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=indvars  < %s | FileCheck %s
4 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
6 define void @test() {
7 ; CHECK-LABEL: @test(
8 ; CHECK-NEXT:  bb:
9 ; CHECK-NEXT:    br label [[BB2:%.*]]
10 ; CHECK:       bb1:
11 ; CHECK-NEXT:    br label [[BB2]]
12 ; CHECK:       bb2:
13 ; CHECK-NEXT:    [[TMP:%.*]] = phi i32 [ -9, [[BB:%.*]] ], [ -10, [[BB1:%.*]] ]
14 ; CHECK-NEXT:    br label [[BB3:%.*]]
15 ; CHECK:       bb3:
16 ; CHECK-NEXT:    br i1 false, label [[BB5:%.*]], label [[BB12:%.*]]
17 ; CHECK:       bb5:
18 ; CHECK-NEXT:    br i1 undef, label [[BB8:%.*]], label [[BB9:%.*]]
19 ; CHECK:       bb8:
20 ; CHECK-NEXT:    br label [[BB10:%.*]]
21 ; CHECK:       bb9:
22 ; CHECK-NEXT:    br label [[BB10]]
23 ; CHECK:       bb10:
24 ; CHECK-NEXT:    br label [[BB3]]
25 ; CHECK:       bb12:
26 ; CHECK-NEXT:    ret void
29 bb:
30   br label %bb2
32 bb1:                                              ; No predecessors!
33   br label %bb2
35 bb2:                                              ; preds = %bb1, %bb
36   %tmp = phi i32 [ -9, %bb ], [ %tmp6, %bb1 ]
37   br label %bb3
39 bb3:                                              ; preds = %bb10, %bb2
40   %tmp4 = phi i32 [ -9, %bb2 ], [ %tmp6, %bb10 ]
41   br i1 undef, label %bb5, label %bb12
43 bb5:                                              ; preds = %bb3
44   %tmp6 = add i32 %tmp4, -1
45   %tmp7 = zext i32 %tmp6 to i64
46   br i1 undef, label %bb8, label %bb9
48 bb8:                                              ; preds = %bb5
49   br label %bb10
51 bb9:                                              ; preds = %bb5
52   br label %bb10
54 bb10:                                             ; preds = %bb9, %bb8
55   %tmp11 = and i64 undef, %tmp7
56   br label %bb3
58 bb12:                                             ; preds = %bb3
59   ret void