<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 22, 2014 at 12:11 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
On Fri, Aug 22, 2014 at 11:14 AM, David Majnemer <span dir="ltr"><<a href="mailto:david.majnemer@gmail.com" target="_blank">david.majnemer@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">This can be generalized:<br>
<br>
`(X | (Y ^ Z)) ^ ((X ^ Z) ^ Y)` -> `X & (Y ^ Z)`</blockquote><div><br></div><div>Is matching that really the right approach? I would (perhaps naively) think we should instead CSE that to</div><div><br></div><div>  (X | A) ^ X ^ A   (with A = Y ^ Z)<br>

</div><div><br></div><div>... and we should be able to perform these more primitive transformations:</div><div><br></div><div> (X | A) ^ X -> ~X & A</div><div> (~X & A) ^ A -> X & A</div><div><br></div>
<div>
... which together reduce your expression to X & (Y ^ Z). Perhaps one of those takes us further from canonical form, though. What are the rules for canonicity here?</div></div></div></div>
<br></blockquote><div><br></div><div>Bringing this up, so far the answers to "why do we keep adding transforms here" has been "to improve matching capabilities" (which is a result, not an objective).  I'd really love it if someone could step back and present a real design (Defining what canonical forms should instcombine expect as input or output) rather than add a ton of possibly used/not used transforms that may or may not transform things back and forth.</div>
<div><br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">_______________________________________________<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></blockquote></div><br></div></div>