<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
And related while we are at it, i.e. the coremark specials, we have this sitting in upstream review: <a href="https://reviews.llvm.org/D42365" id="LPlnk359956">https://reviews.llvm.org/D42365</a> </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
That should help a bit too. It needs a little bit of work, but I thought Dave didn't mind if someone commandeers and finishes it.<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> llvm-dev <llvm-dev-bounces@lists.llvm.org> on behalf of Sjoerd Meijer via llvm-dev <llvm-dev@lists.llvm.org><br>
<b>Sent:</b> 23 September 2020 20:03<br>
<b>To:</b> Phipps, Alan <a-phipps@ti.com>; llvm-dev@lists.llvm.org <llvm-dev@lists.llvm.org>; Eli Friedman <efriedma@quicinc.com>; Evgeny Astigeevich <Evgeny.Astigeevich@arm.com><br>
<b>Subject:</b> Re: [llvm-dev] Improved jump-threading in LLVM for finite state automata</font>
<div> </div>
</div>
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
+ Evgeny</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
We have a jump threading pass downstream for this that we would love to upstream. I believe Evgeny was working on exactly this, i.e. preparing it for upstreaming.<br>
</div>
<div id="x_appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> llvm-dev <llvm-dev-bounces@lists.llvm.org> on behalf of Eli Friedman via llvm-dev <llvm-dev@lists.llvm.org><br>
<b>Sent:</b> 23 September 2020 19:16<br>
<b>To:</b> Phipps, Alan <a-phipps@ti.com>; llvm-dev@lists.llvm.org <llvm-dev@lists.llvm.org><br>
<b>Subject:</b> Re: [llvm-dev] Improved jump-threading in LLVM for finite state automata</font>
<div> </div>
</div>
<div lang="EN-US">
<div class="x_x_WordSection1">
<p class="x_x_MsoNormal" style="margin-top: 0px; margin-bottom: 0px;margin:0in; font-size:11pt; font-family:"Calibri",sans-serif">
Nobody is currently working on this, as far as I know.  If you’re interested in looking into it, I’ll try to answer any questions.</p>
<p class="x_x_MsoNormal" style="margin-top: 0px; margin-bottom: 0px;margin:0in; font-size:11pt; font-family:"Calibri",sans-serif">
 </p>
<p class="x_x_MsoNormal" style="margin-top: 0px; margin-bottom: 0px;margin:0in; font-size:11pt; font-family:"Calibri",sans-serif">
-Eli</p>
<p class="x_x_MsoNormal" style="margin-top: 0px; margin-bottom: 0px;margin:0in; font-size:11pt; font-family:"Calibri",sans-serif">
 </p>
<div>
<div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0in 0in 0in">
<p class="x_x_MsoNormal" style="margin-top: 0px; margin-bottom: 0px;margin:0in; font-size:11pt; font-family:"Calibri",sans-serif">
<b>From:</b> llvm-dev <llvm-dev-bounces@lists.llvm.org> <b>On Behalf Of </b>Phipps, Alan via llvm-dev<br>
<b>Sent:</b> Wednesday, September 23, 2020 7:34 AM<br>
<b>To:</b> llvm-dev@lists.llvm.org<br>
<b>Subject:</b> [EXT] [llvm-dev] Improved jump-threading in LLVM for finite state automata</p>
</div>
</div>
<p class="x_x_MsoNormal" style="margin-top: 0px; margin-bottom: 0px;margin:0in; font-size:11pt; font-family:"Calibri",sans-serif">
 </p>
<p class="x_x_MsoNormal" style="margin-top: 0px; margin-bottom: 0px;margin:0in; font-size:11pt; font-family:"Calibri",sans-serif">
It is my understanding that the implementation for jump-threading in LLVM is not presently able to effectively optimize code containing a state-machine implemented using a loop + switch.  This is the case, for example, with the Coremark benchmark function core_state_transition(). 
 Bug 42313 was filed to address this in 2019:</p>
<p class="x_x_MsoNormal" style="margin-top: 0px; margin-bottom: 0px;margin:0in; font-size:11pt; font-family:"Calibri",sans-serif">
 </p>
<p class="x_x_MsoNormal" style="margin-top: 0px; margin-bottom: 0px;margin:0in; font-size:11pt; font-family:"Calibri",sans-serif">
<a href="https://bugs.llvm.org/show_bug.cgi?id=42313">https://bugs.llvm.org/show_bug.cgi?id=42313</a></p>
<p class="x_x_MsoNormal" style="margin-top: 0px; margin-bottom: 0px;margin:0in; font-size:11pt; font-family:"Calibri",sans-serif">
 </p>
<p class="x_x_MsoNormal" style="margin-top: 0px; margin-bottom: 0px;margin:0in; font-size:11pt; font-family:"Calibri",sans-serif">
It appears that GCC improved support for jump threading in 2015 along the same lines:</p>
<p class="x_x_MsoNormal" style="margin-top: 0px; margin-bottom: 0px;margin:0in; font-size:11pt; font-family:"Calibri",sans-serif">
 </p>
<p class="x_x_MsoNormal" style="margin-top: 0px; margin-bottom: 0px;margin:0in; font-size:11pt; font-family:"Calibri",sans-serif">
<a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54742">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54742</a></p>
<p class="x_x_MsoNormal" style="margin-top: 0px; margin-bottom: 0px;margin:0in; font-size:11pt; font-family:"Calibri",sans-serif">
 </p>
<p class="x_x_MsoNormal" style="margin-top: 0px; margin-bottom: 0px;margin:0in; font-size:11pt; font-family:"Calibri",sans-serif">
Is anyone aware of any plan to do improve LLVM jump-threading along the same lines for LLVM?</p>
<p class="x_x_MsoNormal" style="margin-top: 0px; margin-bottom: 0px;margin:0in; font-size:11pt; font-family:"Calibri",sans-serif">
 </p>
<p class="x_x_MsoNormal" style="margin-top: 0px; margin-bottom: 0px;margin:0in; font-size:11pt; font-family:"Calibri",sans-serif">
Thanks!</p>
<p class="x_x_MsoNormal" style="margin-top: 0px; margin-bottom: 0px;margin:0in; font-size:11pt; font-family:"Calibri",sans-serif">
 </p>
<p class="x_x_MsoNormal" style="margin-top: 0px; margin-bottom: 0px;margin:0in; font-size:11pt; font-family:"Calibri",sans-serif">
Alan Phipps</p>
<p class="x_x_MsoNormal" style="margin-top: 0px; margin-bottom: 0px;margin:0in; font-size:11pt; font-family:"Calibri",sans-serif">
 </p>
</div>
</div>
</div>
</body>
</html>