[llvm-branch-commits] [llvm] 78d201e - [MemCpyOpt] Add test for #67539 (NFC)

Tobias Hieta via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Sep 28 23:26:37 PDT 2023


Author: Nikita Popov
Date: 2023-09-29T08:24:42+02:00
New Revision: 78d201ebc3e2ee3c20db961e68bdaf7924b5c2fe

URL: https://github.com/llvm/llvm-project/commit/78d201ebc3e2ee3c20db961e68bdaf7924b5c2fe
DIFF: https://github.com/llvm/llvm-project/commit/78d201ebc3e2ee3c20db961e68bdaf7924b5c2fe.diff

LOG: [MemCpyOpt] Add test for #67539 (NFC)

(cherry picked from commit d5c8b23b1ee1dcb6922e8226143410840edabe50)

Added: 
    

Modified: 
    llvm/test/Transforms/MemCpyOpt/memcpy.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/MemCpyOpt/memcpy.ll b/llvm/test/Transforms/MemCpyOpt/memcpy.ll
index 412ffd5d53e0ec3..d7475e7f5ea5913 100644
--- a/llvm/test/Transforms/MemCpyOpt/memcpy.ll
+++ b/llvm/test/Transforms/MemCpyOpt/memcpy.ll
@@ -694,3 +694,20 @@ define void @immut_valid_align_branched(i1 %c, ptr noalias align 4 %val) {
   call void @f(ptr nocapture noalias readonly %val3)
   ret void
 }
+
+; FIXME: This is a miscompile.
+define void @immut_param_noalias_metadata(ptr align 4 byval(i32) %ptr) {
+; CHECK-LABEL: @immut_param_noalias_metadata(
+; CHECK-NEXT:    call void @f(ptr noalias nocapture readonly [[PTR:%.*]]), !alias.scope !0
+; CHECK-NEXT:    ret void
+;
+  %tmp = alloca i32, align 4
+  store i32 1, ptr %ptr, !noalias !2
+  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %tmp, ptr align 4 %ptr, i64 4, i1 false)
+  call void @f(ptr nocapture noalias readonly %tmp), !alias.scope !2
+  ret void
+}
+
+!0 = !{!0}
+!1 = !{!1, !0}
+!2 = !{!1}


        


More information about the llvm-branch-commits mailing list