1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=memcpyopt < %s | FileCheck %s
4 declare void @func(ptr %dst)
6 ; The noalias metadata from the call, the load and the store should be merged,
7 ; so that no metadata is left on the call.
8 define i8 @test(ptr writable dereferenceable(1) noalias %dst) {
10 ; CHECK-NEXT: [[TMP:%.*]] = alloca i8, align 1
11 ; CHECK-NEXT: call void @func(ptr nocapture [[DST:%.*]]) #[[ATTR0:[0-9]+]]
12 ; CHECK-NEXT: [[V2:%.*]] = load i8, ptr [[DST]], align 1, !alias.scope !0
13 ; CHECK-NEXT: ret i8 [[V2]]
16 call void @func(ptr nocapture %tmp) nounwind, !noalias !0
17 %v = load i8, ptr %tmp, !noalias !0
18 store i8 %v, ptr %dst, !alias.scope !0
19 %v2 = load i8, ptr %dst, !alias.scope !0