Browse files

minor updates

  • Loading branch information...
1 parent cc0735f commit fe85260a62b39e83b154c98346068ea31f0790e5 @duncantl committed Jun 29, 2013
Showing with 34 additions and 4 deletions.
  1. +3 −0 .gitignore
  2. +26 −0 Paper/Rllvm.tex
  3. +1 −0 R/
  4. +1 −1 explorations/cpp.R
  5. +3 −3 explorations/ptx.R
@@ -4,6 +4,9 @@ src/Makevars
@@ -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,3 +1,4 @@
LLVMVersion = c(major = @LLVM_VERSION@, minor = @LLVM_MINOR_VERSION@)
@@ -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)
@@ -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)

0 comments on commit fe85260

Please sign in to comment.