[llvm-commits] patch: make the inliner emit lifetime markers
Chris Lattner
clattner at apple.com
Sat May 21 22:00:30 PDT 2011
On May 21, 2011, at 9:41 PM, Nick Lewycky wrote:
> In FindLifetimeMarkers, why push entries into a vector then iterate over the vector? You can just pull your "for each use" inner loop out to its own predicate function and eliminate the smallvector.
>
> Good catch!
>
> Also, there is no need for both the start and end intrinsic: if you find either, you can assume that there is no need to add one for an alloca. Here's an example where you'd have a start but no end (assuming a frontend was generating them):
>
> void foo() {
> int x;
> bar(&x);
> abort();
> }
>
> As such, instead of "finding" them both, please rename the predicate to "hasLifetimeMarkers()".
>
> I'm convinced. Updated patch attached!
>
Looks good to me, with the addition of a comment before:
+ if (hasLifetimeMarkers(AI))
+ continue;
explaining what is going on. Thanks!
-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110521/7bf55c96/attachment.html>
More information about the llvm-commits
mailing list