1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=dse -S < %s | FileCheck %s
4 @global = external constant i8
8 ; CHECK-NEXT: [[TMP1:%.*]] = call noalias ptr @_Znwm(i64 32)
9 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ugt ptr [[TMP1]], @global
10 ; CHECK-NEXT: call void @llvm.assume(i1 [[TMP2]])
11 ; CHECK-NEXT: store i8 0, ptr [[TMP1]], align 1
12 ; CHECK-NEXT: ret void
14 %tmp1 = call noalias ptr @_Znwm(i64 32)
15 %tmp2 = icmp ugt ptr %tmp1, @global
16 call void @llvm.assume(i1 %tmp2)
17 store i8 0, ptr %tmp1, align 1
23 ; CHECK-NEXT: [[TMP1:%.*]] = call noalias ptr @_Znwm(i64 32)
24 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ugt ptr [[TMP1]], @global
25 ; CHECK-NEXT: call void @llvm.assume(i1 [[TMP2]])
26 ; CHECK-NEXT: store i8 0, ptr [[TMP1]], align 1
27 ; CHECK-NEXT: call void @quux(ptr @global)
28 ; CHECK-NEXT: ret void
30 %tmp1 = call noalias ptr @_Znwm(i64 32)
31 %tmp2 = icmp ugt ptr %tmp1, @global
32 call void @llvm.assume(i1 %tmp2)
33 store i8 0, ptr %tmp1, align 1
34 call void @quux(ptr @global)
38 ; FIXME: This is a miscompile
39 define void @pr70547() {
40 ; CHECK-LABEL: @pr70547(
41 ; CHECK-NEXT: [[A:%.*]] = alloca i8, align 1
42 ; CHECK-NEXT: store i8 0, ptr [[A]], align 1
43 ; CHECK-NEXT: [[CALL:%.*]] = call ptr @quux(ptr [[A]]) #[[ATTR1:[0-9]+]]
44 ; CHECK-NEXT: [[V:%.*]] = load i8, ptr [[CALL]], align 1
45 ; CHECK-NEXT: [[CMP:%.*]] = icmp ne i8 [[V]], 1
46 ; CHECK-NEXT: call void @llvm.assume(i1 [[CMP]])
47 ; CHECK-NEXT: ret void
51 %call = call ptr @quux(ptr %a) memory(none) nounwind willreturn
52 %v = load i8, ptr %call
53 %cmp = icmp ne i8 %v, 1
54 call void @llvm.assume(i1 %cmp)
58 declare ptr @_Znwm(i64)
60 declare void @llvm.assume(i1)
62 declare void @quux(ptr)