[PATCH] D129350: [Orc] Honor hasJIT in JITTargetMachineBuilder::createTargetMachine
Rainer Orth via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 8 00:37:24 PDT 2022
ro created this revision.
ro added a reviewer: lhames.
Herald added subscribers: StephenFan, fedor.sergeev, hiraditya, jyknight.
Herald added a project: All.
ro requested review of this revision.
Herald added a project: LLVM.
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`.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D129350
Files:
llvm/lib/ExecutionEngine/Orc/JITTargetMachineBuilder.cpp
Index: llvm/lib/ExecutionEngine/Orc/JITTargetMachineBuilder.cpp
===================================================================
--- llvm/lib/ExecutionEngine/Orc/JITTargetMachineBuilder.cpp
+++ llvm/lib/ExecutionEngine/Orc/JITTargetMachineBuilder.cpp
@@ -48,6 +48,10 @@
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);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129350.443156.patch
Type: text/x-patch
Size: 710 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220708/6baafaac/attachment.bin>
More information about the llvm-commits
mailing list