[llvm] fe285ae - [NFC][MemCpyOpt] add test for MemoryAccess crash on D155406
via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 24 09:00:38 PDT 2023
Author: khei4
Date: 2023-08-25T01:00:29+09:00
New Revision: fe285ae091c1f93b2c054d5ee8e8f070fd1acb6b
URL: https://github.com/llvm/llvm-project/commit/fe285ae091c1f93b2c054d5ee8e8f070fd1acb6b
DIFF: https://github.com/llvm/llvm-project/commit/fe285ae091c1f93b2c054d5ee8e8f070fd1acb6b.diff
LOG: [NFC][MemCpyOpt] add test for MemoryAccess crash on D155406
Added:
Modified:
llvm/test/Transforms/MemCpyOpt/stack-move.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/MemCpyOpt/stack-move.ll b/llvm/test/Transforms/MemCpyOpt/stack-move.ll
index 966f6a6eb1ef00..ec5c14ee0a7bf8 100644
--- a/llvm/test/Transforms/MemCpyOpt/stack-move.ll
+++ b/llvm/test/Transforms/MemCpyOpt/stack-move.ll
@@ -572,6 +572,46 @@ bb2:
ret void
}
+; Test for BasicBlock and Instruction mixed dominator finding.
+define void @multi_bb_dom_test0(i1 %b) {
+; CHECK-LABEL: define void @multi_bb_dom_test0
+; CHECK-SAME: (i1 [[B:%.*]]) {
+; CHECK-NEXT: [[SRC:%.*]] = alloca [[STRUCT_FOO:%.*]], align 4
+; CHECK-NEXT: [[DEST:%.*]] = alloca [[STRUCT_FOO]], align 4
+; CHECK-NEXT: br i1 [[B]], label [[BB0:%.*]], label [[BB1:%.*]]
+; CHECK: bb0:
+; CHECK-NEXT: store [[STRUCT_FOO]] { i32 10, i32 20, i32 30 }, ptr [[SRC]], align 4
+; CHECK-NEXT: br label [[BB2:%.*]]
+; CHECK: bb1:
+; CHECK-NEXT: store [[STRUCT_FOO]] { i32 40, i32 50, i32 60 }, ptr [[SRC]], align 4
+; CHECK-NEXT: br label [[BB2]]
+; CHECK: bb2:
+; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 12, ptr nocapture [[DEST]])
+; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[DEST]], ptr align 4 [[SRC]], i64 12, i1 false)
+; CHECK-NEXT: [[TMP1:%.*]] = call i32 @use_nocapture(ptr nocapture noundef [[DEST]])
+; CHECK-NEXT: ret void
+;
+ %src = alloca %struct.Foo, align 4
+ %dest = alloca %struct.Foo, align 4
+ br i1 %b, label %bb0, label %bb1
+
+bb0:
+ store %struct.Foo { i32 10, i32 20, i32 30 }, ptr %src
+ br label %bb2
+
+bb1:
+ store %struct.Foo { i32 40, i32 50, i32 60 }, ptr %src
+ br label %bb2
+
+bb2:
+ call void @llvm.lifetime.start.p0(i64 12, ptr nocapture %dest)
+ call void @llvm.memcpy.p0.p0.i64(ptr align 4 %dest, ptr align 4 %src, i64 12, i1 false); 1
+ %1 = call i32 @use_nocapture(ptr noundef nocapture %dest)
+
+ ret void
+
+}
+
; Test for BasicBlock and Instruction mixed post-dominator finding.
define void @multi_bb_pdom_test0(i1 %b) {
; CHECK-LABEL: define void @multi_bb_pdom_test0
More information about the llvm-commits
mailing list