]> granicus.if.org Git - llvm/commitdiff
[Orc][lli] Add a very simple Orc-based lazy JIT to lli.
authorLang Hames <lhames@gmail.com>
Wed, 25 Mar 2015 12:11:48 +0000 (12:11 +0000)
committerLang Hames <lhames@gmail.com>
Wed, 25 Mar 2015 12:11:48 +0000 (12:11 +0000)
This ensures that we're building and testing the CompileOnDemand layer, at least
in a basic way.

Currently x86-64 only, and with limited to no library calls enabled (depending
on host platform). Patches welcome. ;)

To enable access to the lazy JIT, this patch replaces the '-use-orcmcjit' lli
option with a new option:
'-jit-kind={ mcjit | orc-mcjit | orc-lazy }'.

All regression tests are updated to use the new option, and one trivial test of
the new lazy JIT is added.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233182 91177308-0d34-0410-b5e6-96231b3b80d8

103 files changed:
include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
test/ExecutionEngine/OrcJIT/multi-module-a.ll [deleted file]
test/ExecutionEngine/OrcJIT/multi-module-sm-pic-a.ll [deleted file]
test/ExecutionEngine/OrcJIT/remote/cross-module-a.ll [deleted file]
test/ExecutionEngine/OrcJIT/remote/cross-module-sm-pic-a.ll [deleted file]
test/ExecutionEngine/OrcJIT/remote/multi-module-a.ll [deleted file]
test/ExecutionEngine/OrcJIT/remote/multi-module-sm-pic-a.ll [deleted file]
test/ExecutionEngine/OrcJIT/simplesttest.ll [deleted file]
test/ExecutionEngine/OrcLazy/lit.local.cfg [new file with mode: 0644]
test/ExecutionEngine/OrcLazy/trivial_retval_1.ll [new file with mode: 0644]
test/ExecutionEngine/OrcMCJIT/2002-12-16-ArgTest.ll [moved from test/ExecutionEngine/OrcJIT/2002-12-16-ArgTest.ll with 96% similarity]
test/ExecutionEngine/OrcMCJIT/2003-01-04-ArgumentBug.ll [moved from test/ExecutionEngine/OrcJIT/2003-01-04-ArgumentBug.ll with 86% similarity]
test/ExecutionEngine/OrcMCJIT/2003-01-04-LoopTest.ll [moved from test/ExecutionEngine/OrcJIT/2003-01-04-LoopTest.ll with 91% similarity]
test/ExecutionEngine/OrcMCJIT/2003-01-04-PhiTest.ll [moved from test/ExecutionEngine/OrcJIT/2003-01-04-PhiTest.ll with 81% similarity]
test/ExecutionEngine/OrcMCJIT/2003-01-09-SARTest.ll [moved from test/ExecutionEngine/OrcJIT/2003-01-09-SARTest.ll with 83% similarity]
test/ExecutionEngine/OrcMCJIT/2003-01-10-FUCOM.ll [moved from test/ExecutionEngine/OrcJIT/2003-01-10-FUCOM.ll with 85% similarity]
test/ExecutionEngine/OrcMCJIT/2003-01-15-AlignmentTest.ll [moved from test/ExecutionEngine/OrcJIT/2003-01-15-AlignmentTest.ll with 89% similarity]
test/ExecutionEngine/OrcMCJIT/2003-05-06-LivenessClobber.ll [moved from test/ExecutionEngine/OrcJIT/2003-05-06-LivenessClobber.ll with 90% similarity]
test/ExecutionEngine/OrcMCJIT/2003-05-07-ArgumentTest.ll [moved from test/ExecutionEngine/OrcJIT/2003-05-07-ArgumentTest.ll with 86% similarity]
test/ExecutionEngine/OrcMCJIT/2003-05-11-PHIRegAllocBug.ll [moved from test/ExecutionEngine/OrcJIT/2003-05-11-PHIRegAllocBug.ll with 84% similarity]
test/ExecutionEngine/OrcMCJIT/2003-06-04-bzip2-bug.ll [moved from test/ExecutionEngine/OrcJIT/2003-06-04-bzip2-bug.ll with 90% similarity]
test/ExecutionEngine/OrcMCJIT/2003-06-05-PHIBug.ll [moved from test/ExecutionEngine/OrcJIT/2003-06-05-PHIBug.ll with 86% similarity]
test/ExecutionEngine/OrcMCJIT/2003-08-15-AllocaAssertion.ll [moved from test/ExecutionEngine/OrcJIT/2003-08-15-AllocaAssertion.ll with 83% similarity]
test/ExecutionEngine/OrcMCJIT/2003-08-21-EnvironmentTest.ll [moved from test/ExecutionEngine/OrcJIT/2003-08-21-EnvironmentTest.ll with 90% similarity]
test/ExecutionEngine/OrcMCJIT/2003-08-23-RegisterAllocatePhysReg.ll [moved from test/ExecutionEngine/OrcJIT/2003-08-23-RegisterAllocatePhysReg.ll with 95% similarity]
test/ExecutionEngine/OrcMCJIT/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll [moved from test/ExecutionEngine/OrcJIT/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll with 92% similarity]
test/ExecutionEngine/OrcMCJIT/2005-12-02-TailCallBug.ll [moved from test/ExecutionEngine/OrcJIT/2005-12-02-TailCallBug.ll with 95% similarity]
test/ExecutionEngine/OrcMCJIT/2007-12-10-APIntLoadStore.ll [moved from test/ExecutionEngine/OrcJIT/2007-12-10-APIntLoadStore.ll with 91% similarity]
test/ExecutionEngine/OrcMCJIT/2008-06-05-APInt-OverAShr.ll [moved from test/ExecutionEngine/OrcJIT/2008-06-05-APInt-OverAShr.ll with 96% similarity]
test/ExecutionEngine/OrcMCJIT/2013-04-04-RelocAddend.ll [moved from test/ExecutionEngine/OrcJIT/2013-04-04-RelocAddend.ll with 92% similarity]
test/ExecutionEngine/OrcMCJIT/Inputs/cross-module-b.ll [moved from test/ExecutionEngine/OrcJIT/Inputs/cross-module-b.ll with 100% similarity]
test/ExecutionEngine/OrcMCJIT/Inputs/multi-module-b.ll [moved from test/ExecutionEngine/OrcJIT/Inputs/multi-module-b.ll with 100% similarity]
test/ExecutionEngine/OrcMCJIT/Inputs/multi-module-c.ll [moved from test/ExecutionEngine/OrcJIT/Inputs/multi-module-c.ll with 100% similarity]
test/ExecutionEngine/OrcMCJIT/Inputs/multi-module-eh-b.ll [moved from test/ExecutionEngine/OrcJIT/Inputs/multi-module-eh-b.ll with 100% similarity]
test/ExecutionEngine/OrcMCJIT/cross-module-a.ll [moved from test/ExecutionEngine/OrcJIT/cross-module-a.ll with 60% similarity]
test/ExecutionEngine/OrcMCJIT/cross-module-sm-pic-a.ll [moved from test/ExecutionEngine/OrcJIT/cross-module-sm-pic-a.ll with 55% similarity]
test/ExecutionEngine/OrcMCJIT/eh-lg-pic.ll [moved from test/ExecutionEngine/OrcJIT/eh-lg-pic.ll with 92% similarity]
test/ExecutionEngine/OrcMCJIT/eh-sm-pic.ll [moved from test/ExecutionEngine/OrcJIT/eh-sm-pic.ll with 92% similarity]
test/ExecutionEngine/OrcMCJIT/eh.ll [moved from test/ExecutionEngine/OrcJIT/eh.ll with 96% similarity]
test/ExecutionEngine/OrcMCJIT/fpbitcast.ll [moved from test/ExecutionEngine/OrcJIT/fpbitcast.ll with 86% similarity]
test/ExecutionEngine/OrcMCJIT/hello-sm-pic.ll [moved from test/ExecutionEngine/OrcJIT/hello-sm-pic.ll with 77% similarity]
test/ExecutionEngine/OrcMCJIT/hello.ll [moved from test/ExecutionEngine/OrcJIT/hello.ll with 84% similarity]
test/ExecutionEngine/OrcMCJIT/hello2.ll [moved from test/ExecutionEngine/OrcJIT/hello2.ll with 86% similarity]
test/ExecutionEngine/OrcMCJIT/lit.local.cfg [moved from test/ExecutionEngine/OrcJIT/lit.local.cfg with 100% similarity]
test/ExecutionEngine/OrcMCJIT/load-object-a.ll [moved from test/ExecutionEngine/OrcJIT/load-object-a.ll with 64% similarity]
test/ExecutionEngine/OrcMCJIT/multi-module-a.ll [new file with mode: 0644]
test/ExecutionEngine/OrcMCJIT/multi-module-eh-a.ll [moved from test/ExecutionEngine/OrcJIT/multi-module-eh-a.ll with 92% similarity]
test/ExecutionEngine/OrcMCJIT/multi-module-sm-pic-a.ll [new file with mode: 0644]
test/ExecutionEngine/OrcMCJIT/non-extern-addend.ll [moved from test/ExecutionEngine/OrcJIT/non-extern-addend.ll with 92% similarity]
test/ExecutionEngine/OrcMCJIT/pr13727.ll [moved from test/ExecutionEngine/OrcJIT/pr13727.ll with 97% similarity]
test/ExecutionEngine/OrcMCJIT/remote/Inputs/cross-module-b.ll [moved from test/ExecutionEngine/OrcJIT/remote/Inputs/cross-module-b.ll with 100% similarity]
test/ExecutionEngine/OrcMCJIT/remote/Inputs/multi-module-b.ll [moved from test/ExecutionEngine/OrcJIT/remote/Inputs/multi-module-b.ll with 100% similarity]
test/ExecutionEngine/OrcMCJIT/remote/Inputs/multi-module-c.ll [moved from test/ExecutionEngine/OrcJIT/remote/Inputs/multi-module-c.ll with 100% similarity]
test/ExecutionEngine/OrcMCJIT/remote/cross-module-a.ll [new file with mode: 0644]
test/ExecutionEngine/OrcMCJIT/remote/cross-module-sm-pic-a.ll [new file with mode: 0644]
test/ExecutionEngine/OrcMCJIT/remote/lit.local.cfg [moved from test/ExecutionEngine/OrcJIT/remote/lit.local.cfg with 100% similarity]
test/ExecutionEngine/OrcMCJIT/remote/multi-module-a.ll [new file with mode: 0644]
test/ExecutionEngine/OrcMCJIT/remote/multi-module-sm-pic-a.ll [new file with mode: 0644]
test/ExecutionEngine/OrcMCJIT/remote/simpletest-remote.ll [moved from test/ExecutionEngine/OrcJIT/remote/simpletest-remote.ll with 54% similarity]
test/ExecutionEngine/OrcMCJIT/remote/stubs-remote.ll [moved from test/ExecutionEngine/OrcJIT/remote/stubs-remote.ll with 88% similarity]
test/ExecutionEngine/OrcMCJIT/remote/stubs-sm-pic.ll [moved from test/ExecutionEngine/OrcJIT/remote/stubs-sm-pic.ll with 88% similarity]
test/ExecutionEngine/OrcMCJIT/remote/test-common-symbols-remote.ll [moved from test/ExecutionEngine/OrcJIT/remote/test-common-symbols-remote.ll with 95% similarity]
test/ExecutionEngine/OrcMCJIT/remote/test-data-align-remote.ll [moved from test/ExecutionEngine/OrcJIT/remote/test-data-align-remote.ll with 74% similarity]
test/ExecutionEngine/OrcMCJIT/remote/test-fp-no-external-funcs-remote.ll [moved from test/ExecutionEngine/OrcJIT/remote/test-fp-no-external-funcs-remote.ll with 86% similarity]
test/ExecutionEngine/OrcMCJIT/remote/test-global-init-nonzero-remote.ll [moved from test/ExecutionEngine/OrcJIT/remote/test-global-init-nonzero-remote.ll with 89% similarity]
test/ExecutionEngine/OrcMCJIT/remote/test-global-init-nonzero-sm-pic.ll [moved from test/ExecutionEngine/OrcJIT/remote/test-global-init-nonzero-sm-pic.ll with 90% similarity]
test/ExecutionEngine/OrcMCJIT/remote/test-ptr-reloc-remote.ll [moved from test/ExecutionEngine/OrcJIT/remote/test-ptr-reloc-remote.ll with 84% similarity]
test/ExecutionEngine/OrcMCJIT/remote/test-ptr-reloc-sm-pic.ll [moved from test/ExecutionEngine/OrcJIT/remote/test-ptr-reloc-sm-pic.ll with 86% similarity]
test/ExecutionEngine/OrcMCJIT/simplesttest.ll [new file with mode: 0644]
test/ExecutionEngine/OrcMCJIT/simpletest.ll [moved from test/ExecutionEngine/OrcJIT/simpletest.ll with 70% similarity]
test/ExecutionEngine/OrcMCJIT/stubs-sm-pic.ll [moved from test/ExecutionEngine/OrcJIT/stubs-sm-pic.ll with 89% similarity]
test/ExecutionEngine/OrcMCJIT/stubs.ll [moved from test/ExecutionEngine/OrcJIT/stubs.ll with 93% similarity]
test/ExecutionEngine/OrcMCJIT/test-arith.ll [moved from test/ExecutionEngine/OrcJIT/test-arith.ll with 96% similarity]
test/ExecutionEngine/OrcMCJIT/test-branch.ll [moved from test/ExecutionEngine/OrcJIT/test-branch.ll with 81% similarity]
test/ExecutionEngine/OrcMCJIT/test-call-no-external-funcs.ll [moved from test/ExecutionEngine/OrcJIT/test-call-no-external-funcs.ll with 83% similarity]
test/ExecutionEngine/OrcMCJIT/test-call.ll [moved from test/ExecutionEngine/OrcJIT/test-call.ll with 88% similarity]
test/ExecutionEngine/OrcMCJIT/test-cast.ll [moved from test/ExecutionEngine/OrcJIT/test-cast.ll with 98% similarity]
test/ExecutionEngine/OrcMCJIT/test-common-symbols-alignment.ll [moved from test/ExecutionEngine/OrcJIT/test-common-symbols-alignment.ll with 95% similarity]
test/ExecutionEngine/OrcMCJIT/test-common-symbols.ll [moved from test/ExecutionEngine/OrcJIT/test-common-symbols.ll with 97% similarity]
test/ExecutionEngine/OrcMCJIT/test-constantexpr.ll [moved from test/ExecutionEngine/OrcJIT/test-constantexpr.ll with 84% similarity]
test/ExecutionEngine/OrcMCJIT/test-data-align.ll [moved from test/ExecutionEngine/OrcJIT/test-data-align.ll with 87% similarity]
test/ExecutionEngine/OrcMCJIT/test-fp-no-external-funcs.ll [moved from test/ExecutionEngine/OrcJIT/test-fp-no-external-funcs.ll with 93% similarity]
test/ExecutionEngine/OrcMCJIT/test-fp.ll [moved from test/ExecutionEngine/OrcJIT/test-fp.ll with 94% similarity]
test/ExecutionEngine/OrcMCJIT/test-global-ctors.ll [moved from test/ExecutionEngine/OrcJIT/test-global-ctors.ll with 92% similarity]
test/ExecutionEngine/OrcMCJIT/test-global-init-nonzero-sm-pic.ll [moved from test/ExecutionEngine/OrcJIT/test-global-init-nonzero-sm-pic.ll with 91% similarity]
test/ExecutionEngine/OrcMCJIT/test-global-init-nonzero.ll [moved from test/ExecutionEngine/OrcJIT/test-global-init-nonzero.ll with 95% similarity]
test/ExecutionEngine/OrcMCJIT/test-global.ll [moved from test/ExecutionEngine/OrcJIT/test-global.ll with 95% similarity]
test/ExecutionEngine/OrcMCJIT/test-loadstore.ll [moved from test/ExecutionEngine/OrcJIT/test-loadstore.ll with 95% similarity]
test/ExecutionEngine/OrcMCJIT/test-local.ll [moved from test/ExecutionEngine/OrcJIT/test-local.ll with 95% similarity]
test/ExecutionEngine/OrcMCJIT/test-logical.ll [moved from test/ExecutionEngine/OrcJIT/test-logical.ll with 93% similarity]
test/ExecutionEngine/OrcMCJIT/test-loop.ll [moved from test/ExecutionEngine/OrcJIT/test-loop.ll with 86% similarity]
test/ExecutionEngine/OrcMCJIT/test-phi.ll [moved from test/ExecutionEngine/OrcJIT/test-phi.ll with 93% similarity]
test/ExecutionEngine/OrcMCJIT/test-ptr-reloc-sm-pic.ll [moved from test/ExecutionEngine/OrcJIT/test-ptr-reloc-sm-pic.ll with 88% similarity]
test/ExecutionEngine/OrcMCJIT/test-ptr-reloc.ll [moved from test/ExecutionEngine/OrcJIT/test-ptr-reloc.ll with 93% similarity]
test/ExecutionEngine/OrcMCJIT/test-ret.ll [moved from test/ExecutionEngine/OrcJIT/test-ret.ll with 90% similarity]
test/ExecutionEngine/OrcMCJIT/test-return.ll [moved from test/ExecutionEngine/OrcJIT/test-return.ll with 71% similarity]
test/ExecutionEngine/OrcMCJIT/test-setcond-fp.ll [moved from test/ExecutionEngine/OrcJIT/test-setcond-fp.ll with 95% similarity]
test/ExecutionEngine/OrcMCJIT/test-setcond-int.ll [moved from test/ExecutionEngine/OrcJIT/test-setcond-int.ll with 98% similarity]
test/ExecutionEngine/OrcMCJIT/test-shift.ll [moved from test/ExecutionEngine/OrcJIT/test-shift.ll with 96% similarity]
tools/lli/CMakeLists.txt
tools/lli/OrcLazyJIT.cpp [new file with mode: 0644]
tools/lli/OrcLazyJIT.h [new file with mode: 0644]
tools/lli/lli.cpp

index 3dd1a37e1ed5f0994f27f547374f41742a53ec8b..77b0c48d0a7a3344f7995172795a60ffac4fb531 100644 (file)
@@ -193,8 +193,8 @@ public:
   ///        below this one.
   JITSymbol findSymbolIn(ModuleSetHandleT H, const std::string &Name,
                          bool ExportedSymbolsOnly) {
-    BaseLayerModuleSetHandleListT &BaseLayerHandles = H->second;
-    for (auto &BH : BaseLayerHandles) {
+
+    for (auto &BH : H->BaseLayerModuleSetHandles) {
       if (auto Symbol = BaseLayer.findSymbolIn(BH, Name, ExportedSymbolsOnly))
         return Symbol;
     }
diff --git a/test/ExecutionEngine/OrcJIT/multi-module-a.ll b/test/ExecutionEngine/OrcJIT/multi-module-a.ll
deleted file mode 100644 (file)
index 587a1e8..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: %lli -use-orcmcjit -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll %s > /dev/null
-
-declare i32 @FB()
-
-define i32 @main() {
-  %r = call i32 @FB( )   ; <i32> [#uses=1]
-  ret i32 %r
-}
-
diff --git a/test/ExecutionEngine/OrcJIT/multi-module-sm-pic-a.ll b/test/ExecutionEngine/OrcJIT/multi-module-sm-pic-a.ll
deleted file mode 100644 (file)
index b5ee3d1..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: %lli -use-orcmcjit -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll -relocation-model=pic -code-model=small %s > /dev/null
-; XFAIL: mips, i686, i386
-
-declare i32 @FB()
-
-define i32 @main() {
-  %r = call i32 @FB( )   ; <i32> [#uses=1]
-  ret i32 %r
-}
-
diff --git a/test/ExecutionEngine/OrcJIT/remote/cross-module-a.ll b/test/ExecutionEngine/OrcJIT/remote/cross-module-a.ll
deleted file mode 100644 (file)
index cc48fd4..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: %lli -use-orcmcjit -extra-module=%p/Inputs/cross-module-b.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s > /dev/null
-
-declare i32 @FB()
-
-define i32 @FA() nounwind {
-  ret i32 0
-}
-
-define i32 @main() nounwind {
-  %r = call i32 @FB( )   ; <i32> [#uses=1]
-  ret i32 %r
-}
diff --git a/test/ExecutionEngine/OrcJIT/remote/cross-module-sm-pic-a.ll b/test/ExecutionEngine/OrcJIT/remote/cross-module-sm-pic-a.ll
deleted file mode 100644 (file)
index d6209d7..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: %lli -use-orcmcjit -extra-module=%p/Inputs/cross-module-b.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target%exeext -relocation-model=pic -code-model=small %s > /dev/null
-; XFAIL: mips, i686, i386, arm
-
-declare i32 @FB()
-
-define i32 @FA() {
-  ret i32 0
-}
-
-define i32 @main() {
-  %r = call i32 @FB( )   ; <i32> [#uses=1]
-  ret i32 %r
-}
-
diff --git a/test/ExecutionEngine/OrcJIT/remote/multi-module-a.ll b/test/ExecutionEngine/OrcJIT/remote/multi-module-a.ll
deleted file mode 100644 (file)
index 9ae0e06..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: %lli -use-orcmcjit -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s > /dev/null
-
-declare i32 @FB()
-
-define i32 @main() nounwind {
-  %r = call i32 @FB( )   ; <i32> [#uses=1]
-  ret i32 %r
-}
-
diff --git a/test/ExecutionEngine/OrcJIT/remote/multi-module-sm-pic-a.ll b/test/ExecutionEngine/OrcJIT/remote/multi-module-sm-pic-a.ll
deleted file mode 100644 (file)
index a1d4b81..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: %lli -use-orcmcjit -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target%exeext -relocation-model=pic -code-model=small %s > /dev/null
-; XFAIL: mips, i686, i386, arm
-
-declare i32 @FB()
-
-define i32 @main() {
-  %r = call i32 @FB( )   ; <i32> [#uses=1]
-  ret i32 %r
-}
-
diff --git a/test/ExecutionEngine/OrcJIT/simplesttest.ll b/test/ExecutionEngine/OrcJIT/simplesttest.ll
deleted file mode 100644 (file)
index c2f24f6..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
-
-define i32 @main() {
-       ret i32 0
-}
-
diff --git a/test/ExecutionEngine/OrcLazy/lit.local.cfg b/test/ExecutionEngine/OrcLazy/lit.local.cfg
new file mode 100644 (file)
index 0000000..bf63c4f
--- /dev/null
@@ -0,0 +1,2 @@
+if config.root.host_arch not in ['x86_64']:
+    config.unsupported = True
diff --git a/test/ExecutionEngine/OrcLazy/trivial_retval_1.ll b/test/ExecutionEngine/OrcLazy/trivial_retval_1.ll
new file mode 100644 (file)
index 0000000..b1234f9
--- /dev/null
@@ -0,0 +1,25 @@
+; RUN: lli -jit-kind=orc-lazy %s; [ $? -eq 30 ]
+define i32 @baz() {
+entry:
+  ret i32 2
+}
+
+define i32 @bar() {
+entry:
+  %call = call i32 @baz()
+  %mul = mul nsw i32 3, %call
+  ret i32 %mul
+}
+
+define i32 @foo() {
+entry:
+  %call = call i32 @bar()
+  %mul = mul nsw i32 5, %call
+  ret i32 %mul
+}
+
+define i32 @main(i32 %argc, i8** %argv) {
+entry:
+  %call = call i32 @foo()
+  ret i32 %call
+}
similarity index 96%
rename from test/ExecutionEngine/OrcJIT/2002-12-16-ArgTest.ll
rename to test/ExecutionEngine/OrcMCJIT/2002-12-16-ArgTest.ll
index 027085519b4eda97310bfe8aa46ab7e0ee35cbd4..e8eb693985026c83649f52d3a64a78a1e916e1aa 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 @.LC0 = internal global [10 x i8] c"argc: %d\0A\00"            ; <[10 x i8]*> [#uses=1]
 
similarity index 86%
rename from test/ExecutionEngine/OrcJIT/2003-01-04-ArgumentBug.ll
rename to test/ExecutionEngine/OrcMCJIT/2003-01-04-ArgumentBug.ll
index 67425a9a3a3ca00175180a9102cb0a611cdcee57..2061329f252111adb6ab4408449d102bbd9b8c3f 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 define i32 @foo(i32 %X, i32 %Y, double %A) {
        %cond212 = fcmp une double %A, 1.000000e+00             ; <i1> [#uses=1]
similarity index 91%
rename from test/ExecutionEngine/OrcJIT/2003-01-04-LoopTest.ll
rename to test/ExecutionEngine/OrcMCJIT/2003-01-04-LoopTest.ll
index cf805ea4162a8dd027a006c52f0d27576829741d..a298172e6780ab79843d0e62010752a232fc349a 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 define i32 @main() {
        call i32 @mylog( i32 4 )                ; <i32>:1 [#uses=0]
similarity index 81%
rename from test/ExecutionEngine/OrcJIT/2003-01-04-PhiTest.ll
rename to test/ExecutionEngine/OrcMCJIT/2003-01-04-PhiTest.ll
index b8b851966c061c19042283f76dd0ffa1aea4e2f4..a24e188438fb5c0c9c7156b24baa20d3cb91ca82 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 define i32 @main() {
 ; <label>:0
similarity index 83%
rename from test/ExecutionEngine/OrcJIT/2003-01-09-SARTest.ll
rename to test/ExecutionEngine/OrcMCJIT/2003-01-09-SARTest.ll
index 85b0031e61ec1613836e60a4301295c812a15acd..8f79ff2a683a5ef54dd4435cc5b2ca7a44c9b2e1 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 ; We were accidentally inverting the signedness of right shifts.  Whoops.
 
similarity index 85%
rename from test/ExecutionEngine/OrcJIT/2003-01-10-FUCOM.ll
rename to test/ExecutionEngine/OrcMCJIT/2003-01-10-FUCOM.ll
index 66b21c9953c10652a3ab70463c2f2246bcd7b9d8..7e2ce669a7e24204ac9d014631234013ef2f04ac 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 define i32 @main() {
        %X = fadd double 0.000000e+00, 1.000000e+00             ; <double> [#uses=1]
similarity index 89%
rename from test/ExecutionEngine/OrcJIT/2003-01-15-AlignmentTest.ll
rename to test/ExecutionEngine/OrcMCJIT/2003-01-15-AlignmentTest.ll
index 1f27c1f78d5afc12e37fd1193ae75e1ceb18f7f1..38d5f83af038e7c0ef998ad694a967388aa9108c 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 define i32 @bar(i8* %X) {
         ; pointer should be 4 byte aligned!
similarity index 90%
rename from test/ExecutionEngine/OrcJIT/2003-05-06-LivenessClobber.ll
rename to test/ExecutionEngine/OrcMCJIT/2003-05-06-LivenessClobber.ll
index dbb62e0bd26c657521b0e8d00afe36430b2eee9a..82bf97d2a929efdd83f644b511a99af2952f84f6 100644 (file)
@@ -1,6 +1,6 @@
 ; This testcase should return with an exit code of 1.
 ;
-; RUN: not %lli -use-orcmcjit %s
+; RUN: not %lli -jit-kind=orc-mcjit %s
 
 @test = global i64 0           ; <i64*> [#uses=1]
 
similarity index 86%
rename from test/ExecutionEngine/OrcJIT/2003-05-07-ArgumentTest.ll
rename to test/ExecutionEngine/OrcMCJIT/2003-05-07-ArgumentTest.ll
index 44ead0cb4d1a55fbc5f045a23070d51209263307..43e9ec956b249a2a1c2b43890d915f9def656f50 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s test
+; RUN: %lli -jit-kind=orc-mcjit %s test
 
 declare i32 @puts(i8*)
 
similarity index 84%
rename from test/ExecutionEngine/OrcJIT/2003-05-11-PHIRegAllocBug.ll
rename to test/ExecutionEngine/OrcMCJIT/2003-05-11-PHIRegAllocBug.ll
index 68402d9889cc7c1c8c82555eb2aa0e075f106410..47988b9c0f0568662473caf1225c434cb2b9a98b 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 define i32 @main() {
 entry:
similarity index 90%
rename from test/ExecutionEngine/OrcJIT/2003-06-04-bzip2-bug.ll
rename to test/ExecutionEngine/OrcMCJIT/2003-06-04-bzip2-bug.ll
index 0907993f91f1d2e8092007690651d124a101a432..942b8362c70028e051271da0b94c3bf55aa9ee41 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 ; Testcase distilled from 256.bzip2.
 
similarity index 86%
rename from test/ExecutionEngine/OrcJIT/2003-06-05-PHIBug.ll
rename to test/ExecutionEngine/OrcMCJIT/2003-06-05-PHIBug.ll
index 2eb497bed48f21c01266b11986395bfffeb6d395..07bcbbde12d176fc1b99b5eee55d9705ddc2e8c1 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 ; Testcase distilled from 256.bzip2.
 
similarity index 83%
rename from test/ExecutionEngine/OrcJIT/2003-08-15-AllocaAssertion.ll
rename to test/ExecutionEngine/OrcMCJIT/2003-08-15-AllocaAssertion.ll
index 290d5a20ba53fd94df67b7fdf86d19be09e8ebb2..43c26b7e1a09f92e5a745dc07095a2a987349b1e 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 ; This testcase failed to work because two variable sized allocas confused the
 ; local register allocator.
similarity index 90%
rename from test/ExecutionEngine/OrcJIT/2003-08-21-EnvironmentTest.ll
rename to test/ExecutionEngine/OrcMCJIT/2003-08-21-EnvironmentTest.ll
index ea4b145e46977d8e7b6ddb902ad99d85782cb0a3..88dd46e2d631fd64e7eed8780c82475e938d4d3b 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 ;
 ; Regression Test: EnvironmentTest.ll
similarity index 95%
rename from test/ExecutionEngine/OrcJIT/2003-08-23-RegisterAllocatePhysReg.ll
rename to test/ExecutionEngine/OrcMCJIT/2003-08-23-RegisterAllocatePhysReg.ll
index bd26c38f87750c724d201ff84e0a7ae7ec67b2e3..fc3734f151df1df4b35e443c62ae1def6050e87b 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 ; This testcase exposes a bug in the local register allocator where it runs out
 ; of registers (due to too many overlapping live ranges), but then attempts to
similarity index 92%
rename from test/ExecutionEngine/OrcJIT/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll
rename to test/ExecutionEngine/OrcMCJIT/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll
index c59ad32ee103aadfe4c7ac8a036bb134699f1d23..4e38184afe45df90b78ec742371b41f490ac35bc 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 @A = global i32 0              ; <i32*> [#uses=1]
 
similarity index 95%
rename from test/ExecutionEngine/OrcJIT/2005-12-02-TailCallBug.ll
rename to test/ExecutionEngine/OrcMCJIT/2005-12-02-TailCallBug.ll
index 7f1d3b0b6dde512559f36d5819163e5cf80e46e5..aff7fce9b06e533402766614dd3b318e7f0d1ca1 100644 (file)
@@ -1,5 +1,5 @@
 ; PR672
-; RUN: %lli -use-orcmcjit %s
+; RUN: %lli -jit-kind=orc-mcjit %s
 ; XFAIL: mcjit-ia32
 
 define i32 @main() {
similarity index 91%
rename from test/ExecutionEngine/OrcJIT/2007-12-10-APIntLoadStore.ll
rename to test/ExecutionEngine/OrcMCJIT/2007-12-10-APIntLoadStore.ll
index 454ae70dd232608f317dcc6af9d9d3d468c813e4..5bad45a587bf35db9f1eb325646aabce72477c2e 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -force-interpreter %s
+; RUN: %lli -jit-kind=orc-mcjit -force-interpreter %s
 ; PR1836
 
 define i32 @main() {
similarity index 96%
rename from test/ExecutionEngine/OrcJIT/2008-06-05-APInt-OverAShr.ll
rename to test/ExecutionEngine/OrcMCJIT/2008-06-05-APInt-OverAShr.ll
index e29843aece4693fcaf3a7350de5dcd6dffcdc223..9dc3e5bffebfbe941567851a77d07853dc62f1e2 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -force-interpreter=true %s | FileCheck %s
+; RUN: %lli -jit-kind=orc-mcjit -force-interpreter=true %s | FileCheck %s
 ; CHECK: 1
 
 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
similarity index 92%
rename from test/ExecutionEngine/OrcJIT/2013-04-04-RelocAddend.ll
rename to test/ExecutionEngine/OrcMCJIT/2013-04-04-RelocAddend.ll
index 140fbed4c200bd66d56af1b8655e5fc019616e8a..94ccf957c82e07807524c9948a7ceef59ce0ded6 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s
+; RUN: %lli -jit-kind=orc-mcjit %s
 ;
 ; Verify relocations to global symbols with addend work correctly.
 ;
similarity index 60%
rename from test/ExecutionEngine/OrcJIT/cross-module-a.ll
rename to test/ExecutionEngine/OrcMCJIT/cross-module-a.ll
index 14a73f5548c9bd4e18eb339db5689d6c72be95bc..451b2662ddf9241d429ffdd251d24ce98ee3747f 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -extra-module=%p/Inputs/cross-module-b.ll %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit -extra-module=%p/Inputs/cross-module-b.ll %s > /dev/null
 
 declare i32 @FB()
 
similarity index 55%
rename from test/ExecutionEngine/OrcJIT/cross-module-sm-pic-a.ll
rename to test/ExecutionEngine/OrcMCJIT/cross-module-sm-pic-a.ll
index 50ad1c0180f14b803859671a1c5ed244a52a8be1..4f5afd0ed47521d3be87b4a38847145734d29fa6 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -extra-module=%p/Inputs/cross-module-b.ll -relocation-model=pic -code-model=small %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit -extra-module=%p/Inputs/cross-module-b.ll -relocation-model=pic -code-model=small %s > /dev/null
 ; XFAIL: mips, i686, i386
 
 declare i32 @FB()
similarity index 92%
rename from test/ExecutionEngine/OrcJIT/eh-lg-pic.ll
rename to test/ExecutionEngine/OrcMCJIT/eh-lg-pic.ll
index e5fa22c04ef238f8c33a3620188c2a27ce79fa6c..32b53c4847bc60959db94438b1768defd6fb6a54 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -relocation-model=pic -code-model=large %s
+; RUN: %lli -jit-kind=orc-mcjit -relocation-model=pic -code-model=large %s
 ; XFAIL: cygwin, win32, mingw, mips, i686, i386, aarch64, arm, asan, msan
 declare i8* @__cxa_allocate_exception(i64)
 declare void @__cxa_throw(i8*, i8*, i8*)
similarity index 92%
rename from test/ExecutionEngine/OrcJIT/eh-sm-pic.ll
rename to test/ExecutionEngine/OrcMCJIT/eh-sm-pic.ll
index f22cea90f154800b49842e50e960a55e40524d16..a54795ead56dcec4aae98c0244ac4090fbf086e6 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -relocation-model=pic -code-model=small %s
+; RUN: %lli -jit-kind=orc-mcjit -relocation-model=pic -code-model=small %s
 ; XFAIL: cygwin, win32, mingw, mips, i686, i386, darwin, aarch64, arm, asan, msan
 declare i8* @__cxa_allocate_exception(i64)
 declare void @__cxa_throw(i8*, i8*, i8*)
similarity index 96%
rename from test/ExecutionEngine/OrcJIT/eh.ll
rename to test/ExecutionEngine/OrcMCJIT/eh.ll
index 130146ba766ad83c327ef3afc9a3c0bb2664a8de..2de6a517b2b3471c21a3b9311b6c88c4f60f15be 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s
+; RUN: %lli -jit-kind=orc-mcjit %s
 ; XFAIL: arm, cygwin, win32, mingw, asan, msan
 declare i8* @__cxa_allocate_exception(i64)
 declare void @__cxa_throw(i8*, i8*, i8*)
similarity index 86%
rename from test/ExecutionEngine/OrcJIT/fpbitcast.ll
rename to test/ExecutionEngine/OrcMCJIT/fpbitcast.ll
index 3f074f80883b83be27061fb8dfffa89802486cdc..767b58016c6d00d16c8856398f1b7b99525620b9 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -force-interpreter=true %s | FileCheck %s
+; RUN: %lli -jit-kind=orc-mcjit -force-interpreter=true %s | FileCheck %s
 ; CHECK: 40091eb8
 
 define i32 @test(double %x) {
similarity index 77%
rename from test/ExecutionEngine/OrcJIT/hello-sm-pic.ll
rename to test/ExecutionEngine/OrcMCJIT/hello-sm-pic.ll
index 52c91d5dcc451bfa7c7173cd814e1c8ce173024c..59b47afadb1942623967c4bbb9b30e87ba2652b6 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -relocation-model=pic -code-model=small %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit -relocation-model=pic -code-model=small %s > /dev/null
 ; XFAIL: mips, i686, i386, darwin, aarch64, arm
 
 @.LC0 = internal global [12 x i8] c"Hello World\00"            ; <[12 x i8]*> [#uses=1]
similarity index 84%
rename from test/ExecutionEngine/OrcJIT/hello.ll
rename to test/ExecutionEngine/OrcMCJIT/hello.ll
index c315a157a0c46370b88c8871b83c662622a098a6..08413c2b5824c331720abff5dec625b93f3dd5d0 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 @.LC0 = internal global [12 x i8] c"Hello World\00"            ; <[12 x i8]*> [#uses=1]
 
similarity index 86%
rename from test/ExecutionEngine/OrcJIT/hello2.ll
rename to test/ExecutionEngine/OrcMCJIT/hello2.ll
index 9e7cf5b9af84d9f5acb0289f44e94b519e6467aa..8f071cd34a4bc2836c701ac09178326e242574f7 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 @X = global i32 7              ; <i32*> [#uses=0]
 @msg = internal global [13 x i8] c"Hello World\0A\00"          ; <[13 x i8]*> [#uses=1]
similarity index 64%
rename from test/ExecutionEngine/OrcJIT/load-object-a.ll
rename to test/ExecutionEngine/OrcMCJIT/load-object-a.ll
index 0b9509c3c887e9b83dcb4297f666447d6d9a20fd..abd470df547331c5a61aa365803972231f1ab660 100644 (file)
@@ -1,20 +1,20 @@
 ; This first line will generate the .o files for the next run line
 ; RUN: rm -rf %t.cachedir %t.cachedir2 %t.cachedir3
 ; RUN: mkdir -p %t.cachedir %t.cachedir2 %t.cachedir3
-; RUN: %lli -use-orcmcjit -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll -enable-cache-manager -object-cache-dir=%t.cachedir %s
+; RUN: %lli -jit-kind=orc-mcjit -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll -enable-cache-manager -object-cache-dir=%t.cachedir %s
 
 ; Collect generated objects.
 ; RUN: find %t.cachedir -type f -name 'multi-module-?.o' -exec mv -v '{}' %t.cachedir2 ';'
 
 ; This line tests MCJIT object loading
-; RUN: %lli -use-orcmcjit -extra-object=%t.cachedir2/multi-module-b.o -extra-object=%t.cachedir2/multi-module-c.o %s
+; RUN: %lli -jit-kind=orc-mcjit -extra-object=%t.cachedir2/multi-module-b.o -extra-object=%t.cachedir2/multi-module-c.o %s
 
 ; These lines put the object files into an archive
 ; RUN: llvm-ar r %t.cachedir3/load-object.a %t.cachedir2/multi-module-b.o
 ; RUN: llvm-ar r %t.cachedir3/load-object.a %t.cachedir2/multi-module-c.o
 
 ; This line test MCJIT archive loading
-; RUN: %lli -use-orcmcjit -extra-archive=%t.cachedir3/load-object.a %s
+; RUN: %lli -jit-kind=orc-mcjit -extra-archive=%t.cachedir3/load-object.a %s
 
 declare i32 @FB()
 
diff --git a/test/ExecutionEngine/OrcMCJIT/multi-module-a.ll b/test/ExecutionEngine/OrcMCJIT/multi-module-a.ll
new file mode 100644 (file)
index 0000000..d622efc
--- /dev/null
@@ -0,0 +1,9 @@
+; RUN: %lli -jit-kind=orc-mcjit -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll %s > /dev/null
+
+declare i32 @FB()
+
+define i32 @main() {
+  %r = call i32 @FB( )   ; <i32> [#uses=1]
+  ret i32 %r
+}
+
similarity index 92%
rename from test/ExecutionEngine/OrcJIT/multi-module-eh-a.ll
rename to test/ExecutionEngine/OrcMCJIT/multi-module-eh-a.ll
index 6117e4c964619eacd35991f875d33e07bd54283f..f77cb44a878f29e180f846edbec8f4b7c376dd17 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -extra-module=%p/Inputs/multi-module-eh-b.ll %s
+; RUN: %lli -jit-kind=orc-mcjit -extra-module=%p/Inputs/multi-module-eh-b.ll %s
 ; XFAIL: arm, cygwin, win32, mingw, asan, msan
 declare i8* @__cxa_allocate_exception(i64)
 declare void @__cxa_throw(i8*, i8*, i8*)
diff --git a/test/ExecutionEngine/OrcMCJIT/multi-module-sm-pic-a.ll b/test/ExecutionEngine/OrcMCJIT/multi-module-sm-pic-a.ll
new file mode 100644 (file)
index 0000000..80b8e16
--- /dev/null
@@ -0,0 +1,10 @@
+; RUN: %lli -jit-kind=orc-mcjit -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll -relocation-model=pic -code-model=small %s > /dev/null
+; XFAIL: mips, i686, i386
+
+declare i32 @FB()
+
+define i32 @main() {
+  %r = call i32 @FB( )   ; <i32> [#uses=1]
+  ret i32 %r
+}
+
similarity index 92%
rename from test/ExecutionEngine/OrcJIT/non-extern-addend.ll
rename to test/ExecutionEngine/OrcMCJIT/non-extern-addend.ll
index d768e2b7fab8bf84918a05ae4930da9ca2e4e585..bb2f7e4d325e06f9a54ba826da09592f23439f8a 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 define i32 @foo(i32 %x, i32 %y, double %d) {
 entry:
similarity index 97%
rename from test/ExecutionEngine/OrcJIT/pr13727.ll
rename to test/ExecutionEngine/OrcMCJIT/pr13727.ll
index 163fa798ae3e713a05fe3df25aac24b9cc971e10..a48c573ba28d9ef704d961f91711405c8e50ae4a 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -O0 -disable-lazy-compilation=false %s
+; RUN: %lli -jit-kind=orc-mcjit -O0 -disable-lazy-compilation=false %s
 
 ; The intention of this test is to verify that symbols mapped to COMMON in ELF
 ; work as expected.
diff --git a/test/ExecutionEngine/OrcMCJIT/remote/cross-module-a.ll b/test/ExecutionEngine/OrcMCJIT/remote/cross-module-a.ll
new file mode 100644 (file)
index 0000000..16553eb
--- /dev/null
@@ -0,0 +1,12 @@
+; RUN: %lli -jit-kind=orc-mcjit -extra-module=%p/Inputs/cross-module-b.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s > /dev/null
+
+declare i32 @FB()
+
+define i32 @FA() nounwind {
+  ret i32 0
+}
+
+define i32 @main() nounwind {
+  %r = call i32 @FB( )   ; <i32> [#uses=1]
+  ret i32 %r
+}
diff --git a/test/ExecutionEngine/OrcMCJIT/remote/cross-module-sm-pic-a.ll b/test/ExecutionEngine/OrcMCJIT/remote/cross-module-sm-pic-a.ll
new file mode 100644 (file)
index 0000000..c897904
--- /dev/null
@@ -0,0 +1,14 @@
+; RUN: %lli -jit-kind=orc-mcjit -extra-module=%p/Inputs/cross-module-b.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target%exeext -relocation-model=pic -code-model=small %s > /dev/null
+; XFAIL: mips, i686, i386, arm
+
+declare i32 @FB()
+
+define i32 @FA() {
+  ret i32 0
+}
+
+define i32 @main() {
+  %r = call i32 @FB( )   ; <i32> [#uses=1]
+  ret i32 %r
+}
+
diff --git a/test/ExecutionEngine/OrcMCJIT/remote/multi-module-a.ll b/test/ExecutionEngine/OrcMCJIT/remote/multi-module-a.ll
new file mode 100644 (file)
index 0000000..aa34348
--- /dev/null
@@ -0,0 +1,9 @@
+; RUN: %lli -jit-kind=orc-mcjit -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s > /dev/null
+
+declare i32 @FB()
+
+define i32 @main() nounwind {
+  %r = call i32 @FB( )   ; <i32> [#uses=1]
+  ret i32 %r
+}
+
diff --git a/test/ExecutionEngine/OrcMCJIT/remote/multi-module-sm-pic-a.ll b/test/ExecutionEngine/OrcMCJIT/remote/multi-module-sm-pic-a.ll
new file mode 100644 (file)
index 0000000..41812d2
--- /dev/null
@@ -0,0 +1,10 @@
+; RUN: %lli -jit-kind=orc-mcjit -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target%exeext -relocation-model=pic -code-model=small %s > /dev/null
+; XFAIL: mips, i686, i386, arm
+
+declare i32 @FB()
+
+define i32 @main() {
+  %r = call i32 @FB( )   ; <i32> [#uses=1]
+  ret i32 %r
+}
+
similarity index 54%
rename from test/ExecutionEngine/OrcJIT/remote/simpletest-remote.ll
rename to test/ExecutionEngine/OrcMCJIT/remote/simpletest-remote.ll
index 3ef929bc9e95ae1656554925ac67176e10c048bb..45e11fce5a6ec5bec378fbf1de702297d9c9adab 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s > /dev/null
 
 define i32 @bar() nounwind {
        ret i32 0
similarity index 88%
rename from test/ExecutionEngine/OrcJIT/remote/stubs-remote.ll
rename to test/ExecutionEngine/OrcMCJIT/remote/stubs-remote.ll
index 895e0d9de2f25c689c05653c81847762cf0336ff..aeff011d5edb3d99fcfdaf0dacdb76726cd8ebff 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -remote-mcjit -disable-lazy-compilation=false -mcjit-remote-process=lli-child-target%exeext %s
+; RUN: %lli -jit-kind=orc-mcjit -remote-mcjit -disable-lazy-compilation=false -mcjit-remote-process=lli-child-target%exeext %s
 ; XFAIL: *
 ; This test should fail until remote symbol resolution is supported.
 
similarity index 88%
rename from test/ExecutionEngine/OrcJIT/remote/stubs-sm-pic.ll
rename to test/ExecutionEngine/OrcMCJIT/remote/stubs-sm-pic.ll
index ef1e5ef003faf3b6aa5e19e5d95a9ec416ad9381..a67edba1d231aec8a6e02249c5b713de18335fe7 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -remote-mcjit -disable-lazy-compilation=false -relocation-model=pic -code-model=small %s
+; RUN: %lli -jit-kind=orc-mcjit -remote-mcjit -disable-lazy-compilation=false -relocation-model=pic -code-model=small %s
 ; XFAIL: *
 ; This function should fail until remote symbol resolution is supported.
 
similarity index 95%
rename from test/ExecutionEngine/OrcJIT/remote/test-common-symbols-remote.ll
rename to test/ExecutionEngine/OrcMCJIT/remote/test-common-symbols-remote.ll
index 444339550ae608af79a80828a4ea8c94496df012..7e4dc056027c542671d5dcc219cd6d102c86b9bb 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -remote-mcjit -O0 -disable-lazy-compilation=false -mcjit-remote-process=lli-child-target%exeext %s
+; RUN: %lli -jit-kind=orc-mcjit -remote-mcjit -O0 -disable-lazy-compilation=false -mcjit-remote-process=lli-child-target%exeext %s
 
 ; The intention of this test is to verify that symbols mapped to COMMON in ELF
 ; work as expected.
similarity index 74%
rename from test/ExecutionEngine/OrcJIT/remote/test-data-align-remote.ll
rename to test/ExecutionEngine/OrcMCJIT/remote/test-data-align-remote.ll
index 768729b0999148c5298fcb02bb2d946f9da1ceb8..95c9b825a8d3b47432292ae4254c37ffa845b4a0 100644 (file)
@@ -1,4 +1,4 @@
-; RUN:  %lli -use-orcmcjit -remote-mcjit -O0 -mcjit-remote-process=lli-child-target%exeext %s
+; RUN:  %lli -jit-kind=orc-mcjit -remote-mcjit -O0 -mcjit-remote-process=lli-child-target%exeext %s
 
 ; Check that a variable is always aligned as specified.
 
similarity index 86%
rename from test/ExecutionEngine/OrcJIT/remote/test-fp-no-external-funcs-remote.ll
rename to test/ExecutionEngine/OrcMCJIT/remote/test-fp-no-external-funcs-remote.ll
index 5c1be7669c60753f0a8d0a73d8d6ad98dc95d859..286710338841cdf39812da93f60a9f85c3e81262 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s > /dev/null
 
 define double @test(double* %DP, double %Arg) nounwind {
        %D = load double, double* %DP           ; <double> [#uses=1]
similarity index 89%
rename from test/ExecutionEngine/OrcJIT/remote/test-global-init-nonzero-remote.ll
rename to test/ExecutionEngine/OrcMCJIT/remote/test-global-init-nonzero-remote.ll
index 683263dee3b759e7015ba6469d044742a8603f7f..5dabb8f44d6824df3b44d814744c237429b9434c 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s > /dev/null
 
 @count = global i32 1, align 4
 
similarity index 90%
rename from test/ExecutionEngine/OrcJIT/remote/test-global-init-nonzero-sm-pic.ll
rename to test/ExecutionEngine/OrcMCJIT/remote/test-global-init-nonzero-sm-pic.ll
index 251cef40c5214bbf14be81aa21faa99ce0ee67c8..ec9e1ae1a03c82debdddcc23a115c529efc1a4c5 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -remote-mcjit -relocation-model=pic -code-model=small %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit -remote-mcjit -relocation-model=pic -code-model=small %s > /dev/null
 ; XFAIL: mips, aarch64, arm, i686, i386
 
 @count = global i32 1, align 4
similarity index 84%
rename from test/ExecutionEngine/OrcJIT/remote/test-ptr-reloc-remote.ll
rename to test/ExecutionEngine/OrcMCJIT/remote/test-ptr-reloc-remote.ll
index d9fb5de225ca63843d75acd3885c491eb70c31a1..aa07db9f512d12c93b4372a43013453b92d97370 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -remote-mcjit -O0 -mcjit-remote-process=lli-child-target%exeext %s
+; RUN: %lli -jit-kind=orc-mcjit -remote-mcjit -O0 -mcjit-remote-process=lli-child-target%exeext %s
 
 @.str = private unnamed_addr constant [6 x i8] c"data1\00", align 1
 @ptr = global i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), align 4
similarity index 86%
rename from test/ExecutionEngine/OrcJIT/remote/test-ptr-reloc-sm-pic.ll
rename to test/ExecutionEngine/OrcMCJIT/remote/test-ptr-reloc-sm-pic.ll
index 34cd3d5ebddca5b77a9547fc89b1176fbbc640f7..61321ac1b9475317fa80b84c376e960947d618fa 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -remote-mcjit -O0 -relocation-model=pic -code-model=small %s
+; RUN: %lli -jit-kind=orc-mcjit -remote-mcjit -O0 -relocation-model=pic -code-model=small %s
 ; XFAIL: mips, aarch64, arm, i686, i386
 
 @.str = private unnamed_addr constant [6 x i8] c"data1\00", align 1
diff --git a/test/ExecutionEngine/OrcMCJIT/simplesttest.ll b/test/ExecutionEngine/OrcMCJIT/simplesttest.ll
new file mode 100644 (file)
index 0000000..4a47131
--- /dev/null
@@ -0,0 +1,6 @@
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
+
+define i32 @main() {
+       ret i32 0
+}
+
similarity index 70%
rename from test/ExecutionEngine/OrcJIT/simpletest.ll
rename to test/ExecutionEngine/OrcMCJIT/simpletest.ll
index e99f615658eaa56856d02a1d6def5c92fe1a9f83..be1148be8a5443a6dd8dbb61b443267925f1d9fd 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 define i32 @bar() {
        ret i32 0
similarity index 89%
rename from test/ExecutionEngine/OrcJIT/stubs-sm-pic.ll
rename to test/ExecutionEngine/OrcMCJIT/stubs-sm-pic.ll
index 73c265f35dedbf8b0320a7fcb6ef7e07cd6dcccc..f354a0de0935981005858533c6fe674fc338f09d 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -disable-lazy-compilation=false -relocation-model=pic -code-model=small %s
+; RUN: %lli -jit-kind=orc-mcjit -disable-lazy-compilation=false -relocation-model=pic -code-model=small %s
 ; XFAIL: mips, i686, i386, aarch64, arm
 
 define i32 @main() nounwind {
similarity index 93%
rename from test/ExecutionEngine/OrcJIT/stubs.ll
rename to test/ExecutionEngine/OrcMCJIT/stubs.ll
index 66d0762b8fdd22f87268ab0e02de532681be83c0..c096f5fd7e7891d47bde07d5d483a24ecfaee879 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -disable-lazy-compilation=false %s
+; RUN: %lli -jit-kind=orc-mcjit -disable-lazy-compilation=false %s
 
 define i32 @main() nounwind {
 entry:
similarity index 96%
rename from test/ExecutionEngine/OrcJIT/test-arith.ll
rename to test/ExecutionEngine/OrcMCJIT/test-arith.ll
index b66256742d630306682d4983a1467c3085072e97..c4331bf7327256f35f6fc4ff7a727ed3a60eea70 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 define i32 @main() {
        %A = add i8 0, 12               ; <i8> [#uses=1]
similarity index 81%
rename from test/ExecutionEngine/OrcJIT/test-branch.ll
rename to test/ExecutionEngine/OrcMCJIT/test-branch.ll
index b66cfafeb5da120292fb17da8e5cb339d6a0835a..b3ef86a193ef882ddf78a8d31de108612e6645cb 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 ; test unconditional branch
 define i32 @main() {
similarity index 83%
rename from test/ExecutionEngine/OrcJIT/test-call-no-external-funcs.ll
rename to test/ExecutionEngine/OrcMCJIT/test-call-no-external-funcs.ll
index c536efec5c487407162eb6d141c209926549b72d..78c6a1bb2f9f93b2a8191b991dd59e1b0104fc98 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 define i32 @_Z14func_exit_codev() nounwind uwtable {
 entry:
similarity index 88%
rename from test/ExecutionEngine/OrcJIT/test-call.ll
rename to test/ExecutionEngine/OrcMCJIT/test-call.ll
index 8f50bdc974222a93e259c1f9b57a5ac4a62067dc..5345856f5658ce2a66cb9440faeed390d7df337f 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 declare void @exit(i32)
 
similarity index 98%
rename from test/ExecutionEngine/OrcJIT/test-cast.ll
rename to test/ExecutionEngine/OrcMCJIT/test-cast.ll
index 4efd76057fc1497b70572c0341b10bf35597d5c4..f1a521f3b6262a81e5e11b2cb8175a308442505e 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 define i32 @foo() {
        ret i32 0
similarity index 95%
rename from test/ExecutionEngine/OrcJIT/test-common-symbols-alignment.ll
rename to test/ExecutionEngine/OrcMCJIT/test-common-symbols-alignment.ll
index d48e05764c33eff4d7222633b9b7f4c2c8d3b6be..cfbd2761a37f8a7d7f5a42112510bd5cad51a6b6 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -O0 %s
+; RUN: %lli -jit-kind=orc-mcjit -O0 %s
 
 ; This test checks that common symbols have been allocated addresses honouring
 ; the alignment requirement.
similarity index 97%
rename from test/ExecutionEngine/OrcJIT/test-common-symbols.ll
rename to test/ExecutionEngine/OrcMCJIT/test-common-symbols.ll
index 5ebdd8d4fbc072b4775acf54eaab293a83d9abd4..db3c0471a8e803a497deffb04462a4c4339154bc 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -O0 -disable-lazy-compilation=false %s
+; RUN: %lli -jit-kind=orc-mcjit -O0 -disable-lazy-compilation=false %s
 
 ; The intention of this test is to verify that symbols mapped to COMMON in ELF
 ; work as expected.
similarity index 84%
rename from test/ExecutionEngine/OrcJIT/test-constantexpr.ll
rename to test/ExecutionEngine/OrcMCJIT/test-constantexpr.ll
index 380848c936fed42f6cf50eadbfa312ca0b782090..9a147c2fc1a7419c90ecfa80778ad272d830bca5 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 ; This tests to make sure that we can evaluate weird constant expressions
 
similarity index 87%
rename from test/ExecutionEngine/OrcJIT/test-data-align.ll
rename to test/ExecutionEngine/OrcMCJIT/test-data-align.ll
index f76dda9fbebf6874e8b8af15ca500b4b9fc7dac5..f0deb56d52d622eb057c9892c33e7bf315373bb8 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -O0 %s
+; RUN: %lli -jit-kind=orc-mcjit -O0 %s
 
 ; Check that a variable is always aligned as specified.
 
similarity index 93%
rename from test/ExecutionEngine/OrcJIT/test-fp-no-external-funcs.ll
rename to test/ExecutionEngine/OrcMCJIT/test-fp-no-external-funcs.ll
index 3a88a7da8c0d1418d20ea4aff76d29e2ffa199e4..2baadcde4b1ed17a12e60dc28c277fb4307e9350 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 define double @test(double* %DP, double %Arg) {
        %D = load double, double* %DP           ; <double> [#uses=1]
similarity index 94%
rename from test/ExecutionEngine/OrcJIT/test-fp.ll
rename to test/ExecutionEngine/OrcMCJIT/test-fp.ll
index 6129f7ee7983f0539684a662247b448d035c45d3..6d56e69a9972c07ab4629db95530482684e1db16 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 define double @test(double* %DP, double %Arg) {
        %D = load double, double* %DP           ; <double> [#uses=1]
similarity index 92%
rename from test/ExecutionEngine/OrcJIT/test-global-ctors.ll
rename to test/ExecutionEngine/OrcMCJIT/test-global-ctors.ll
index da911d9f4bf7a1ce094af90d03e3c8bea7099930..d66efc27fb4199f63f59a9178e0c4b8aac050b85 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 ; XFAIL: darwin
 @var = global i32 1, align 4
 @llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @ctor_func }]
similarity index 91%
rename from test/ExecutionEngine/OrcJIT/test-global-init-nonzero-sm-pic.ll
rename to test/ExecutionEngine/OrcMCJIT/test-global-init-nonzero-sm-pic.ll
index 158d64f51e07616294441e5433292aff95590d87..7f66aec77078bd98505c2a04ca8360ac853cedc5 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -relocation-model=pic -code-model=small %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit -relocation-model=pic -code-model=small %s > /dev/null
 ; XFAIL: mips, aarch64, arm, i686, i386
 
 @count = global i32 1, align 4
similarity index 95%
rename from test/ExecutionEngine/OrcJIT/test-global-init-nonzero.ll
rename to test/ExecutionEngine/OrcMCJIT/test-global-init-nonzero.ll
index 0fcf8f9ff21dd524e4069baf8168bb4bb7df4716..f8d43bffb8bd7db4ae0ec13c8334c89309035497 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 @count = global i32 1, align 4
 
similarity index 95%
rename from test/ExecutionEngine/OrcJIT/test-global.ll
rename to test/ExecutionEngine/OrcMCJIT/test-global.ll
index 96036e027835187aaf58d6842a56f272f3e8a84a..3e42caee12ca3545f75bf68b1d9d0040852da2e0 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 @count = global i32 0, align 4
 
similarity index 95%
rename from test/ExecutionEngine/OrcJIT/test-loadstore.ll
rename to test/ExecutionEngine/OrcMCJIT/test-loadstore.ll
index 9c298f45b4c38ab03595b94ce58215a22862cff1..d95d61a067ff736d3b7a51312c61ea499c47948b 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 define void @test(i8* %P, i16* %P.upgrd.1, i32* %P.upgrd.2, i64* %P.upgrd.3) {
        %V = load i8, i8* %P            ; <i8> [#uses=1]
similarity index 95%
rename from test/ExecutionEngine/OrcJIT/test-local.ll
rename to test/ExecutionEngine/OrcMCJIT/test-local.ll
index 5a08e47598b693ae50cc804a69361cca2a4f05fa..1e63d9f231fdd31146cdbb18a5ad28b3bdbee85c 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 define i32 @main() nounwind uwtable {
 entry:
similarity index 93%
rename from test/ExecutionEngine/OrcJIT/test-logical.ll
rename to test/ExecutionEngine/OrcMCJIT/test-logical.ll
index aa8e5def010bd43e9a84cc064438e59eea12770d..9d53ac96e2fe0006b4487196b6fcd77563609455 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 define i32 @main() {
        %A = and i8 4, 8                ; <i8> [#uses=2]
similarity index 86%
rename from test/ExecutionEngine/OrcJIT/test-loop.ll
rename to test/ExecutionEngine/OrcMCJIT/test-loop.ll
index 5cb93530bb1b548c1ea90e25de17e541d1612065..dfb62d355e0878d2b396ca73f8077ee52d9d0aac 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 define i32 @main() {
 ; <label>:0
similarity index 93%
rename from test/ExecutionEngine/OrcJIT/test-phi.ll
rename to test/ExecutionEngine/OrcMCJIT/test-phi.ll
index 880a9169c6200f60bd4d23dc081cd6e8f790f24d..70bf8c82d448f9e351ad24a932a8ad0a75d841d4 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 ; test phi node
 @Y = global i32 6              ; <i32*> [#uses=1]
similarity index 88%
rename from test/ExecutionEngine/OrcJIT/test-ptr-reloc-sm-pic.ll
rename to test/ExecutionEngine/OrcMCJIT/test-ptr-reloc-sm-pic.ll
index 057fc0d620b6986f39f100049f73b13d89db2807..6e0a425623b7ff34c2bf1d8f4590cffbf7feb9ce 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -O0 -relocation-model=pic -code-model=small %s
+; RUN: %lli -jit-kind=orc-mcjit -O0 -relocation-model=pic -code-model=small %s
 ; XFAIL: mips, aarch64, arm, i686, i386
 
 @.str = private unnamed_addr constant [6 x i8] c"data1\00", align 1
similarity index 93%
rename from test/ExecutionEngine/OrcJIT/test-ptr-reloc.ll
rename to test/ExecutionEngine/OrcMCJIT/test-ptr-reloc.ll
index 014fa9dcafb6c8323c8cd505b279b4ad4ee017cc..a3846aa26e4985b4cf8f8c12f8571330932a1370 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit -O0 %s
+; RUN: %lli -jit-kind=orc-mcjit -O0 %s
 
 @.str = private unnamed_addr constant [6 x i8] c"data1\00", align 1
 @ptr = global i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), align 4
similarity index 90%
rename from test/ExecutionEngine/OrcJIT/test-ret.ll
rename to test/ExecutionEngine/OrcMCJIT/test-ret.ll
index 71ff45246d1a94c85d719815369dfc2ca5733a11..000bea02e97c80fe3d05e277f313a4822e12cc85 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 ; test return instructions
 define void @test1() {
similarity index 71%
rename from test/ExecutionEngine/OrcJIT/test-return.ll
rename to test/ExecutionEngine/OrcMCJIT/test-return.ll
index 07e74b060b8932b93cd14698a4a8a1703aa29957..f7a1cdda07050544cf8a40c6e95224ecac2af541 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 define i32 @main() nounwind uwtable {
 entry:
similarity index 95%
rename from test/ExecutionEngine/OrcJIT/test-setcond-fp.ll
rename to test/ExecutionEngine/OrcMCJIT/test-setcond-fp.ll
index d708b90cef0e53ddaded36d94b6afdebbfcd4543..8514c8df820f0added450ee6fb023671e94def10 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 
 define i32 @main() {
similarity index 98%
rename from test/ExecutionEngine/OrcJIT/test-setcond-int.ll
rename to test/ExecutionEngine/OrcMCJIT/test-setcond-int.ll
index b801d97e8221413e3d96ddd29efa17cf2178dea1..2f63d0bbef37094af57e0a4ff0c9a8b357222cd8 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 define i32 @main() {
        %int1 = add i32 0, 0            ; <i32> [#uses=6]
similarity index 96%
rename from test/ExecutionEngine/OrcJIT/test-shift.ll
rename to test/ExecutionEngine/OrcMCJIT/test-shift.ll
index 500987c8b65d5b5699c44cbbdc6a4868bf055c3e..2d064211cf5431f32d758801991da4f484aba8a8 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli -use-orcmcjit %s > /dev/null
+; RUN: %lli -jit-kind=orc-mcjit %s > /dev/null
 
 define i32 @main() {
        %shamt = add i8 0, 1            ; <i8> [#uses=8]
index 60c731b6b0cf1fa8eade425db1c67bc417623d28..f98275b5fe6c59863ed89db41e9b76a224e27bef 100644 (file)
@@ -35,6 +35,7 @@ endif( LLVM_USE_INTEL_JITEVENTS )
 
 add_llvm_tool(lli
   lli.cpp
+  OrcLazyJIT.cpp
   RemoteMemoryManager.cpp
   RemoteTarget.cpp
   RemoteTargetExternal.cpp
diff --git a/tools/lli/OrcLazyJIT.cpp b/tools/lli/OrcLazyJIT.cpp
new file mode 100644 (file)
index 0000000..4a8d3b9
--- /dev/null
@@ -0,0 +1,53 @@
+//===------ OrcLazyJIT.cpp - Basic Orc-based JIT for lazy execution -------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "OrcLazyJIT.h"
+#include "llvm/ExecutionEngine/Orc/OrcTargetSupport.h"
+
+using namespace llvm;
+
+std::unique_ptr<OrcLazyJIT::CompileCallbackMgr>
+OrcLazyJIT::createCallbackMgr(Triple T, LLVMContext &Context) {
+  switch (T.getArch()) {
+    default:
+      // Flag error.
+      Error = true;
+      return nullptr;
+
+    case Triple::x86_64: {
+      typedef orc::JITCompileCallbackManager<CompileLayerT,
+                                             orc::OrcX86_64> CCMgrT;
+      return make_unique<CCMgrT>(CompileLayer, Context, 0, 64);
+    }
+  }
+}
+
+int llvm::runOrcLazyJIT(std::unique_ptr<Module> M, int ArgC, char* ArgV[]) {
+  OrcLazyJIT J(std::unique_ptr<TargetMachine>(EngineBuilder().selectTarget()),
+               getGlobalContext());
+
+  if (!J.Ok()) {
+    errs() << "Could not construct JIT.\n";
+    return 1;
+  }
+
+  auto MainHandle = J.addModule(std::move(M));
+  auto MainSym = J.findSymbolIn(MainHandle, "main");
+
+  if (!MainSym) {
+    errs() << "Could not find main function.\n";
+    return 1;
+  }
+
+  typedef int (*MainFnPtr)(int, char*[]);
+  auto Main = reinterpret_cast<MainFnPtr>(
+                static_cast<uintptr_t>(MainSym.getAddress()));
+
+  return Main(ArgC, ArgV);
+}
diff --git a/tools/lli/OrcLazyJIT.h b/tools/lli/OrcLazyJIT.h
new file mode 100644 (file)
index 0000000..577c171
--- /dev/null
@@ -0,0 +1,97 @@
+//===--- OrcLazyJIT.h - Basic Orc-based JIT for lazy execution --*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// Simple Orc-based JIT. Uses the compile-on-demand layer to break up and
+// lazily compile modules.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_TOOLS_LLI_ORCLAZYJIT_H
+#define LLVM_TOOLS_LLI_ORCLAZYJIT_H
+
+#include "llvm/ADT/Triple.h"
+#include "llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h"
+#include "llvm/ExecutionEngine/Orc/CompileUtils.h"
+#include "llvm/ExecutionEngine/Orc/IRCompileLayer.h"
+#include "llvm/ExecutionEngine/Orc/LazyEmittingLayer.h"
+#include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h"
+#include "llvm/IR/LLVMContext.h"
+
+namespace llvm {
+
+class OrcLazyJIT {
+public:
+
+  typedef orc::JITCompileCallbackManagerBase CompileCallbackMgr;
+  typedef orc::ObjectLinkingLayer<> ObjLayerT;
+  typedef orc::IRCompileLayer<ObjLayerT> CompileLayerT;
+  typedef orc::LazyEmittingLayer<CompileLayerT> LazyEmitLayerT;
+  typedef orc::CompileOnDemandLayer<LazyEmitLayerT,
+                                    CompileCallbackMgr> CODLayerT;
+  typedef typename CODLayerT::ModuleSetHandleT ModuleHandleT;
+
+  OrcLazyJIT(std::unique_ptr<TargetMachine> TM, LLVMContext &Context)
+    : Error(false), TM(std::move(TM)),
+      Mang(this->TM->getDataLayout()),
+      ObjectLayer([](){ return llvm::make_unique<SectionMemoryManager>(); }),
+      CompileLayer(ObjectLayer, orc::SimpleCompiler(*this->TM)),
+      LazyEmitLayer(CompileLayer),
+      CCMgr(createCallbackMgr(Triple(this->TM->getTargetTriple()), Context)),
+      CODLayer(LazyEmitLayer, *CCMgr) { }
+
+  bool Ok() const { return !Error; }
+
+  ModuleHandleT addModule(std::unique_ptr<Module> M) {
+    // Attach a data-layout if one isn't already present.
+    if (M->getDataLayout().isDefault())
+      M->setDataLayout(*TM->getDataLayout());
+
+    std::vector<std::unique_ptr<Module>> S;
+    S.push_back(std::move(M));
+    return CODLayer.addModuleSet(std::move(S));
+  }
+
+  orc::JITSymbol findSymbol(const std::string &Name) {
+    return CODLayer.findSymbol(mangle(Name), true);
+  }
+
+  orc::JITSymbol findSymbolIn(ModuleHandleT H, const std::string &Name) {
+    return CODLayer.findSymbolIn(H, mangle(Name), true);
+  }
+
+private:
+
+  std::unique_ptr<CompileCallbackMgr>
+  createCallbackMgr(Triple T, LLVMContext &Context);
+
+  std::string mangle(const std::string &Name) {
+    std::string MangledName;
+    {
+      raw_string_ostream MangledNameStream(MangledName);
+      Mang.getNameWithPrefix(MangledNameStream, Name);
+    }
+    return MangledName;
+  }
+
+  bool Error;
+  std::unique_ptr<TargetMachine> TM;
+  Mangler Mang;
+
+  ObjLayerT ObjectLayer;
+  CompileLayerT CompileLayer;
+  LazyEmitLayerT LazyEmitLayer;
+  std::unique_ptr<CompileCallbackMgr> CCMgr;
+  CODLayerT CODLayer;
+};
+
+int runOrcLazyJIT(std::unique_ptr<Module> M, int ArgC, char* ArgV[]);
+
+} // end namespace llvm
+
+#endif
index cc8117d6e7a8667bb5ad74c17a054d4725f4f28b..47ce2c0ac34ef85dba894c622a16767c1d9db48a 100644 (file)
@@ -14,6 +14,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/IR/LLVMContext.h"
+#include "OrcLazyJIT.h"
 #include "RemoteMemoryManager.h"
 #include "RemoteTarget.h"
 #include "RemoteTargetExternal.h"
@@ -66,6 +67,9 @@ using namespace llvm;
 #define DEBUG_TYPE "lli"
 
 namespace {
+
+  enum class JITKind { MCJIT, OrcMCJITReplacement, OrcLazy };
+
   cl::opt<std::string>
   InputFile(cl::desc("<input bitcode>"), cl::Positional, cl::init("-"));
 
@@ -76,12 +80,19 @@ namespace {
                                  cl::desc("Force interpretation: disable JIT"),
                                  cl::init(false));
 
-  cl::opt<bool> UseOrcMCJITReplacement("use-orcmcjit",
-                                       cl::desc("Use the experimental "
-                                                "OrcMCJITReplacement as a "
-                                                "drop-in replacement for "
-                                                "MCJIT."),
-                                       cl::init(false));
+  cl::opt<JITKind> UseJITKind("jit-kind",
+                              cl::desc("Choose underlying JIT kind."),
+                              cl::init(JITKind::MCJIT),
+                              cl::values(
+                                clEnumValN(JITKind::MCJIT, "mcjit",
+                                           "MCJIT"),
+                                clEnumValN(JITKind::OrcMCJITReplacement,
+                                           "orc-mcjit",
+                                           "Orc-based MCJIT replacement"),
+                                clEnumValN(JITKind::OrcLazy,
+                                           "orc-lazy",
+                                           "Orc-based lazy JIT."),
+                                clEnumValEnd));
 
   // The MCJIT supports building for a target address space separate from
   // the JIT compilation process. Use a forked process and a copying
@@ -404,6 +415,9 @@ int main(int argc, char **argv, char * const *envp) {
     return 1;
   }
 
+  if (UseJITKind == JITKind::OrcLazy)
+    return runOrcLazyJIT(std::move(Owner), argc, argv);
+
   if (EnableCacheManager) {
     std::string CacheName("file:");
     CacheName.append(InputFile);
@@ -430,7 +444,7 @@ int main(int argc, char **argv, char * const *envp) {
   builder.setEngineKind(ForceInterpreter
                         ? EngineKind::Interpreter
                         : EngineKind::JIT);
-  builder.setUseOrcMCJITReplacement(UseOrcMCJITReplacement);
+  builder.setUseOrcMCJITReplacement(UseJITKind == JITKind::OrcMCJITReplacement);
 
   // If we are supposed to override the target triple, do so now.
   if (!TargetTriple.empty())