1 ; RUN: opt -passes='require<loops>,newgvn' -S < %s | FileCheck %s
3 ; This used to fail with ASAN enabled and if for some reason LoopInfo remained
4 ; available during GVN. In this case BasicAA will use LI but
5 ; MergeBlockIntoPredecessor in GVN failed to update LI.
7 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
9 %struct.wibble.1028 = type { i32, i32, %struct.barney.881 }
10 %struct.barney.881 = type { %struct.zot.882 }
11 %struct.zot.882 = type { [64 x i8] }
13 ; Function Attrs: argmemonly
14 declare void @snork.1(ptr) local_unnamed_addr #0
16 define hidden zeroext i1 @eggs(ptr %arg, i1 %arg2) unnamed_addr align 2 {
18 br i1 %arg2, label %bb14, label %bb3
21 %tmp = getelementptr inbounds %struct.wibble.1028, ptr %arg, i64 0, i32 2, i32 0, i32 0, i64 0
24 bb6: ; preds = %bb12, %bb3
28 br i1 undef, label %bb11, label %bb8
31 %tmp9 = load ptr, ptr %tmp, align 8
32 ; CHECK: %tmp9 = load ptr, ptr %tmp, align 8
38 bb12: ; preds = %bb11, %bb8
39 %tmp13 = phi ptr [ %tmp, %bb11 ], [ %tmp9, %bb8 ]
40 call void @snork.1(ptr %tmp13) #1
47 attributes #0 = { argmemonly }
48 attributes #1 = { nounwind }