brintos

brintos / llvm-project-archived public Read only

0
0
Text · 878 B · 9948d3d Raw
27 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -S -passes=memcpyopt < %s | FileCheck %s3 4declare void @func(ptr %dst)5 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.8define i8 @test(ptr writable dereferenceable(1) noalias %dst) {9; CHECK-LABEL: @test(10; CHECK-NEXT:    [[TMP:%.*]] = alloca i8, align 111; CHECK-NEXT:    call void @func(ptr captures(none) [[DST:%.*]]) #[[ATTR0:[0-9]+]]12; CHECK-NEXT:    [[V2:%.*]] = load i8, ptr [[DST]], align 1, !alias.scope [[META0:![0-9]+]]13; CHECK-NEXT:    ret i8 [[V2]]14;15  %tmp = alloca i816  call void @func(ptr nocapture %tmp) nounwind, !noalias !017  %v = load i8, ptr %tmp, !noalias !018  store i8 %v, ptr %dst, !alias.scope !019  %v2 = load i8, ptr %dst, !alias.scope !020  ret i8 %v221}22 23!0 = !{!1}24!1 = !{!1, !2}25!2 = !{!2}26 27