From be93ba1fd608cf9bef0a414c3193dff398c80c44 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sat, 20 Jun 2020 13:01:54 +0200 Subject: [PATCH] [CVP] Add another non null test (NFC) --- .../Transforms/CorrelatedValuePropagation/non-null.ll | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/llvm/test/Transforms/CorrelatedValuePropagation/non-null.ll b/llvm/test/Transforms/CorrelatedValuePropagation/non-null.ll index f470dc9..e2f6b79 100644 --- a/llvm/test/Transforms/CorrelatedValuePropagation/non-null.ll +++ b/llvm/test/Transforms/CorrelatedValuePropagation/non-null.ll @@ -61,7 +61,7 @@ bb: define void @test3() { ; CHECK-LABEL: @test3( -; CHECK-NEXT: [[PTR:%.*]] = alloca i8 +; CHECK-NEXT: [[PTR:%.*]] = alloca i8, align 1 ; CHECK-NEXT: br label [[BB:%.*]] ; CHECK: bb: ; CHECK-NEXT: ret void @@ -77,7 +77,7 @@ bb: define void @test3_no_null_opt() #0 { ; CHECK-LABEL: @test3_no_null_opt( -; CHECK-NEXT: [[PTR:%.*]] = alloca i8 +; CHECK-NEXT: [[PTR:%.*]] = alloca i8, align 1 ; CHECK-NEXT: br label [[BB:%.*]] ; CHECK: bb: ; CHECK-NEXT: ret void @@ -275,7 +275,7 @@ define void @test11(i8* %arg1, i8** %arg2) { ; CHECK: non_null: ; CHECK-NEXT: br label [[MERGE:%.*]] ; CHECK: null: -; CHECK-NEXT: [[ANOTHER_ARG:%.*]] = alloca i8 +; CHECK-NEXT: [[ANOTHER_ARG:%.*]] = alloca i8, align 1 ; CHECK-NEXT: br label [[MERGE]] ; CHECK: merge: ; CHECK-NEXT: [[MERGED_ARG:%.*]] = phi i8* [ [[ANOTHER_ARG]], [[NULL]] ], [ [[ARG1]], [[NON_NULL]] ] @@ -333,4 +333,15 @@ merge: ret void } +define i1 @test_store_same_block(i8* %arg) { +; CHECK-LABEL: @test_store_same_block( +; CHECK-NEXT: store i8 0, i8* [[ARG:%.*]], align 1 +; CHECK-NEXT: [[CMP:%.*]] = icmp ne i8* [[ARG]], null +; CHECK-NEXT: ret i1 [[CMP]] +; + store i8 0, i8* %arg + %cmp = icmp ne i8* %arg, null + ret i1 %cmp +} + attributes #0 = { null_pointer_is_valid } -- 2.7.4