[llvm] 1940c49 - [DSE] Regenerate test checks (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 5 07:08:27 PDT 2022
Author: Nikita Popov
Date: 2022-10-05T15:26:55+02:00
New Revision: 1940c499fea65cc31f704f0712a3018e8285d23d
URL: https://github.com/llvm/llvm-project/commit/1940c499fea65cc31f704f0712a3018e8285d23d
DIFF: https://github.com/llvm/llvm-project/commit/1940c499fea65cc31f704f0712a3018e8285d23d.diff
LOG: [DSE] Regenerate test checks (NFC)
Added:
Modified:
llvm/test/Transforms/DeadStoreElimination/PartialStore.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/DeadStoreElimination/PartialStore.ll b/llvm/test/Transforms/DeadStoreElimination/PartialStore.ll
index 1dd894e6658c..605268e2ca86 100644
--- a/llvm/test/Transforms/DeadStoreElimination/PartialStore.ll
+++ b/llvm/test/Transforms/DeadStoreElimination/PartialStore.ll
@@ -1,32 +1,46 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -basic-aa -dse -enable-dse-partial-store-merging=false -S | FileCheck %s
target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
; Ensure that the dead store is deleted in this case. It is wholely
; overwritten by the second store.
define void @test1(i32 *%V) {
- %V2 = bitcast i32* %V to i8* ; <i8*> [#uses=1]
- store i8 0, i8* %V2
- store i32 1234567, i32* %V
- ret void
; CHECK-LABEL: @test1(
-; CHECK-NEXT: store i32 1234567
+; CHECK-NEXT: store i32 1234567, i32* [[V:%.*]], align 4
+; CHECK-NEXT: ret void
+;
+ %V2 = bitcast i32* %V to i8* ; <i8*> [#uses=1]
+ store i8 0, i8* %V2
+ store i32 1234567, i32* %V
+ ret void
}
; Note that we could do better by merging the two stores into one.
define void @test2(i32* %P) {
; CHECK-LABEL: @test2(
+; CHECK-NEXT: store i32 0, i32* [[P:%.*]], align 4
+; CHECK-NEXT: [[Q:%.*]] = bitcast i32* [[P]] to i16*
+; CHECK-NEXT: store i16 1, i16* [[Q]], align 2
+; CHECK-NEXT: ret void
+;
store i32 0, i32* %P
-; CHECK: store i32
%Q = bitcast i32* %P to i16*
store i16 1, i16* %Q
-; CHECK: store i16
ret void
}
define i32 @test3(double %__x) {
; CHECK-LABEL: @test3(
-; CHECK: store double
+; CHECK-NEXT: [[__U:%.*]] = alloca { [3 x i32] }, align 4
+; CHECK-NEXT: [[TMP_1:%.*]] = bitcast { [3 x i32] }* [[__U]] to double*
+; CHECK-NEXT: store double [[__X:%.*]], double* [[TMP_1]], align 8
+; CHECK-NEXT: [[TMP_4:%.*]] = getelementptr { [3 x i32] }, { [3 x i32] }* [[__U]], i32 0, i32 0, i32 1
+; CHECK-NEXT: [[TMP_5:%.*]] = load i32, i32* [[TMP_4]], align 4
+; CHECK-NEXT: [[TMP_6:%.*]] = icmp slt i32 [[TMP_5]], 0
+; CHECK-NEXT: [[TMP_7:%.*]] = zext i1 [[TMP_6]] to i32
+; CHECK-NEXT: ret i32 [[TMP_7]]
+;
%__u = alloca { [3 x i32] }
%tmp.1 = bitcast { [3 x i32] }* %__u to double*
store double %__x, double* %tmp.1
@@ -40,8 +54,10 @@ define i32 @test3(double %__x) {
; PR6043
define void @test4(i8* %P) {
; CHECK-LABEL: @test4(
-; CHECK-NEXT: bitcast
-; CHECK-NEXT: store double
+; CHECK-NEXT: [[Q:%.*]] = bitcast i8* [[P:%.*]] to double*
+; CHECK-NEXT: store double 0.000000e+00, double* [[Q]], align 8
+; CHECK-NEXT: ret void
+;
store i8 19, i8* %P ;; dead
%A = getelementptr i8, i8* %P, i32 3
@@ -56,6 +72,12 @@ define void @test4(i8* %P) {
; PR8657
declare void @test5a(i32*)
define void @test5(i32 %i) nounwind ssp {
+; CHECK-LABEL: @test5(
+; CHECK-NEXT: [[A:%.*]] = alloca i32, align 4
+; CHECK-NEXT: store i32 20, i32* [[A]], align 4
+; CHECK-NEXT: call void @test5a(i32* [[A]])
+; CHECK-NEXT: ret void
+;
%A = alloca i32
%B = bitcast i32* %A to i8*
%C = getelementptr i8, i8* %B, i32 %i
@@ -64,14 +86,16 @@ define void @test5(i32 %i) nounwind ssp {
call void @test5a(i32* %A)
ret void
-; CHECK-LABEL: @test5(
-; CHECK-NEXT: alloca
-; CHECK-NEXT: store i32 20
-; CHECK-NEXT: call void @test5a
}
declare void @test5a_as1(i32*)
define void @test5_addrspacecast(i32 %i) nounwind ssp {
+; CHECK-LABEL: @test5_addrspacecast(
+; CHECK-NEXT: [[A:%.*]] = alloca i32, align 4
+; CHECK-NEXT: store i32 20, i32* [[A]], align 4
+; CHECK-NEXT: call void @test5a(i32* [[A]])
+; CHECK-NEXT: ret void
+;
%A = alloca i32
%B = addrspacecast i32* %A to i8 addrspace(1)*
%C = getelementptr i8, i8 addrspace(1)* %B, i32 %i
@@ -80,8 +104,4 @@ define void @test5_addrspacecast(i32 %i) nounwind ssp {
call void @test5a(i32* %A)
ret void
-; CHECK-LABEL: @test5_addrspacecast(
-; CHECK-NEXT: alloca
-; CHECK-NEXT: store i32 20
-; CHECK-NEXT: call void @test5a
}
More information about the llvm-commits
mailing list