Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

minor updates

  • Loading branch information...
commit fe85260a62b39e83b154c98346068ea31f0790e5 1 parent cc0735f
@duncantl authored
3  .gitignore
@@ -4,6 +4,9 @@ src/Makevars
26 Paper/Rllvm.tex
@@ -585,6 +585,32 @@ \section{Related Work}
efficient, among other things. \Rpkg{RLLVMCompile} is an \R{} package
that implements a simple compilation strategy for some \R{} idioms.
+The \Rpkg{r2c} package is an initial prototype of translating \R{}
+code directly \C. In some ways, it is similar to \Rpkg{Rllvm} in that
+it is compiling \R{} code. One difference is that the
+translator/compiler is written in \C{} code. This makes makes is
+somewhat more difficult to adapt and extend. The package generates
+\C{} code and then calls a system compiler such as \gcc{} or \clang{}
+to compile that code and so the user has a a choice of compiler.
+\Rllvm{} is specific to \llvm{}. While \llvm's IR code is
+human-readable and portable and can be read on different machines in
+different languages (e.g. \R, \Python), it is not a completely stable
+and standardized format. Accordingly, exchanging \C{} code may be more
+effective. We can also use the regular system-level tools such as the
+debugger to explore the generated code. However, the \Rllvm{}
+approach does allow us to use third-party, higher-level
+representations representations of the compiled instructions than
+string manipulation, e.g. the \Rclass{Module}, \Rclass{Function},
+\Rclass{BasicBlock} and \Rclass{Instruction} objects. We can query
+and modify these in a more structured manner than string manipulation.
+We are also hopeful that we will transparently benefit from any future
+developments in the \llvm{} project. Furthermore, while \llvm{} is
+low-level, this potentially gives us greater control over the code we
+% Different backends.
\section{Future Work}
We have manually created the bindings from \R{} to the \llvm{} API. We
1  R/
@@ -1,3 +1,4 @@
LLVMVersion = c(major = @LLVM_VERSION@, minor = @LLVM_MINOR_VERSION@)
2  explorations/cpp.R
@@ -35,6 +35,6 @@ if(addPassesToEmitFile(machine, pm, out, 0L))
run(pm, m)
-.Call("R_raw_ostream_close", stream)
+#.Call("R_raw_ostream_close", stream)
6 explorations/ptx.R
@@ -1,5 +1,5 @@
-m = Module("ptx")
+m = parseIR("experiments/fib.ll")
tri = "nvptx64"
@@ -19,7 +19,7 @@ addPass(pm, dataLayout)
#out = .Call("R_new_raw_string_ostream", "")
-out = formattedRawOstream("/tmp/foo.cpp")
-addPassesToEmitFile(machine, pm, out, 1L)
+out = formattedRawOstream("/tmp/foo.ptx")
+addPassesToEmitFile(machine, pm, out, 0L)
run(pm, m)
Please sign in to comment.
Something went wrong with that request. Please try again.