blob: dd082c74cf89474defb029d4f3dc7c807292086e [file] [log] [blame]
Eric Christophercee313d2019-04-17 04:52:47 +00001; RUN: opt -loops -gvn -S < %s | FileCheck %s
2
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.
6
7target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
8
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] }
12
13; Function Attrs: argmemonly
14declare void @snork.1(i8*) local_unnamed_addr #0
15
16define hidden zeroext i1 @eggs(%struct.wibble.1028* %arg, i1 %arg2) unnamed_addr align 2 {
17bb:
18 br i1 %arg2, label %bb14, label %bb3
19
20bb3: ; preds = %bb
21 %tmp = getelementptr inbounds %struct.wibble.1028, %struct.wibble.1028* %arg, i64 0, i32 2, i32 0, i32 0, i64 0
22 %tmp5 = bitcast i8* %tmp to %struct.wibble.1028**
23 br label %bb6
24
25bb6: ; preds = %bb12, %bb3
26 br label %bb7
27
28bb7: ; preds = %bb6
29 br i1 undef, label %bb11, label %bb8
30
31bb8: ; preds = %bb7
32 %tmp9 = load %struct.wibble.1028*, %struct.wibble.1028** %tmp5, align 8
33; CHECK: %tmp9 = load %struct.wibble.1028*, %struct.wibble.1028** %tmp5, align 8
34 %tmp10 = bitcast %struct.wibble.1028* %tmp9 to i8*
35 br label %bb12
36
37bb11: ; preds = %bb7
38 br label %bb12
39
40bb12: ; preds = %bb11, %bb8
41 %tmp13 = phi i8* [ %tmp, %bb11 ], [ %tmp10, %bb8 ]
42 call void @snork.1(i8* %tmp13) #1
43 br label %bb6
44
45bb14: ; preds = %bb
46 ret i1 false
47}
48
49attributes #0 = { argmemonly }
50attributes #1 = { nounwind }