From 47130384257a6c68e5ebcda74610fbec0d25f0a3 Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Thu, 7 Apr 2022 15:37:16 -0700 Subject: [PATCH] [test][DSE] Precommit more assume tests --- llvm/test/Transforms/DeadStoreElimination/assume.ll | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/llvm/test/Transforms/DeadStoreElimination/assume.ll b/llvm/test/Transforms/DeadStoreElimination/assume.ll index c131ae9..10c3f05 100644 --- a/llvm/test/Transforms/DeadStoreElimination/assume.ll +++ b/llvm/test/Transforms/DeadStoreElimination/assume.ll @@ -17,6 +17,25 @@ define void @f() { ret void } +define void @f2() { +; CHECK-LABEL: @f2( +; CHECK-NEXT: [[TMP1:%.*]] = call noalias i8* @_Znwm(i64 32) +; CHECK-NEXT: [[TMP2:%.*]] = icmp ugt i8* [[TMP1]], @global +; CHECK-NEXT: call void @llvm.assume(i1 [[TMP2]]) +; CHECK-NEXT: store i8 0, i8* [[TMP1]], align 1 +; CHECK-NEXT: call void @quux(i8* @global) +; CHECK-NEXT: ret void +; + %tmp1 = call noalias i8* @_Znwm(i64 32) + %tmp2 = icmp ugt i8* %tmp1, @global + call void @llvm.assume(i1 %tmp2) + store i8 0, i8* %tmp1, align 1 + call void @quux(i8* @global) + ret void +} + declare i8* @_Znwm(i64) declare void @llvm.assume(i1) + +declare void @quux(i8*) -- 2.7.4