blob: 68e59862bcc1fff3ceabad3fc58b9e7e2f70dd93 [file] [log] [blame]
Dan Gohman39b3a1e2011-04-27 18:39:03 +00001; RUN: opt -basicaa -gvn -S < %s | FileCheck %s
2
3target 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"
4
5; BasicAA should prove that these calls don't interfere, since they are
6; IntrArgReadMem and have noalias pointers.
7
Justin Bognerb7132662017-05-13 00:12:52 +00008; CHECK: define <8 x i16> @test0(<8 x i16>* noalias %p, <8 x i16>* noalias %q, <8 x i16> %y, <8 x i1> %m, <8 x i16> %pt) {
Dan Gohman39b3a1e2011-04-27 18:39:03 +00009; CHECK-NEXT: entry:
Justin Bognerb7132662017-05-13 00:12:52 +000010; CHECK-NEXT: %a = call <8 x i16> @llvm.masked.load.v8i16.p0v8i16(<8 x i16>* %p, i32 16, <8 x i1> %m, <8 x i16> %pt) [[ATTR:#[0-9]+]]
11; CHECK-NEXT: call void @llvm.masked.store.v8i16.p0v8i16(<8 x i16> %y, <8 x i16>* %q, i32 16, <8 x i1> %m)
Dan Gohman39b3a1e2011-04-27 18:39:03 +000012; CHECK-NEXT: %c = add <8 x i16> %a, %a
Justin Bognerb7132662017-05-13 00:12:52 +000013define <8 x i16> @test0(<8 x i16>* noalias %p, <8 x i16>* noalias %q, <8 x i16> %y, <8 x i1> %m, <8 x i16> %pt) {
Dan Gohman39b3a1e2011-04-27 18:39:03 +000014entry:
Justin Bognerb7132662017-05-13 00:12:52 +000015 %a = call <8 x i16> @llvm.masked.load.v8i16.p0v8i16(<8 x i16>* %p, i32 16, <8 x i1> %m, <8 x i16> %pt) nounwind
16 call void @llvm.masked.store.v8i16.p0v8i16(<8 x i16> %y, <8 x i16>* %q, i32 16, <8 x i1> %m)
17 %b = call <8 x i16> @llvm.masked.load.v8i16.p0v8i16(<8 x i16>* %p, i32 16, <8 x i1> %m, <8 x i16> %pt) nounwind
Dan Gohman39b3a1e2011-04-27 18:39:03 +000018 %c = add <8 x i16> %a, %b
19 ret <8 x i16> %c
20}
21
Justin Bognerb7132662017-05-13 00:12:52 +000022declare <8 x i16> @llvm.masked.load.v8i16.p0v8i16(<8 x i16>*, i32, <8 x i1>, <8 x i16>) nounwind readonly
23declare void @llvm.masked.store.v8i16.p0v8i16(<8 x i16>, <8 x i16>*, i32, <8 x i1>) nounwind
Bill Wendling90bc19c2013-02-20 07:21:42 +000024
Akira Hatanaka5dda5922015-11-11 02:11:46 +000025; CHECK: attributes #0 = { argmemonly nounwind readonly }
26; CHECK: attributes #1 = { argmemonly nounwind }
Bill Wendlinga0323742013-02-22 09:09:42 +000027; CHECK: attributes [[ATTR]] = { nounwind }