61 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -passes=dse -S < %s | FileCheck %s3 4@global = external constant i85 6define void @f() {7; CHECK-LABEL: @f(8; CHECK-NEXT: [[TMP1:%.*]] = call noalias ptr @_Znwm(i64 32)9; CHECK-NEXT: [[TMP2:%.*]] = icmp ugt ptr [[TMP1]], @global10; CHECK-NEXT: call void @llvm.assume(i1 [[TMP2]])11; CHECK-NEXT: ret void12;13 %tmp1 = call noalias ptr @_Znwm(i64 32)14 %tmp2 = icmp ugt ptr %tmp1, @global15 call void @llvm.assume(i1 %tmp2)16 store i8 0, ptr %tmp1, align 117 ret void18}19 20define void @f2() {21; CHECK-LABEL: @f2(22; CHECK-NEXT: [[TMP1:%.*]] = call noalias ptr @_Znwm(i64 32)23; CHECK-NEXT: [[TMP2:%.*]] = icmp ugt ptr [[TMP1]], @global24; CHECK-NEXT: call void @llvm.assume(i1 [[TMP2]])25; CHECK-NEXT: call void @quux(ptr @global)26; CHECK-NEXT: ret void27;28 %tmp1 = call noalias ptr @_Znwm(i64 32)29 %tmp2 = icmp ugt ptr %tmp1, @global30 call void @llvm.assume(i1 %tmp2)31 store i8 0, ptr %tmp1, align 132 call void @quux(ptr @global)33 ret void34}35 36; FIXME: This is a miscompile37define void @pr70547() {38; CHECK-LABEL: @pr70547(39; CHECK-NEXT: [[A:%.*]] = alloca i8, align 140; CHECK-NEXT: store i8 0, ptr [[A]], align 141; CHECK-NEXT: [[CALL:%.*]] = call ptr @quux(ptr [[A]]) #[[ATTR1:[0-9]+]]42; CHECK-NEXT: [[V:%.*]] = load i8, ptr [[CALL]], align 143; CHECK-NEXT: [[CMP:%.*]] = icmp ne i8 [[V]], 144; CHECK-NEXT: call void @llvm.assume(i1 [[CMP]])45; CHECK-NEXT: ret void46;47 %a = alloca i848 store i8 0, ptr %a49 %call = call ptr @quux(ptr %a) memory(none) nounwind willreturn50 %v = load i8, ptr %call51 %cmp = icmp ne i8 %v, 152 call void @llvm.assume(i1 %cmp)53 ret void54}55 56declare ptr @_Znwm(i64)57 58declare void @llvm.assume(i1)59 60declare void @quux(ptr)61