<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 Aug 20, 2015, at 9:59 AM, Mehdi Amini <<a href="mailto:mehdi.amini@apple.com" class="">mehdi.amini@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline">On Aug 20, 2015, at 9:46 AM, Steve King <<a href="mailto:steve@metrokings.com" class="">steve@metrokings.com</a>> wrote:<br class=""><br class="">On Wed, Aug 19, 2015 at 10:58 PM, Mehdi Amini <<a href="mailto:mehdi.amini@apple.com" class="">mehdi.amini@apple.com</a>> wrote:<br class=""><blockquote type="cite" class=""><br class="">Isn’t the problem the fact that the patch makes it harder for a target to<br class="">get the generic code to reach its custom hook?<br class="">Now the "cheap pow2 sdiv” is merged with the generic “cheap div” you can’t<br class="">distinguish anymore.<br class=""><br class=""></blockquote><br class="">Yes and also the issue of needing more information to make a smart<br class="">isIntDivCheap() decision.<br class=""><br class="">In visitSDIV(), checking looks like this when the denominator is a power of 2.<br class=""><br class=""> if (TLI.isIntDivCheap(N->getValueType(0), MinSize))<br class=""> return SDValue();<br class=""><br class=""> // Target-specific implementation of sdiv x, pow2.<br class=""> if (SDValue Res = BuildSDIVPow2(N))<br class=""> return Res;<br class=""><br class="">How about this for isIntDivCheap?<br class="">1) pass Function* to allow the target to decide for itself which<br class="">attributes matter, and<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">If you want the attributes, I think you should pass the attributes and not the whole Function.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I’m not sure why MinSize does not trigger with -Os by default, Michael is it intended?</span></div></blockquote><br class=""></div><div>I think -Oz might be MinSize? -Oz being absolute minimum size at the cost of significant speed, IIRC.</div><div><br class=""></div><div>—escha</div></body></html>