<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 27, 2018 at 7:46 PM, Rong Xu <span dir="ltr"><<a href="mailto:xur@google.com" target="_blank">xur@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br><br><div class="gmail_quote"><span class="gmail-"><div dir="ltr">On Wed, Sep 26, 2018 at 10:57 PM Dávid Bolvanský via Phabricator <<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">xbolva00 added a comment.<br>
<br>
> I suggest to make this pass optional (i.e. make this pass opt-in for subtargets).<br>
<br>
@xur are you gonna work on this? As you already measured some numbers, you can enable it for haswell, skylake, etc..<br></blockquote><div><br></div></span><div>Yes. I'm working on this.  I'm using the getprocFamily() Interface in X86Subtarget.  Like</div><div><br></div><div> switch (ST.getProcFamily()) {</div><div>    case X86Subtarget::IntelHaswell:</div><div>    case X86Subtarget::IntelBroadwell:</div><div>    case X86Subtarget::IntelSkylake:</div><div>    case X86Subtarget::IntelSKX:</div><div>    case X86Subtarget::IntelCannonlake:</div><div>          ... enable...</div><div>}</div><div><br></div><div>But the issue I'm having is for sandybridge or ivybridge processor, it returns X86Subtarget::Other.</div><div>I'm have difficulty to include this two subtargets. Am I using the correct interface?</div><span class="gmail-"><div><br></div></span></div></div></div></div></blockquote><div><br></div><div>The easiest way to address this problem is to declare a new SubtargetFeature in <a href="http://x86.td">x86.td</a>, and add it to subtargets that should run your new pass.<br></div><div>This would be similarly to what is done for pass FixupLEA; that pass is only run if the subtarget declares `FeatureSlowLEA` (see X86.td).</div><div><br></div><div>That being said, 
@Craig or @RKSimon might know of a better way to address your problem</div><div><br>

</div><div>In general, a solution that doesn't require adding (yet another) SubtargetFeature to X86.td is preferable.</div><div>The motivation is that subtarget features have been often (ab)used in the past to characterize performance aspects of a processor. Ideally, it would be nice if we could decrease instead their number in future.</div><div><br></div>On the other hand, there is the precedent of FixupLEAs pass.</div><div class="gmail_quote">But more importantly, this could be a stopgap solution until a better approach is found.<br><div><div class="gmail_quote"><br></div>

</div><div class="gmail_quote">-Andrea<br></div></div><div class="gmail_quote"><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_quote"><span class="gmail-"><div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
<br>
================<br>
Comment at: test/CodeGen/X86/condbr_if.ll:<wbr>35<br>
+<br>
+define dso_local i32 @length2_2(i32) {<br>
+  %2 = icmp sle i32 %0, 2<br>
----------------<br>
We don't need "dso_local" here<br>
<br></blockquote></span><div>Will fix this. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<a href="https://reviews.llvm.org/D46662" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D46662</a><br>
<br>
<br>
<br>
</blockquote></div></div></div></div>
</blockquote></div><br></div></div></div></div></div>