Learn R Programming

RLLVM

RLLVM is an R interface to LLVM. This interface allows one to create compiled code from within R through LLVM's intermediate representation (IR), which LLVM can then extensively and efficiently optimize.

For examples, see the RLLVM page on Omegahat.

The current repository builds against LLVM 3.5, 3.6, 3.7, and3.8. Importantly, recent versions of LLVM default to the MCJIT execution engine. This unfortunately has very limited ability to invoke routines compiled via Rllvm, i.e., using the .llvm() and run() functions. Acccordingly, we have implemented a simple (but reasonably comprehensive) mechanism to invoke these routines. We use the Rffi package to do this. We might shift to the rdyncall package.

So this package now requires the Rffi package. This comes with its own version of libffi, but will find a more up-to-date version if it is installed (see pkg-config).

These packages are not yet on CRAN.

Related packages are Rffi, Rllvm (this one), RLLVMCompile, RCUDA, RCIndex.

Copy Link

Version

Version

0.7-0

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

March 20th, 2019

Functions in Rllvm (0.7-0)

Block

Create an LLVM block
createIsNotNull

Create LLVM operations
declareFunction

Declare a function in a module
.llvm

Invoke an LLVM Function from R
clone

Collection of generic functions for LLVM objects
addCases

Add cases to a switch instruction
createICmp

Create an integer comparison instruction
createGlobalVariable

Define a native global variable
binOp

Create a binary operation instruction
ExecutionEngine

Create LLVM engine for calling functions
getGetElementPtr

Create LLVM instruction to access an element in an array or via pointer
getModuleFunctions

Get a list of the functions in an LLVM module
createLogicalConstant

Create constants in native code
getGlobalContext

Retrieve the default LLVM context
getPassManager

Create an LLVM pass manager
generatePTX

Generate PTX code to run on a NVIDIA GPU
getOpcode

Get the operation code/identifier for an LLVM instruction
Function

Create an LLVM function/routine
formattedRawOstream

Create and access LLVM output streams
getCallingConv

Get and set the calling convention for a routine
isCast

Miscellaneous functions operating on LLVM Instruction objects
getIntrinsic

Functions for working with LLVM Intrinsic routines
getSuccessor

Get different aspects of a Branch Instruction
llvmAddSymbol

Resolving external symbols
getValue

Get the value from an LLVM entity
isArrayType

Predicate functions for testing a type
isInBounds

Query or set bounds checking flag
InitializeNativeTarget

Initialize the LLVM engine for JIT operations
isa

Queries if an LLVM Instruction is a particular sub-type
IRBuilder

Create an IR builder object for LLVM construction
parseIRError

Raise an error from parseIR
setArgByVal

Set and Query Pass-By-Value Semantics for a Parameter
setAlignment

Set the alignment for an LLVM instruction or object
parseIR

Read LLVM Code in the Intermediate Representation (IR) Language
createAggressiveDCEPass

Create LLVM Pass Instances
Module

Create an LLVM module for one or more functions and variables
llvmDump

Create a text representation of an LLVM object
onlyReadsMemory

Determines if the LLVM does not write to memory
Rllvm-package

The Rllvm Package
RC++Reference-class

Class "RC++Reference"
simpleFunction

Define the skeleton of an LLVM Function
string

Initialize a string object
writeBitcode

Read and Write LLVM Bitcode
VoidType

Objects representing different LLVM common Types
setInitializer

Set the initializer for an LLVM Value
targetLibraryInfo

Functions related to different targets
setMetadata

Functions for working with LLVM metadata
arrayType

Miscellaneous functions for LLVM Types