<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 10, 2015, at 12:22 AM, Frédéric Heitzmann <<a href="mailto:frederic.heitzmann@gmail.com" class="">frederic.heitzmann@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">2015-07-08 17:58 GMT+02:00 escha <span dir="ltr" class=""><<a href="mailto:escha@apple.com" target="_blank" class="">escha@apple.com</a>></span>:<br class=""><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"><span class="">[...]<br class=""></span><br class="">
If you want to “revert" this sort of thing, you can do it at Select() time or PreprocessISelDAG(), which is what I did on an out-of-tree backend to turn add X, -C into sub X, C on selection time. This still lets all the intermediate optimizations take advantage of the canonicalization.<br class="">
<span class=""><font color="#888888" class=""><br class="">
—escha</font></span></blockquote></div><br class=""></div><div class="gmail_extra">Unaware of your proposal, I used the TargetLowering::PerformDAGCombine hook.</div><div class="gmail_extra">Is there a reason to prefere PreprocessISelDAG ?</div></div></div></blockquote><br class=""></div><div>If you write a target-specific combine that conflicts with a canonicalization, it’ll infinite loop because it’ll oscillate between the two forms.</div><div><br class=""></div><div>—escha</div></body></html>