diff options
author | JF Bastien <jfb@chromium.org> | 2013-07-20 19:35:41 -0700 |
---|---|---|
committer | JF Bastien <jfb@chromium.org> | 2013-07-20 19:35:41 -0700 |
commit | 1856bd7d7cb47f7ae32b7c848a8df5c28281e424 (patch) | |
tree | 5183147b68bd8c70e2975f794f1cf8e9d6a1dc74 /test | |
parent | 58dfde724a201838b40f1314590ec4a1a7f2a601 (diff) |
Remove prefetch
Following our discussion in the related bug, prefetch will not be part of our initial stable ABI.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3531
TEST= cd ./pnacl/build/llvm_x86_64; ninja check
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/19771015
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/NaCl/rewrite-flt-rounds.ll | 2 | ||||
-rw-r--r-- | test/Transforms/NaCl/rewrite-prefetch.ll | 35 |
2 files changed, 36 insertions, 1 deletions
diff --git a/test/Transforms/NaCl/rewrite-flt-rounds.ll b/test/Transforms/NaCl/rewrite-flt-rounds.ll index 3c368b8bc3..cb1a7e4a99 100644 --- a/test/Transforms/NaCl/rewrite-flt-rounds.ll +++ b/test/Transforms/NaCl/rewrite-flt-rounds.ll @@ -1,6 +1,6 @@ ; RUN: opt < %s -rewrite-llvm-intrinsic-calls -S | FileCheck %s ; RUN: opt < %s -rewrite-llvm-intrinsic-calls -S | FileCheck %s -check-prefix=CLEANED -; Test the RewriteLLVMIntrinsics pass +; Test the @llvm.flt.rounds part of the RewriteLLVMIntrinsics pass declare i32 @llvm.flt.rounds() diff --git a/test/Transforms/NaCl/rewrite-prefetch.ll b/test/Transforms/NaCl/rewrite-prefetch.ll new file mode 100644 index 0000000000..d498c2012e --- /dev/null +++ b/test/Transforms/NaCl/rewrite-prefetch.ll @@ -0,0 +1,35 @@ +; RUN: opt < %s -rewrite-llvm-intrinsic-calls -S | FileCheck %s +; RUN: opt < %s -rewrite-llvm-intrinsic-calls -S | FileCheck %s -check-prefix=CLEANED +; Test the @llvm.prefetch part of the RewriteLLVMIntrinsics pass + +declare void @llvm.prefetch(i8 *%ptr, i32 %rw, i32 %locality, i32 %cache_type) + +; No declaration or definition of llvm.prefetch() should remain. +; CLEANED-NOT: @llvm.prefetch + +define void @call_prefetch(i8 *%ptr, i32 %rw, i32 %locality, i32 %cache_type) { +; CHECK: call_prefetch +; CHECK-NEXT: ret void + call void @llvm.prefetch(i8 *%ptr, i32 %rw, i32 %locality, i32 %cache_type) + ret void +} + +; A more complex example with a number of calls in several BBs. +define void @multiple_calls(i8 *%ptr, i32 %rw, i32 %locality, i32 %cache_type) { +; CHECK: multiple_calls +entryblock: +; CHECK: entryblock +; CHECK-NEXT: br + call void @llvm.prefetch(i8 *%ptr, i32 %rw, i32 %locality, i32 %cache_type) + br label %block1 +block1: +; CHECK: block1: +; CHECK-NEXT: br + call void @llvm.prefetch(i8 *%ptr, i32 %rw, i32 %locality, i32 %cache_type) + br label %exitblock +exitblock: +; CHECK: exitblock: +; CHECK-NEXT: ret void + call void @llvm.prefetch(i8 *%ptr, i32 %rw, i32 %locality, i32 %cache_type) + ret void +} |