[llvm] [MemCpyOpt] Combine alias metadatas when replacing byval arguments (PR #70580)
Kohei Asano via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 28 20:56:54 PDT 2023
================
@@ -709,6 +710,22 @@ define void @immut_param_noalias_metadata(ptr align 4 byval(i32) %ptr) {
ret void
}
+define void @byval_param_noalias_metadata(ptr align 4 byval(i32) %ptr) {
+; CHECK-LABEL: @byval_param_noalias_metadata(
+; CHECK-NEXT: store i32 1, ptr [[PTR:%.*]], align 4, !noalias !3
+; CHECK-NEXT: call void @f_byval(ptr byval(i32) align 4 [[PTR]])
+; CHECK-NEXT: ret void
+;
+ %tmp = alloca i32, align 4
+ store i32 1, ptr %ptr, !noalias !5
+ call void @llvm.memcpy.p0.p0.i64(ptr align 4 %tmp, ptr align 4 %ptr, i64 4, i1 false)
+ call void @f_byval(ptr align 4 byval(i32) %tmp), !alias.scope !5
+ ret void
+}
+
!0 = !{!0}
!1 = !{!1, !0}
!2 = !{!1}
+!3 = !{!3}
+!4 = !{!4, !3}
+!5 = !{!4}
----------------
khei4 wrote:
nits: Can we reuse the above !2 for the case we are focusing on noalias arguments?
https://github.com/llvm/llvm-project/pull/70580
More information about the llvm-commits
mailing list