<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><base href="x-msg://14888/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Nadav,<div><br></div><div>I have two high-level comments on this patch:</div><div><br></div><div>1) It seems like it should be possible to avoid n^2 behavior by computing a set of hoistable instructions for each successor block, and then intersecting them.</div><div>2) It seems like you should be able to re-use GVN's value numbering facilities to accelerate the identicality checks.</div><div><br></div><div>The way I'd envision this working would be to scan each successor block and build a map from value numbers to instructions.  Then you find value numbers that are in both maps and clone them into the predecessor.</div><div><br></div><div>--Owen</div><div><br><div><div>On Jul 30, 2012, at 4:08 PM, "Rotem, Nadav" <<a href="mailto:nadav.rotem@intel.com">nadav.rotem@intel.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="EN-US" link="blue" vlink="purple" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="WordSection1" style="page: WordSection1; "><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Hi,<o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Please review the attached patch.<o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">This patch adds code hoisting to GVN.  Currently, SimplifyCFG has a simple code hoisting procedure which scans both THEN and ELSE blocks of the branch and hoists instructions from both sides if they are identical.  The problem is that this linear scan is unable to find common code.  The alternative is to perform an N*M scan of the instructions in both blocks and find duplicated instructions. This patch implements the quadratic scan in GVN and has a threshold on the number of instructions to scan.  It gives a modest 1.5% speedup to SciMark2::MonteCarlo.<o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Thanks,<o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Nadav<o:p></o:p></div></div><font face="monospace">---------------------------------------------------------------------<br>Intel Israel (74) Limited<br><br>This e-mail and any attachments may contain confidential material for<br>the sole use of the intended recipient(s). Any review or distribution<br>by others is strictly prohibited. If you are not the intended<br>recipient, please contact the sender and delete all copies.</font><span class="Apple-converted-space"> </span><span><hoist.diff></span></div></blockquote></div><br></div></body></html>