[compiler-rt] r322928 - [builtins] Use FlushInstructionCache on windows on aarch64 as well
Martin Storsjo via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 18 23:34:46 PST 2018
Author: mstorsjo
Date: Thu Jan 18 23:34:46 2018
New Revision: 322928
URL: http://llvm.org/viewvc/llvm-project?rev=322928&view=rev
Log:
[builtins] Use FlushInstructionCache on windows on aarch64 as well
Generalize this handling to a separate toplevel ifdef (since any
windows case should use the same function), instead of indenting
the aarch64 case one step further.
Differential Revision: https://reviews.llvm.org/D42197
Modified:
compiler-rt/trunk/lib/builtins/clear_cache.c
Modified: compiler-rt/trunk/lib/builtins/clear_cache.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/clear_cache.c?rev=322928&r1=322927&r2=322928&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/clear_cache.c (original)
+++ compiler-rt/trunk/lib/builtins/clear_cache.c Thu Jan 18 23:34:46 2018
@@ -96,6 +96,8 @@ void __clear_cache(void *start, void *en
* Intel processors have a unified instruction and data cache
* so there is nothing to do
*/
+#elif defined(_WIN32) && (defined(__arm__) || defined(__aarch64__))
+ FlushInstructionCache(GetCurrentProcess(), start, end - start);
#elif defined(__arm__) && !defined(__APPLE__)
#if defined(__FreeBSD__) || defined(__NetBSD__)
struct arm_sync_icache_args arg;
@@ -123,8 +125,6 @@ void __clear_cache(void *start, void *en
: "r"(syscall_nr), "r"(start_reg), "r"(end_reg),
"r"(flags));
assert(start_reg == 0 && "Cache flush syscall failed.");
- #elif defined(_WIN32)
- FlushInstructionCache(GetCurrentProcess(), start, end - start);
#else
compilerrt_abort();
#endif
More information about the llvm-commits
mailing list