[llvm] a4e2c1f - [Orc][LLJIT] Use JITLink on RISC-V

Jonas Hahnfeld via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 4 14:10:22 PDT 2022


Author: Jonas Hahnfeld
Date: 2022-07-04T23:09:38+02:00
New Revision: a4e2c1f762959b18f185cec4fd30d9ba982d4af5

URL: https://github.com/llvm/llvm-project/commit/a4e2c1f762959b18f185cec4fd30d9ba982d4af5
DIFF: https://github.com/llvm/llvm-project/commit/a4e2c1f762959b18f185cec4fd30d9ba982d4af5.diff

LOG: [Orc][LLJIT] Use JITLink on RISC-V

RuntimeDyld does not support RISC-V, so it makes sense to enable
JITLink by default. This also makes relocations work without support
for a large code model.

Differential Revision: https://reviews.llvm.org/D129092

Added: 
    

Modified: 
    llvm/lib/ExecutionEngine/Orc/LLJIT.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp b/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
index 6d67e6d87b56f..1926ef1ecc72b 100644
--- a/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
@@ -666,8 +666,9 @@ Error LLJITBuilderState::prepareForConstruction() {
   // JIT linker.
   if (!CreateObjectLinkingLayer) {
     auto &TT = JTMB->getTargetTriple();
-    if (TT.isOSBinFormatMachO() &&
-        (TT.getArch() == Triple::aarch64 || TT.getArch() == Triple::x86_64)) {
+    if (TT.getArch() == Triple::riscv64 ||
+        (TT.isOSBinFormatMachO() &&
+         (TT.getArch() == Triple::aarch64 || TT.getArch() == Triple::x86_64))) {
 
       JTMB->setRelocationModel(Reloc::PIC_);
       JTMB->setCodeModel(CodeModel::Small);


        


More information about the llvm-commits mailing list