From 6b33cfc6bba0b1cac7e02b52a00824a3bc06d36e Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 8 Oct 2007 21:15:07 +0000 Subject: [PATCH] Mark the prefetch intrinsic as IntrWriteArgMem, instead of the default of IntrWriteMem, to at least indicate that it doesn't "capture" the argument pointer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42768 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Intrinsics.td | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/llvm/Intrinsics.td b/include/llvm/Intrinsics.td index ef4f0961ed5..6b6b0f51d13 100644 --- a/include/llvm/Intrinsics.td +++ b/include/llvm/Intrinsics.td @@ -153,8 +153,12 @@ def int_stacksave : Intrinsic<[llvm_ptr_ty], [IntrReadMem]>, GCCBuiltin<"__builtin_stack_save">; def int_stackrestore : Intrinsic<[llvm_void_ty, llvm_ptr_ty]>, GCCBuiltin<"__builtin_stack_restore">; +// IntrWriteArgMem is more pessimistic than strictly necessary for prefetch, +// however it does conveniently prevent the prefetch from being reordered +// with respect to nearby accesses to the same memory. def int_prefetch : Intrinsic<[llvm_void_ty, llvm_ptr_ty, - llvm_i32_ty, llvm_i32_ty]>; + llvm_i32_ty, llvm_i32_ty], + [IntrWriteArgMem]>; def int_pcmarker : Intrinsic<[llvm_void_ty, llvm_i32_ty]>; def int_readcyclecounter : Intrinsic<[llvm_i64_ty]>; -- 2.34.1