1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S < %s -aa-pipeline=basic-aa -passes='require<loops>,jump-threading' | FileCheck %s
4 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:1"
5 target triple = "x86_64-unknown-linux-gnu"
7 @global = external global i8*
10 ; CHECK-LABEL: @wibble(
12 ; CHECK-NEXT: [[TMP20:%.*]] = getelementptr i8, i8* undef, i64 16
13 ; CHECK-NEXT: [[TMP21:%.*]] = load atomic i8*, i8** @global unordered, align 8
14 ; CHECK-NEXT: [[TMP22:%.*]] = getelementptr inbounds i8, i8* [[TMP21]], i64 936
15 ; CHECK-NEXT: br label [[BB3:%.*]]
17 ; CHECK-NEXT: br label [[BB3]]
19 ; CHECK-NEXT: [[TMP:%.*]] = phi i8* [ [[TMP22]], [[BB19:%.*]] ], [ undef, [[BB2:%.*]] ]
20 ; CHECK-NEXT: [[TMP4:%.*]] = phi i8* [ [[TMP21]], [[BB19]] ], [ undef, [[BB2]] ]
21 ; CHECK-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP]] to i64*
22 ; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds i8, i8* [[TMP4]], i64 848
23 ; CHECK-NEXT: [[TMP7:%.*]] = bitcast i8* [[TMP6]] to i8**
24 ; CHECK-NEXT: br label [[BB11:%.*]]
26 ; CHECK-NEXT: [[TMP12:%.*]] = load atomic i8*, i8** [[TMP7]] unordered, align 8
27 ; CHECK-NEXT: [[TMP13:%.*]] = icmp eq i8* [[TMP12]], null
28 ; CHECK-NEXT: br i1 [[TMP13]], label [[BB17:%.*]], label [[BB16:%.*]]
30 ; CHECK-NEXT: store atomic i64 undef, i64* [[TMP5]] unordered, align 8
31 ; CHECK-NEXT: br label [[BB11]]
33 ; CHECK-NEXT: ret i32 undef
41 bb2: ; No predecessors!
44 bb3: ; preds = %bb19, %bb2
45 %tmp = phi i8* [ %tmp22, %bb19 ], [ undef, %bb2 ]
46 %tmp4 = phi i8* [ %tmp21, %bb19 ], [ undef, %bb2 ]
47 %tmp5 = bitcast i8* %tmp to i64*
48 %tmp6 = getelementptr inbounds i8, i8* %tmp4, i64 848
49 %tmp7 = bitcast i8* %tmp6 to i8**
52 bb11: ; preds = %bb16, %bb3
53 %tmp12 = load atomic i8*, i8** %tmp7 unordered, align 8
54 %tmp13 = icmp eq i8* %tmp12, null
55 br i1 %tmp13, label %bb17, label %bb14
64 store atomic i64 undef, i64* %tmp5 unordered, align 8
74 %tmp20 = getelementptr i8, i8* undef, i64 16
75 %tmp21 = load atomic i8*, i8** @global unordered, align 8
76 %tmp22 = getelementptr inbounds i8, i8* %tmp21, i64 936
80 define void @zot(i8* align 8 dereferenceable_or_null(16) %arg, i32 %arg1) {
83 ; CHECK-NEXT: ret void