blob: 811b50783a5c5b8271059ea42da7675549acf536 [file] [log] [blame]
Saleem Abdulrasool082f8952019-09-23 22:23:01 +00001; RUN: opt -instcombine -hotcoldsplit -instsimplify %s -o /dev/null
2
3target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
4target triple = "aarch64"
5
6%a = type { i64, i64 }
7%b = type { i64 }
8
9define void @f() {
10entry:
11 %0 = getelementptr inbounds %a, %a* null, i64 0, i32 1
12 br label %label
13
14label:
15 %1 = bitcast i64* %0 to %b**
16 %2 = load %b*, %b** %1, align 8
17 %3 = getelementptr inbounds %b, %b* %2, i64 undef, i32 0
18 %4 = load i64, i64* %3, align 8
19 %5 = icmp ugt i64 %4, 1
20 br i1 %5, label %if.then, label %if.else
21
22if.then:
23 unreachable
24
25if.else:
26 call void @g(i8* undef)
27 %6 = load i64, i64* undef, align 8
28 %7 = and i64 %6, -16
29 %8 = inttoptr i64 %7 to i8*
30 %9 = icmp eq i64 %4, 0
31 call void @llvm.assume(i1 %9)
32 unreachable
33}
34
35declare void @g(i8*)
36
37declare void @llvm.assume(i1)
38