[llvm-commits] Dead argument elimination rewrite

Dan Gohman gohman at apple.com
Thu Jun 19 14:57:17 PDT 2008


On Jun 19, 2008, at 8:56 AM, Matthijs Kooijman wrote:

>> Ok. Would you mind taking a look at timings on
>> MultiSource/Applications/kimwitu++ also?
> Are you particularly interested in timings? It seems that this  
> testcase
> actually fails to compile due to some older bug. I just tested this  
> with the
> old DAE code, which also shows problems (but a somewhat different  
> problem it
> seems).

>
>
> Anyway, the problem is the ExtraArgHack. This code makes sure that a  
> vararg
> will never have all of its arguments removed by inserting a dummy  
> argument if
> all if its arguments are dead. According to the comments, this is to  
> make cbe
> happy. However, the code would also change vararg functions that had  
> no
> parameters to start with.
>
> In the old code this would also happen if the return value was dead,  
> in the
> new code this would happen on every function (including  
> externals..). I've now
> modified the code to only apply the extraarghack on functions that  
> were not
> already argumentless, there is a small chance of this breaking cbe  
> output for
> bc files containing argumentless vararg functions (but that was the  
> same for
> the old code, with the exception of those functions with dead return  
> values).

Ok.

>
>
> Also, I've added a quick return path to RemoveStuffFromFunction for  
> external
> functions (that saves iterating all arguments and return values,  
> which are by
> definition live, only to find that the new function type would be  
> the same as
> the old).
>
> As for the timings, IIRC (I'm away from work atm) the fixed version  
> runs just
> as fast as the original code.


Ok. I mainly just wanted to get a sense of compile time on some
non-trivial real-world code. The STL associative containers have
a mixed reputation around here..

Thanks,

Dan




More information about the llvm-commits mailing list