<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Sep 4, 2014 at 12:41 PM, Hal Finkel <span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">----- Original Message -----<br>
> From: "Chandler Carruth" <<a href="mailto:chandlerc@gmail.com">chandlerc@gmail.com</a>><br>
> To: "Gerolf Hoflehner" <<a href="mailto:ghoflehner@apple.com">ghoflehner@apple.com</a>><br>
> Cc: "llvm-commits" <<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a>><br>
> Sent: Thursday, September 4, 2014 2:14:53 PM<br>
> Subject: Re: [PATCH] Select elimination pass<br>
><br>
><br>
><br>
><br>
><br>
><br>
</div><div class="">> On Thu, Sep 4, 2014 at 11:20 AM, Gerolf Hoflehner <<br>
> <a href="mailto:ghoflehner@apple.com">ghoflehner@apple.com</a> > wrote:<br>
><br>
><br>
> This is a good question. InstCombine is a local pattern matcher at<br>
> the instruction level. I did not want adding a global flavor by<br>
> introducing the dominator tree in that pass.<br>
><br>
><br>
> This is an interesting point. Despite not having a dominator tree,<br>
> there are parts of InstCombine that already approximate dominance<br>
> information by scanning instructions or checking parent basic<br>
> blocks.<br>
><br>
><br>
> I think we should seriously consider adding DominatorTrees to<br>
> InstCombine rather than adding more passes. I'm not aware of<br>
> anything that would make this particularly hard or expensive...<br>
<br>
</div>FWIW, I've looked at this in the context of dealing with @llvm.assume. I plan to, at least, make InstCombine grab DT when it is otherwise available. As it turns out, in the standard pipeline, this happens at least once.<br>

<br></blockquote><div><br></div><div>It makes sense and it'll likely give us a combine that's a little less hacky than "quick, follow these few instructions around and see what they do".</div><div><br></div>
<div>-eric</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 -Hal<br>
<div class=""><br>
><br>
><br>
> Also I would have to mess around with the combiner logic when<br>
> inserting an instruction like an “or” which is not the immediate<br>
> replacement instruction of the select.<br>
><br>
><br>
> This shouldn't be too bad. There are other places where we combine<br>
> somewhat specific uses or instruction patterns.<br>
><br>
><br>
> I also looked at the SimplifyCFG and if-conversion code, but none<br>
> seem a natural fit for this optimization.<br>
><br>
><br>
> I agree here.<br>
><br>
><br>
> I’m not super happy about a new pass but it looked like the kleinstes<br>
> Uebel among the choices.<br>
> Yea, I'm very unconvinced about adding a new pass here. Consider that<br>
> this is quite likely to expose more instruction combining<br>
> opportunities, or to be enabled by some other instruction combining.<br>
> It really needs to be in the iterative worklist IMO.<br>
</div>> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
><br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Hal Finkel<br>
Assistant Computational Scientist<br>
Leadership Computing Facility<br>
Argonne National Laboratory<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</font></span></blockquote></div><br></div></div>