On 21 May 2011 11:02, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com">clattner@apple.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div style="word-wrap:break-word"><div class="im"><br><div><div>On May 18, 2011, at 5:03 PM, Nick Lewycky wrote:</div><br><blockquote type="cite">Hi, I'm starting to get serious about lifetime markers.<div><br></div>
<div>
The attached patch teaches the inliner to emit lifetime.start and lifetime.end markers for the alloca's that it hoists to the beginning of the function. Please review, or propose some testing that you'd like to see done on this patch!</div>



</blockquote><br></div></div><div>The algorithm looks right to me.  Please make a couple of changes:</div><div><br></div><div>1. Please use IRBuilder.  It would make sense to add a "getIntrinsic(Intrinsic::lifetime_start);" method to IRBuilder.</div>

<div>2. instead of "x <span style="font-family:Menlo;font-size:11px"> != Type::getInt8PtrTy(Context)".  IRBuilder shoudl handle this check for you.</span></div><div><font face="Menlo" size="3"><span style="font-size:11px">3. Minor thing:</span></font></div>

<div><font face="Menlo" size="3"><span style="font-size:11px"><br></span></font></div><div><font face="Menlo" size="3"><span style="font-size:11px"><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">

+      Value *Args[2];</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">+      Args[0] = MinusOne;</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">+      Args[1] = AI;</div>

<div><br></div><div>Can be:</div><div><br></div><div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">+      Value *Args[2] = { MinusOne, AI };</div></div></span></font></div></div></blockquote>

<div><br></div><div>Thanks for the review! Updated patch attached. I'm just finishing up a bootstrap build with this patch applied (Debug+Asserts for stage1 and stage2). I haven't looked for any performance impact yet.</div>

<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"><div><font face="Menlo" size="3"><span style="font-size:11px"><div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">

<span class="Apple-style-span" style="font-family: arial; font-size: small; ">It would be good to synch up with Owen on this, I think he's working on similar things.</span></div></div></span></font></div></div></blockquote>

<div><br></div><div>Thanks! I've already chatted with Owen over IRC.</div><div></div></div><br><div>Nick</div><div><br></div>