[llvm] 3ba42a5 - [MemCpyOpt] Add non-local memcpy test with memory phi.
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 18 03:59:31 PST 2022
Author: Florian Hahn
Date: 2022-02-18T11:59:24Z
New Revision: 3ba42a564a9acfd25f30655d68c2e98bba46c7e4
URL: https://github.com/llvm/llvm-project/commit/3ba42a564a9acfd25f30655d68c2e98bba46c7e4
DIFF: https://github.com/llvm/llvm-project/commit/3ba42a564a9acfd25f30655d68c2e98bba46c7e4.diff
LOG: [MemCpyOpt] Add non-local memcpy test with memory phi.
Added:
Modified:
llvm/test/Transforms/MemCpyOpt/nonlocal-memcpy-memcpy.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/MemCpyOpt/nonlocal-memcpy-memcpy.ll b/llvm/test/Transforms/MemCpyOpt/nonlocal-memcpy-memcpy.ll
index 2dbda0c75140c..6d4cde348a550 100644
--- a/llvm/test/Transforms/MemCpyOpt/nonlocal-memcpy-memcpy.ll
+++ b/llvm/test/Transforms/MemCpyOpt/nonlocal-memcpy-memcpy.ll
@@ -170,3 +170,28 @@ bb23: ; preds = %bb22, %bb13
bb25: ; preds = %bb6
unreachable
}
+
+define void @memphi_with_unrelated_clobber(i1 %cond, i64* %arg, i8* noalias %a, i8* noalias %b, i8* noalias %c) {
+; CHECK-LABEL: @memphi_with_unrelated_clobber(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[A:%.*]], i8* [[B:%.*]], i64 16, i1 false)
+; CHECK-NEXT: br i1 [[COND:%.*]], label [[THEN:%.*]], label [[EXIT:%.*]]
+; CHECK: then:
+; CHECK-NEXT: store i64 0, i64* [[ARG:%.*]], align 4
+; CHECK-NEXT: br label [[EXIT]]
+; CHECK: exit:
+; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[C:%.*]], i8* [[B]], i64 16, i1 false)
+; CHECK-NEXT: ret void
+;
+entry:
+ call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* %b, i64 16, i1 false)
+ br i1 %cond, label %then, label %exit
+
+then:
+ store i64 0, i64* %arg
+ br label %exit
+
+exit:
+ call void @llvm.memcpy.p0i8.p0i8.i64(i8* %c, i8* %a, i64 16, i1 false)
+ ret void
+}
More information about the llvm-commits
mailing list