<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On May 18, 2011, at 5:03 PM, Nick Lewycky wrote:</div><br class="Apple-interchange-newline"><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>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 class="Apple-style-span" style="font-family: Menlo; font-size: 11px; "> != Type::getInt8PtrTy(Context)".  IRBuilder shoudl handle this check for you.</span></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;">3. Minor thing:</span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br></span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">+      Value *Args[2];</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">+      Args[0] = MinusOne;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">+      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; font: normal normal normal 11px/normal Menlo; ">+      Value *Args[2] = { MinusOne, AI };</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><br></div></div></span></font></div><br><div>It would be good to synch up with Owen on this, I think he's working on similar things.</div><div><br></div><div>-Chris</div></body></html>