[llvm] 8922adf - [Orc] Honor hasJIT in JITTargetMachineBuilder::createTargetMachine
Rainer Orth via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 14 23:21:24 PDT 2022
Author: Rainer Orth
Date: 2022-07-15T08:20:57+02:00
New Revision: 8922adf646eead207fb367dace80bba2abfab2ad
URL: https://github.com/llvm/llvm-project/commit/8922adf646eead207fb367dace80bba2abfab2ad
DIFF: https://github.com/llvm/llvm-project/commit/8922adf646eead207fb367dace80bba2abfab2ad.diff
LOG: [Orc] Honor hasJIT in JITTargetMachineBuilder::createTargetMachine
Even with D129349 <https://reviews.llvm.org/D129349>, various SPARC JIT
tests still `FAIL`. They are guarded by `host-supports-jit`. This is set
from `clang-repl --host-supports-jit` which still returns `true`. It turns
out the `JITTargetMachineBuilder` doesn't consider `hasJIT` at all.
This patch corrects this, turning the affected tests `UNSUPPORTED`.
Tested on `sparcv9-sun-solaris2.11`.
Differential Revision: https://reviews.llvm.org/D129350
Added:
Modified:
llvm/lib/ExecutionEngine/Orc/JITTargetMachineBuilder.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ExecutionEngine/Orc/JITTargetMachineBuilder.cpp b/llvm/lib/ExecutionEngine/Orc/JITTargetMachineBuilder.cpp
index c60f4b3b263c0..70a3c404d8366 100644
--- a/llvm/lib/ExecutionEngine/Orc/JITTargetMachineBuilder.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/JITTargetMachineBuilder.cpp
@@ -48,6 +48,10 @@ JITTargetMachineBuilder::createTargetMachine() {
if (!TheTarget)
return make_error<StringError>(std::move(ErrMsg), inconvertibleErrorCode());
+ if (!TheTarget->hasJIT())
+ return make_error<StringError>("Target has no JIT support",
+ inconvertibleErrorCode());
+
auto *TM =
TheTarget->createTargetMachine(TT.getTriple(), CPU, Features.getString(),
Options, RM, CM, OptLevel, /*JIT*/ true);
More information about the llvm-commits
mailing list