►
From YouTube: LLJB 20190829
Description
Presentation on how to leverage Eclipse OMR JitBuilder API to convert LLVM IR to OMR IL to generate optimal native machine instructions across a variety of platforms OMR supports.
A
A
A
So
what
motivated
this
project
is
that
LVM
is
something
that
is
used
widely
by
many
language.
There
is
rust,
Lewis
wept,
Giulia
and
probably
one
that
almost
all
of
us
worked
with
clients.
So
what
a
Bellevue
compiler
infrastructure
project
is
a
collection
of
compiler
and
tool
chain
technologies
such
as
ll
allow
the
VM
debugger
at
all
day
B,
and
then
they
also
have
an
implementation
of
the
C++
standard
library
live
C++,
and
then
they
also
have
a
linker
LLD,
and
then
they
provide
multiple
tools
for
creating
language.
Funions
such
as
you
know.
A
So,
if
you
want
to
create
any
content
for
any
kind
of
program
language,
they
provide
a
bunch
of
tools
to
help.
You
do
that
and
there's
also
tools
available
for
creating
new,
back
and
compilers
for
new
architectures,
and
there
are
many
more
components
of
the
VM
project
and
we
can
spend
all
day
talking
about
that.
A
But
that's
not
the
point
of
this
presentation
and
though
the
most
one
of
the
most
important
component
of
LVM
ecosystem
is
the
LOV
Mir
and
if
the
core
language
used
to
be
able
to
facilitate
the
compilation
of
different
source
languages
to
different
target
platform,
and
so
this
is
something
that
we're
going
to
discuss
important
details
later.
So
here's
an
overview
of
how
compilers
finance
generate
LLVM
IR
from
the
different
source
languages.
A
So,
while
our
VM
is
mainly
used
for
static
compilations,
the
or
Marc
compiler
is
more
suited
towards
the
dynamic
compilation
situations,
and
because
of
that,
it
could
be
the
better
option
for
languages
that
are
currently
using
LVM
as
their
debt
compiler
and
for
their
dynamic
compositions.
But
the
problem
is
that
the
OM
ril
is
very
a
lot
more
complex
than
a
low
V
Mir.
We
have
a
lot
more
operation.
A
There
are
a
lot
more
that
we
have
to
deal
with
than
just
simply
generating
a
lot
of
the
Mir.
So
that's
where
jet
water
comes
in
it's
a
library
that
provides
an
easy
interface
into
the
Omar
compiler
technology
and
it's
already
used
by
a
number
of
projects,
including
loj,
be
it
simplifies
the
process
of
constructing
Omar
compiler,
il
using
tables
or
API.
A
So
the
digital
API
provides
a
number
of
services
to
construct
or
mariah's,
such
as
add,
lower
store
and
so
on.
You
can
even
create
control
flow
paths
using
services
such
as
co2
and
if-then-else
and
so
on
and
having
to
filter
having
to
like
jet
builder,
makes
it
easier
for
languages
to
make
use
of
the
Omar
compiler
with
a
lot
less
effort
than
extending
the
Omar
compiler
themselves.
A
So
now
what
if
we
had
a
way
to
compile
about
the
Empire
using
the
Omar
compiler
that'll
make
it
a
lot
easier
for
many
languages
to
try
out
the
Omar
color
and
the
kind
of
tool
that
we
need,
for.
That
is
something
that
can
translate
LLVM
IR
into
Omar
compiler
I
out,
and
so
basically,
if
any
language
has
any
kind
of
tool
that
can
generate
all
VM
IR
from
their
source
code,
then
they
can.
They
can
compile
using
of
a
more
compiler
which
in
minimal
effort.
So
that's
that's
what
all
of
the
Vedas.
A
So
it's
a
library
that
enables
you
to
compile
our
VM
file
modules
using
the
Omar
compiler
and
it
takes
a
legume
ion
modules
as
input
and
uses
a
Diplo
library
to
generate
compiler
il
and
then
the
o1
compiler
performs
optimizations
and
generates
native
code
for
different
platforms.
As
you
can
see
here,
we
replace
LLVM
back-end
entirely.
We
just
start
with
the
LOV
Mir.
We
use
the
LLVM
ayurveda
library
to
convert
the
ir
into
something
that
we
can
consume
and
then
ljb
uses
a
digital
api
to
construct
form.
Ri,
l.
A
So,
let's
look
at
a
little
little
bit
more
in
jello
DMARC,
so
it's
a
single
it's
a
static,
single
assignment,
based
representation
and
and
the
two
and
the
two
key
points
to
remember
about
the
SSA
form
is
that
values
can
only
be
defined
once
and
values
must
be
defined
before
they're
used.
But
it's
not
always
strictly
to
say
for
LLVM
wire
because
they
do
allow
it
video.
They
do
not
require
you
to
adhere
to
SSA
for
memory
operations,
and
there
are
three
different
modes
of
representing
Co
V
Mir.
A
A
Hello,
and
in
this
presentation
we
are
going
to
mostly
C
dot
hello,
because
if
more
is
both
human
readable
and
it's
also
something
that
can
be
easily
consumed
so
I
feel
like
we
should
look
a
little
bit
into
SSA
so
that
the
I
heart
that
you
see
in
the
later
slide
are
a
little
bit
easier
to
understand.
So
in
this
example,
we
have
a
equals.
One
then
a
equals
a
plus
two
and
B
equals
a
so.
The
rule
that
we're
breaking
is
that
values
can
be
defined
one,
but
here
we
are
defining
a
twice.
A
A
So
now,
converting
this
to
other
say
form
we
for
block
1
I've
already
talked
about
how
that's
done
and
then
block
2
&
3.
There
are
two
different
definitions
of
C,
which
is
why
we
have
to
label
them
differently,
so
we
have
C
sub
1
equals
1
and
a
C
sub,
2
or
2,
and
then,
when
we
merge
onto
for
B,
these
are
1
can
be
either
C,
sub,
1
or
C
sub
2.
A
And
we
don't
know
that
and
how
do
we
and
that's
where
we
need
a
fee
function
to
evaluate
where
that
we
got
here
from
so
that's
where
we
entered
a
fee,
a
fee
function
and
the
result
of
the
fee
function
is
a
to
a
different,
very
well
III
and
and
then
D
one
does
take
c3.
So
in
this
example,
if
we
arrived
from
block
two
then
pick
C
1
and
if
we
arrived
from
block
3,
then
pick
C,
2
and
assign
that
to
C
3
and
D
1
equals
theta,
3
plus
1.
A
So
now
that
we
have
some
understanding
of
the
SSA
form,
we
can
look
at
some
actual
LLVM
IR.
So
this
is
a
very
simple
C++
program.
We're
just
trying
to
do
some
situations
it
and
just
using
this
example,
because
it's
simple
and
hopefully
easier
to
understand
as
well.
So
in
order
to
generate
the
SSA
form
of
that
sorry,
the
IR
for
that
we
use
blanks
as
both
the
front
end
and
we
instruct
it
to
Emma
just
LLVM
IR
and
we
generate
a
dot
hello.
A
So
here
is
how
a
module
looks
like
you're,
going
to
have
you're
going
to
see
many
things
in
this
module.
I'm
going
to
talk
about
all
the
things
here.
The
comments
began
with
my
column,
and
then
we
have
the
target
information
lizard
near
the
top,
and
then
a
function
can
have
one
or
more
basic
blocks.
A
In
this
case,
there
is
only
one
basic
block:
we're
going
to
see
how
different
how
a
function
with
different,
multiple
basic
blocks-
click
like
and
then
each
basic
block
is
going
to
contain
one
or
more
instructions,
and,
as
you
can
see
here,
we
don't
really
have
any
of
the
variable
names
in
this
over
here.
They
have
all
been
transformed
into
unnamed
temporaries,
so
x,
y&z
that
we
have
previously
is
now
percent
1
percent
2
+
%
3
respectively
and.
A
Basic
blocks
are
also
assigned
one
of
these
percent
values,
and
it's
not
like
with
the
numbering
begins
at
percent.
One
is
actually
a
percent
zero.
We
don't
see
here,
but
person
0
refers
to
the
entry
basic
block
so
and
then
there
is
also
going
to
be
different,
functional
attributes
near
the
bottom.
Then
there
will
be
some
metadata
string
and
metadata
knows.
A
So
the
first
instruction
from
the
IRS
that
we
saw
is
allocate.
So
what
LK
does
is
allocates
memory
on
the
stack
frame
and
the
return
value
that
is
captured
in
percent
1.
Is
there
a
pointer
to
the
allocated
memory
and
and
and
also
it
specifies,
the
type
for
which
you're
allocating
the
memory
as
I
32?
So
you
can
read
and
write
from
the
allocated
memory
using
stores
and
load
respectively.
Sorry,
a
Galloway
so
they're
equivalent
in
polar
API
or
the
closest
to
it,
would
be
create
local
array
and.
B
A
But
the
problem
was
that
we
are
accessing
a
slot
in
an
aggregate,
and
the
generated
code
is
slow
because
we
are
a
few
magic
cannot
see
through
these
local
variable
accesses
and
which
is
why
we
switch
to
define
local
and
the
defined
local
service
you
can
define.
You
can
specify
a
variable
name
and
the
data
type
to
create
a
slot
for
a
local
variable
and,
and
the
problem
with
that
was
that,
as
you
saw
in
the
IR,
that
local
variables
don't
really
get
a
name.
B
A
The
next
type
of
instruction,
we
see,
is
a
store
which
is
used
for
writing
to
memory
and
in
this
instruction
the
first
argument
is
to
SB
is
what
you
actually
want
to
write,
which
is
either
a
2:1
imperative.
Constant,
and
the
second
argument
is
o
is
the
location
directive
which
is
%
1,
so
right,
constant
1
into
a
variable
%
1.
It
doesn't
return
anything.
So
we
don't
really
need
new,
very
new
SS,
a
very
good
value,
to
store
anything
to
capture
anything,
and
there
are
two
different
things
we
see
here.
A
One
is
that
we
have
to
create
a
constant
and
then
we
also
need
to
perform
a
store.
So
there
are
two
different,
zip
folder
services.
We
have
to
use
to
handle
this
instructions,
so
the
first
service
is
Const
n
32
and
you
use
that
to
create
a
constant
32-bit
console
node
and
there
are
different
services
for
creating
constants
of
other
data
sizes
as
well,
and
the
return
il
value
represents
the
created
node.
A
And
then
we
have
the
store
service
where
you
have
to
specify
the
variable
name,
which
is
probably
something
we
generated
earlier,
and
we
specify
the
value
at
the
aisle
value
to
store.
So
we
just
and
for
that
we
use
the
return
of
that
of
calling
because
interactive
service
and
below
you
can
see
the
example
of
the
il
that
is
generated.
A
So
the
next
type
of
instruction
we
see
is
a
load
instruction
and
that
is
used
for
reading
from
memory
and
you
specify
the
type
of
type
of
data
to
load
and
the
percent
percent
for
variable
is
used
to
represent
the
return
of
this
load
instruction
and
we
have
a
similar
service
in
the
polar
API.
But
and
we
have
to
specify
the
variable
to
load
and
and
the
return
oil
value
represents
a
load
of
that.
A
So
the
next
type
of
instruction
we
see
is
a
ad
and
there
is
a
flag.
That's
not
really
relevant
to
our
presentation.
No
sign
wrap
is
used
to
specify
that
the
result
of
this
addition
is
supposed
to
be
a
Poisson
value
and
it
affects
the
behavior
of
certain
instructions
later,
but
not
relevant
here,
and
they
take
the
operands
to
add
and
the
return
value
represents
the
result
of
that
addition,
which
in
this
case
is
present
six
and
then
we
also
have
something
like
that.
A
And
the
next
and
the
final
instruction
we
see
is
the
read
instruction
which
is
used
for
returning
control
flow
to
the
collar
and
the,
and
it
can
be
either
a
voyage
return
or
you
can
return
any
other
value
depending
on
the
function,
return
type
in
this
case.
It's
a
in
32,
return,
type
and
indeed
builder.
We
also
have
a
return
service
to
handle
them
like
that,
and
it
can
either
be
a
void,
return
or
return
of
a
void
of
an
aisle
value.
A
So
now
that
we
understand
some
of
the
instructions
and
have
an
idea
of
some
equivalent
dibbler
services
to
handle
these
instructions,
we
can
go
through
the
steps
that
loj
B
takes,
do
construct
something
to
construct
something
similar
to
this
for
a
into
Omar
il,
and
there
are
two
tables
that
we
are
going
to
have
to
maintain,
and
one
is
the
LLVM
value
to
variable
name
for
the
a
low
key
instructions
and
for
everything
else.
We
have
to
have
a
mapping
of
the
LLVM
value
to
the
IL
value
table.
So,
let's.
A
First
one
so
4%
one
define
local
and
we
generate
a
name
for
that
variable,
R
1
and
then
we
map
%
1
to
the
name
R
1,
and
then
we
are
the
same
for
the
others.
As
you
can
see,
a
local
tip,
local
variable
name
table
is
growing
and
then
the
next
thing
we
do
is
to
store,
and
in
this
instruction
we
are
storing
constant
32
1.
So
we
create
that
constant
node,
and
then
we
get
the
name
that
we
got
we
store
previously
and
we
just
look
up
that
table
and
we
get
R
1.
A
A
So
the
result
of
this
load
in
vir
is
being
captured
by
%
4,
and
we
have
to
map
the
result
of
this
load
service
into
into
this
table
and
have
percent
for
map
to
load,
get
get
name,
person
1
and
then,
similarly,
for
this
instruction
2
and
then
we
perform
an
addition,
and
here
we
have
to
access
that
table
to
get
the
value
that
PS.
Previously
we
have
we
previously
strolling
the
table
and
we,
the
operands,
are
percent
four
percent
five
and
the
gate
function
returns.
A
The
il
value
that
have
been
mapped,
two
percent
fourteen
percent
five,
and
then
we
perform
a
store
in
two
percent
three,
and
we
get
get
name
with.
Return
are
three
and
we
store
resent
six,
which
is
the
result
of
that
addition
into
variable
are
three
and
then
we
perform
a
load
in
two
percent,
seven
and
then
return
percent.
Seven-
and
this
is
this-
is
the
il
that
is
generated
after
that
and
the
Omar
compiler
generates
native
code.
Yeah
I
know
what
you
think.
A
So
I'll
just
talk
little
bit
more
about
how
this
works.
There
are
four
basic
blocks
in
this
function,
and
percent
0
correspond
to
the
first
basic
block.
The
second
basic
block
is
%
7
and
%.
8
is
the
third
one
and
then
the
final
basic
block
is
%
9
and
there-
and
you
can
know,
is
that
there
are
two
types
of
branch
instructions
there:
a
conditional
branch
instruction
that
takes
three
arguments,
which
is
the
condition
and
then
path
to
take.
If
true
and
how
to
take
a
fall.
A
So
multiple
basic
of
I
hope
builders
allow
us,
do
you
create
the
il
specific
to
each
basic
block
in
dependency,
and
then
they
can
all
be
connected
together
based
on
of
the
branch
instructions.
So
one
we
have
an
unconditional
branch
instruction.
We
just
have
to
get
the
destination
basic
block
and
and
then
you
have
used
that
to
find
out
the
il
builder,
that's
mapped
to
it
and
then
use
the
go-to
service
to
create
a
current
conditional
jump
to
that
basic
block
and
for
the
condition
ones
is
similar.
A
We
have
to
get
the
condition
value,
and
then
we
get
the
two
different
possible
paths,
and
then
we
use
if-then-else
to
construct
a
conditional
path,
and
now
we
get
back
into
Pinot's
and
how
they
look
in
hello.
Vmi
are
so
Pinos
in
ovm
ir
are
used
to
selectively
value
based
on
the
incoming
basic
block.
In
this
example,
%
13
is
assigned
the
result
of
that
3
function
and
over
here,
if
we
arrived
from
basic
block
percent
six,
then
the
value
that
we
pick
for
person
13
is
a
percent.
A
Eighty
we
arrived
from
basic
block
%
9.
Then
we
take
presenter
love.
So
how
do
we
deal
with
that?
Well,
this
is
when
I.
This
is
when
the
Tonys
select
service
is
used.
So
select
service
is
something
that
is
used
to
evaluate
a
condition
and
then
select
either
either
one
of
the
values
based
on
the
condition
and
then
return
the
value
that
has
been
selected
and
the
service
was
actually
in
motivated
by
the
ljv
project
to
implement
the
select
instructions
and,
and
now
it
has
even
become
useful
in
handling
of
c-note.
A
So
here's
an
example
of
how
the
aisle
generated
by
this
service
looks
like
so
in
this
example
were
to
determine
whether
we
arrived
from
basic
ball
percent
6
percent
9.
We
just
need
to
evaluate
%
8,
so
8
percent
8
was
represented.
Heat
was
a
true
than
we
would
have
arrived,
so
what
we
need
to
do
is
evaluate
%.
A
8
and
a
person
is
true:
we
jump
to
person
all
right,
okay,
so
we
use
a
select
service
and
then
math
%
13
to
the
return
value,
and
then
the
only
condition
argument
we
have
to
use
is
%
8
and
then
get
%.
8
is
the
true
value
argument.
If
we
arrive
from
there
and
then
get
%,
ik
11
is
the
false
value
argument.
If
we
arrived
from,
which
will
be
the
case
if
we
arrive
from
block
9,
so
the
current
status
of
the
ljv
project
is
so.
A
So
that
includes
calling
different
functions,
passing
parameters
and
we
also
prefer
a
support
aggregate
type
such
as
a
struct
and
multiple
dimensional
arrays
and
then
accessing
data
in
those
aggregate
type.
And
then
we
support
different
types
of
comparisons
and
arithmetic
operations,
bitwise
operations,
type,
conversions
and
a
lot
more.
A
So
now,
let's
talk
about
some
of
the
performance
numbers
that
we
observed
and
the
device
used
for
taking
these
measurements
is
a
15-inch
2015,
MacBook,
Pro
and
the
time
measurements
that
I
have
in
my
charts
are
just
the
time
to
last
during
the
execution
of
the
program,
and
it
does
not
include
the
time
taken
to
compile
them.
And
then
there
are
three
different
modes
of
execution
we
used.
A
A
So
and
then
we
also
have
a
native
complete
compilation
at
the
all
three
optimization
level,
and
then
we
have
a
low
J,
be
running
the
code
at
home,
optimization
level
and
the
starting
point
of
all
the
of
this
program
was
where
all
the
C++
programs
and
we
use
clang
to
generate
dir
that
was
provided
to
L
ojv
and
LOV
M
interpreters
and
planned
the
straight-up
compiled
natively.
Restarting
the
CSS
code
into
the
executable.
A
So
here
is
the
result
of
running
Mandelbrot
set
with
the
iteration
limits
set
at
3
million
just
so
that
I
could
get
a
significant
number
to
get
to
get
a
notice
about
time,
different
measurement
and,
as
you
can
see,
the
LLVM
interpreter
with
JIT
at
O.
3
is
significantly
slower
and
we
are
just
a
little
bit
behind
natively
compiled
code
and
yeah
and
I.
A
It's
the
2.4
seconds
and
loj
be
compiled.
Code
takes
five
point
seven
one
seconds
in
this
case.
We
are
actually
a
lot
more
behind
than
the
previous
example
right
here,
and
this
is.
These
are
just
the
numbers
that
we
get
right
now
and
hopefully
we
can
investigate
later
and
get
closer
to
the
native
compilation.
A
So
the
currently,
the
limitations
are
that
we
don't
have
support
for
interest
rate,
intrinsic
instructions.
I
will
being
provided
a
number
of
interesting,
intrinsic
instructions
to
perform
many
operations,
such
as
mem
copy
and
memmove
and
so
on,
and
we
don't
have
support
for
that
yet.
But
it
is
a
feature
goal
we're
going
to
work
on.
A
But
we
don't
have
that
in.
We
don't
have
that
in
people
there
yet,
but
that's
another
feature
goal
that
we
would
like
to
implement
later
and
there
are
currently
LGB
only
handles
running
just
a
single
module
at
a
time
in
the
future.
I
will
be
working
on
being
able
to
load
multiple
modules
and
call
functions
between
them
and
we
don't
have
any
metrics
for
measuring
runtime.
B
A
Hope
to
get
some
sort
of
metrics
that
are
compare,
how
much
improvement
using
the
Walmart
compiler
brings
compared
to
using
the
LLVM
jet.
And
finally,
you
would
like
to
have
yellow
JB,
contributed
to
the
Omar
project.
I
see
this
as
a
very
useful
tool
that
could
be
used
in
a
number
of
a
number
of
situations
and
the
perhaps
it
will
be
a
sub-project
of
jet
builder
and
I
will
open
an
issue
in
the
open
future
and
look
where
we
can
have
a
discussion
about
where
it
can
live.
A
And
to
summarize
so
far
we
spoke
about
what
motivated
PLO
JB
project,
and
then
we
spoke
out
FSA
and
fellow
with
my
art.
And
then
we
went
over
how
well
LGV
constructs
Omar
il
from
LLVM
mire
and
then
talk
about
the
conscience
and
look
at
some
performance
numbers.
And
then
we
spoke
about
some
limitations
that
future
goals
and
if
you
have
any
questions,
I'm
happy
to
take
them.
A
A
B
A
So
the
question
was:
how
do
you
know
when
to
use
get
name
or
I
want
to
use,
get
valley
and
get
itself?
The
thing
is
we
maintain
a
table
where
you
know
we
know
what
it
would
be.
We
know
what
the
local
variables
are,
so
what
values
are
corresponding
to
the
local
variables.
So
in
that
case
we
have
this
function
called
we
have
this
function
called
again,
which
is
indirect,
load
or
store.
So
if
it's
an
indirect
loader
store,
that
means
we
we're
not
actually
trying
to
access
a
local
variable.