<div class="gmail_quote">I haven't thought deeply about the example you gave yet, or exactly what will / won't be transformed here because...</div><div class="gmail_quote"><br></div><div class="gmail_quote">On Fri, Mar 16, 2012 at 4:24 PM, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com">clattner@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In my opinion, the right fix for this is to prevent the inlined code from being un-constant-folded.  When substituting in the argument into the cloned body, can't we recursively simplify things from the def through the uses, instead of one level up from the use?</blockquote>
</div><br><div>... I completely agree. I almost did this, but had a specific reason to avoid this: compile time cost. That said, my profiling says we spend very little time actually doing the inlining, it's all in cleaning up the post-inlined code, so this is much less scary to me now. Having also read more of the actual inline operation, I also think the compile time impact will be much smaller than I imagined originally.</div>
<div><br></div><div>I'll try it out, it's definitely cleaner. I'll followup here if something goes awry with a more detailed analysis. Thanks for the review!</div>