Skip to content

Commit

Permalink
[MemCpyOpt] Add test for llvm#67539 (NFC)
Browse files Browse the repository at this point in the history
(cherry picked from commit d5c8b23)
  • Loading branch information
nikic authored and tru committed Sep 29, 2023
1 parent e718f32 commit 78d201e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions llvm/test/Transforms/MemCpyOpt/memcpy.ll
Original file line number Diff line number Diff line change
Expand Up @@ -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}

0 comments on commit 78d201e

Please sign in to comment.