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 ptr
10 ; CHECK-LABEL: @wibble(
12 ; CHECK-NEXT: [[TMP20:%.*]] = getelementptr i8, ptr undef, i64 16
13 ; CHECK-NEXT: [[TMP21:%.*]] = load atomic ptr, ptr @global unordered, align 8
14 ; CHECK-NEXT: [[TMP22:%.*]] = getelementptr inbounds i8, ptr [[TMP21]], i64 936
15 ; CHECK-NEXT: br label [[BB3:%.*]]
17 ; CHECK-NEXT: br label [[BB3]]
19 ; CHECK-NEXT: [[TMP:%.*]] = phi ptr [ [[TMP22]], [[BB19:%.*]] ], [ undef, [[BB2:%.*]] ]
20 ; CHECK-NEXT: [[TMP4:%.*]] = phi ptr [ [[TMP21]], [[BB19]] ], [ undef, [[BB2]] ]
21 ; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds i8, ptr [[TMP4]], i64 848
22 ; CHECK-NEXT: br label [[BB11:%.*]]
24 ; CHECK-NEXT: [[TMP12:%.*]] = load atomic ptr, ptr [[TMP6]] unordered, align 8
25 ; CHECK-NEXT: [[TMP13:%.*]] = icmp eq ptr [[TMP12]], null
26 ; CHECK-NEXT: br i1 [[TMP13]], label [[BB17:%.*]], label [[BB16:%.*]]
28 ; CHECK-NEXT: store atomic i64 undef, ptr [[TMP]] unordered, align 8
29 ; CHECK-NEXT: br label [[BB11]]
31 ; CHECK-NEXT: ret i32 undef
39 bb2: ; No predecessors!
42 bb3: ; preds = %bb19, %bb2
43 %tmp = phi ptr [ %tmp22, %bb19 ], [ undef, %bb2 ]
44 %tmp4 = phi ptr [ %tmp21, %bb19 ], [ undef, %bb2 ]
45 %tmp6 = getelementptr inbounds i8, ptr %tmp4, i64 848
48 bb11: ; preds = %bb16, %bb3
49 %tmp12 = load atomic ptr, ptr %tmp6 unordered, align 8
50 %tmp13 = icmp eq ptr %tmp12, null
51 br i1 %tmp13, label %bb17, label %bb14
60 store atomic i64 undef, ptr %tmp unordered, align 8
70 %tmp20 = getelementptr i8, ptr undef, i64 16
71 %tmp21 = load atomic ptr, ptr @global unordered, align 8
72 %tmp22 = getelementptr inbounds i8, ptr %tmp21, i64 936
76 define void @zot(ptr align 8 dereferenceable_or_null(16) %arg, i32 %arg1) {
79 ; CHECK-NEXT: ret void