[llvm] 90ecb9d - [MemCpyOpt][test] add memssa verification on stack-move tests(NFC)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 8 02:59:51 PDT 2023
Author: khei4
Date: 2023-08-08T18:56:59+09:00
New Revision: 90ecb9d5b082e331a569f8c06f85289faa2a5c5f
URL: https://github.com/llvm/llvm-project/commit/90ecb9d5b082e331a569f8c06f85289faa2a5c5f
DIFF: https://github.com/llvm/llvm-project/commit/90ecb9d5b082e331a569f8c06f85289faa2a5c5f.diff
LOG: [MemCpyOpt][test] add memssa verification on stack-move tests(NFC)
Added:
Modified:
llvm/test/Transforms/MemCpyOpt/lifetime-missing.ll
llvm/test/Transforms/MemCpyOpt/stack-move.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/MemCpyOpt/lifetime-missing.ll b/llvm/test/Transforms/MemCpyOpt/lifetime-missing.ll
index 64ef043ca94c7c..ca3f973a83c354 100644
--- a/llvm/test/Transforms/MemCpyOpt/lifetime-missing.ll
+++ b/llvm/test/Transforms/MemCpyOpt/lifetime-missing.ll
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
-; RUN: opt < %s -S -passes=memcpyopt | FileCheck %s
+; RUN: opt < %s -S -passes=memcpyopt -verify-memoryssa | FileCheck %s
; Check that we don't introduce llvm.lifetime.end.
@@ -8,6 +8,7 @@ target triple = "x86_64-grtev4-linux-gnu"
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0
+declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg)
define void @test() {
; CHECK-LABEL: define void @test() {
@@ -15,7 +16,7 @@ define void @test() {
; CHECK-NEXT: [[AGG_TMP3_SROA_35:%.*]] = alloca [20 x i8], align 4
; CHECK-NEXT: [[AGG_TMP_SROA_14:%.*]] = alloca [20 x i8], align 4
; CHECK-NEXT: [[AGG_TMP_SROA_14_128_SROA_IDX:%.*]] = getelementptr i8, ptr [[AGG_TMP_SROA_14]], i64 4
-; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr [[AGG_TMP_SROA_14_128_SROA_IDX]], ptr null, i64 1, i1 false)
+; CHECK-NEXT: call void @llvm.memset.p0.i64(ptr [[AGG_TMP_SROA_14_128_SROA_IDX]], i8 0, i64 1, i1 false)
; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 20, ptr [[AGG_TMP3_SROA_35]])
; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr [[AGG_TMP3_SROA_35]], ptr [[AGG_TMP_SROA_14]], i64 20, i1 false)
; CHECK-NEXT: [[AGG_TMP3_SROA_35_128_SROA_IDX:%.*]] = getelementptr i8, ptr [[AGG_TMP3_SROA_35]], i64 4
@@ -27,7 +28,7 @@ entry:
%agg.tmp3.sroa.35 = alloca [20 x i8], align 4
%agg.tmp.sroa.14 = alloca [20 x i8], align 4
%agg.tmp.sroa.14.128.sroa_idx = getelementptr i8, ptr %agg.tmp.sroa.14, i64 4
- call void @llvm.memcpy.p0.p0.i64(ptr %agg.tmp.sroa.14.128.sroa_idx, ptr null, i64 1, i1 false)
+ call void @llvm.memset.p0.i64(ptr %agg.tmp.sroa.14.128.sroa_idx, i8 0, i64 1, i1 false)
call void @llvm.lifetime.start.p0(i64 20, ptr %agg.tmp3.sroa.35)
call void @llvm.memcpy.p0.p0.i64(ptr %agg.tmp3.sroa.35, ptr %agg.tmp.sroa.14, i64 20, i1 false)
%agg.tmp3.sroa.35.128.sroa_idx = getelementptr i8, ptr %agg.tmp3.sroa.35, i64 4
@@ -41,7 +42,7 @@ declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias
; uselistorder directives
uselistorder i64 4, { 2, 0, 1 }
-uselistorder ptr @llvm.memcpy.p0.p0.i64, { 3, 2, 1, 0 }
+uselistorder ptr @llvm.memcpy.p0.p0.i64, { 2, 1, 0 }
attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
diff --git a/llvm/test/Transforms/MemCpyOpt/stack-move.ll b/llvm/test/Transforms/MemCpyOpt/stack-move.ll
index 5e04c9d330493b..1dded1b1783d63 100644
--- a/llvm/test/Transforms/MemCpyOpt/stack-move.ll
+++ b/llvm/test/Transforms/MemCpyOpt/stack-move.ll
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
-; RUN: opt < %s -passes=memcpyopt -S | FileCheck %s
+; RUN: opt < %s -passes=memcpyopt -verify-memoryssa -S | FileCheck %s
%struct.Foo = type { i32, i32, i32 }
More information about the llvm-commits
mailing list