[PATCH] Teach DeadArgElimination not to eliminate return values of functions with 'returned' arguments

Stephen Lin swlin at post.harvard.edu
Fri Jun 21 10:21:51 PDT 2013


>> IMO, the presence of the returned attribute just doesn't seem like a very
>> good heuristic for predicting whether the returned attribute should be used.
>> I mean, sure, an IR optimizer can't predict what CodeGen will do with
>> complete accuracy, but it shouldn't be hard to make a decent guess that's
>> better than what the frontend is doing, given that the frontend has no idea
>> what the callers or the callee actually look like.
>>
>> -Eli
>
> Well, it's a pretty good heuristic now, given the very limited usage
> of this attribute, but yes, I agree, it might not be in the future.
>
> I would definitely be happy proactively putting in a better heuristic
> now but I am not really sure how to do so. At the very minimum it
> seems like it would require a lot of dataflow analysis that is not
> currently done in DeadArgumentElimination.

I meant to add that suggestions are definitely welcome... :)

>
> Stephen



More information about the llvm-commits mailing list