xref: /llvm-project/llvm/test/Analysis/BasicAA/intrinsics-arm.ll (revision 3caf301a8be1ebeed466f998bf2b21497f6df760)
1; RUN: opt -aa-pipeline=basic-aa -passes=gvn -S < %s | FileCheck %s
2; REQUIRES: arm-registered-target
3
4target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:32:64-v128:32:128-a0:0:32-n32"
5
6; BasicAA should prove that these calls don't interfere, since we've
7; specifically special cased exactly these two intrinsics in
8; MemoryLocation::getForArgument.
9
10; CHECK:      define <8 x i16> @test1(ptr %p, <8 x i16> %y) {
11; CHECK-NEXT: entry:
12; CHECK-NEXT:   %q = getelementptr i8, ptr %p, i64 16
13; CHECK-NEXT:   %a = call <8 x i16> @llvm.arm.neon.vld1.v8i16.p0(ptr %p, i32 16) [[ATTR:#[0-9]+]]
14; CHECK-NEXT:   call void @llvm.arm.neon.vst1.p0.v8i16(ptr %q, <8 x i16> %y, i32 16)
15; CHECK-NEXT:   %c = add <8 x i16> %a, %a
16define <8 x i16> @test1(ptr %p, <8 x i16> %y) {
17entry:
18  %q = getelementptr i8, ptr %p, i64 16
19  %a = call <8 x i16> @llvm.arm.neon.vld1.v8i16.p0(ptr %p, i32 16) nounwind
20  call void @llvm.arm.neon.vst1.p0.v8i16(ptr %q, <8 x i16> %y, i32 16)
21  %b = call <8 x i16> @llvm.arm.neon.vld1.v8i16.p0(ptr %p, i32 16) nounwind
22  %c = add <8 x i16> %a, %b
23  ret <8 x i16> %c
24}
25
26declare <8 x i16> @llvm.arm.neon.vld1.v8i16.p0(ptr, i32) nounwind readonly
27declare void @llvm.arm.neon.vst1.p0.v8i16(ptr, <8 x i16>, i32) nounwind
28
29; CHECK: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
30; CHECK: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
31; CHECK: attributes [[ATTR]] = { nounwind }
32