<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Apr 20, 2012, at 2:23 AM, Chandler Carruth wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Optima; 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-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div>The reassociate pass does a really nice job of canonicalizing chains of operations into left-linear trees that fully expose each intermediate operation for CSE and combining with other operations. This is a really nice property that seems a shame to loose. If we form the minimal multiply DAG in reassociate  eagerly, we may miss chances to combine non-minimal intermediate steps with other operations.</div></span></blockquote></div><br><div>It also tries to form loop invariant sub-expressions for hoisting by LICM. That seems important to preserve.</div><div><br></div><div>/jakob</div><div><br></div></body></html>