[PATCH] D64322: [WebAssembly] Add support for llvm.clear_cache intrinsic
Dan Gohman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 8 21:15:35 PDT 2019
sunfish added a comment.
The actual compiler crash here came from the fact that we don't have an entry for llvm.clear_cache in the builtin function signature table. Suppose we added a signature for it. Then, we'd get LLVM's and compiler-rt's default behavior, which would be to call `__clear_cache`, and ultimately just abort at runtime <https://github.com/llvm/llvm-project/blob/master/compiler-rt/lib/builtins/clear_cache.c#L181>.
So, what if we do `report_fatal_error("llvm.clear_cache is not supported on wasm");` from within `getClearCacheBuiltinName`? That's friendlier than aborting at runtime at least.
I think of wasm as being at the opposite end of the spectrum from x86 in this area. When you write to memory:
- x86: you can execute it immediately, given the right permissions
- arm: you can't execute it until you flush the cache
- wasm: you can't execute it ever
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64322/new/
https://reviews.llvm.org/D64322
More information about the llvm-commits
mailing list