Dan Gohman | 39b3a1e | 2011-04-27 18:39:03 +0000 | [diff] [blame] | 1 | ; RUN: opt -basicaa -gvn -S < %s | FileCheck %s |
| 2 | |
| 3 | target 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 Bogner | b713266 | 2017-05-13 00:12:52 +0000 | [diff] [blame] | 8 | ; 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 Gohman | 39b3a1e | 2011-04-27 18:39:03 +0000 | [diff] [blame] | 9 | ; CHECK-NEXT: entry: |
Justin Bogner | b713266 | 2017-05-13 00:12:52 +0000 | [diff] [blame] | 10 | ; 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 Gohman | 39b3a1e | 2011-04-27 18:39:03 +0000 | [diff] [blame] | 12 | ; CHECK-NEXT: %c = add <8 x i16> %a, %a |
Justin Bogner | b713266 | 2017-05-13 00:12:52 +0000 | [diff] [blame] | 13 | 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 Gohman | 39b3a1e | 2011-04-27 18:39:03 +0000 | [diff] [blame] | 14 | entry: |
Justin Bogner | b713266 | 2017-05-13 00:12:52 +0000 | [diff] [blame] | 15 | %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 Gohman | 39b3a1e | 2011-04-27 18:39:03 +0000 | [diff] [blame] | 18 | %c = add <8 x i16> %a, %b |
| 19 | ret <8 x i16> %c |
| 20 | } |
| 21 | |
Justin Bogner | b713266 | 2017-05-13 00:12:52 +0000 | [diff] [blame] | 22 | declare <8 x i16> @llvm.masked.load.v8i16.p0v8i16(<8 x i16>*, i32, <8 x i1>, <8 x i16>) nounwind readonly |
| 23 | declare void @llvm.masked.store.v8i16.p0v8i16(<8 x i16>, <8 x i16>*, i32, <8 x i1>) nounwind |
Bill Wendling | 90bc19c | 2013-02-20 07:21:42 +0000 | [diff] [blame] | 24 | |
Akira Hatanaka | 5dda592 | 2015-11-11 02:11:46 +0000 | [diff] [blame] | 25 | ; CHECK: attributes #0 = { argmemonly nounwind readonly } |
| 26 | ; CHECK: attributes #1 = { argmemonly nounwind } |
Bill Wendling | a032374 | 2013-02-22 09:09:42 +0000 | [diff] [blame] | 27 | ; CHECK: attributes [[ATTR]] = { nounwind } |