<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 15, 2017 at 4:35 PM, Daniel Berlin via <span class="" id=":24j.1" tabindex="-1" style="">Phabricator</span> <span dir="ltr"><<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.<span class="" id=":24j.2" tabindex="-1" style="">llvm</span>.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">dberlin added a comment.<br>
<br>
We've already discovered a slew of problem from over-optimizing things in simplifycfg, which is also being used as a canonicalization pass.<br>
Either it needs a set of flags controlling what it does, or it needs to not be trying to do "performance improvement" and "canonicalization" as a single pass.<br>
See, e.g, <a href="https://bugs.llvm.org/show_bug.cgi?id=34603" rel="noreferrer" target="_blank">https://bugs.llvm.org/show_<wbr>bug.cgi?id=34603</a><br>
<br></blockquote><div>Indeed. The original motivation case is a chain of if-else-if. We fold them into a switch in <span class="" id=":24j.3" tabindex="-1" style="">simplifyCFG</span> then lowered into a set of branches in different order. </div><div>The original order was set based on the profiles (according to the user).</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<a href="https://reviews.llvm.org/D37940" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D37940</a><br>
<br>
<br>
<br>
</blockquote></div><br></div></div>