1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
2 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT
3 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC
5 ; FIXME: DOT should be replaced with 3
7 define i32 @test-ashr(i32 %c) {
8 ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
9 ; CHECK-LABEL: define {{[^@]+}}@test-ashr
10 ; CHECK-SAME: (i32 [[C:%.*]]) #[[ATTR0:[0-9]+]] {
12 ; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[C]], 65
13 ; CHECK-NEXT: br i1 [[CMP]], label [[RETURN:%.*]], label [[CHK0:%.*]]
15 ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i32 [[C]], 0
16 ; CHECK-NEXT: br i1 [[CMP]], label [[RETURN]], label [[BB_IF:%.*]]
18 ; CHECK-NEXT: [[ASHR_VAL:%.*]] = ashr exact i32 [[C]], 2
19 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[ASHR_VAL]], 15
20 ; CHECK-NEXT: br i1 [[CMP2]], label [[BB_THEN:%.*]], label [[RETURN]]
22 ; CHECK-NEXT: [[CMP3:%.*]] = icmp eq i32 [[ASHR_VAL]], 16
23 ; CHECK-NEXT: [[DOT:%.*]] = select i1 [[CMP3]], i32 3, i32 2
24 ; CHECK-NEXT: br label [[RETURN]]
26 ; CHECK-NEXT: [[RETVAL:%.*]] = phi i32 [ 0, [[CHK65:%.*]] ], [ 1, [[CHK0]] ], [ [[DOT]], [[BB_THEN]] ], [ 4, [[BB_IF]] ]
27 ; CHECK-NEXT: ret i32 [[RETVAL]]
30 %cmp = icmp sgt i32 %c, 65
31 br i1 %cmp, label %return, label %chk0
34 %cmp1 = icmp slt i32 %c, 0
35 br i1 %cmp, label %return, label %bb_if
38 %ashr.val = ashr exact i32 %c, 2
39 %cmp2 = icmp sgt i32 %ashr.val, 15
40 br i1 %cmp2, label %bb_then, label %return
43 %cmp3 = icmp eq i32 %ashr.val, 16
44 %. = select i1 %cmp3, i32 3, i32 2
48 %retval = phi i32 [0, %chk65], [1, %chk0], [%., %bb_then], [4, %bb_if]
52 ; CHECK: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
54 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: