<?xml version="1.0" encoding="windows-1252"?>
<node id="990860" title="Re^3: Perl 5 Optimizing Compiler, Part 5: A Vague Outline Emerges" created="2012-08-30 18:06:47" updated="2012-08-30 18:06:47">
<type id="11">
note</type>
<author id="341121">
dave_the_m</author>
<data>
<field name="doctext">
(Damn, I said i wouldn't be responding further...)
&lt;p&gt;
&lt;blockquote&gt;&lt;i&gt;New code is adapted from Deparse. It processes the PCG in the normal way, but instead of (re)generating the Perl source code, it generates a LLVM IF "copy" of the PCG it is given. Let's call that the LLCG
&lt;/i&gt;&lt;/blockquote&gt;
This is the bit I don't currently get. take a piece of code like
&lt;c&gt;
$m = ($s =~ /foo/);
&lt;/c&gt;
&lt;p&gt;
Which is compiled to an optree that looks like:
&lt;c&gt;
7  &lt;@&gt; leave[1 ref] vKP/REFC -&gt;(end)
1     &lt;0&gt; enter -&gt;2
2     &lt;;&gt; nextstate(main 1 p:3) v:{ -&gt;3
6     &lt;2&gt; sassign vKS/2 -&gt;7
4        &lt;/&gt; match(/"foo"/) sKPS/RTIME -&gt;5
-           &lt;1&gt; ex-rv2sv sK/1 -&gt;4
3              &lt;#&gt; gvsv[*s] s -&gt;4
-        &lt;1&gt; ex-rv2sv sKRM*/1 -&gt;6
5           &lt;#&gt; gvsv[*m] s -&gt;6
&lt;/c&gt;
In general terms, what would the IR look like that you would convert that into?
&lt;p&gt;
Dave.</field>
<field name="root_node">
990666</field>
<field name="parent_node">
990790</field>
</data>
</node>
