[llvm-commits] [llvm] r61552 - in /llvm/trunk: lib/Transforms/IPO/FunctionAttrs.cpp test/Transforms/FunctionAttrs/2008-12-31-NoCapture.ll
Nick Lewycky
nicholas at mxc.ca
Sun Jan 11 08:39:01 PST 2009
Duncan Sands wrote:
> Hi Nick,
>
>> FunctionAttrs just went through and added the readnone/readonly
>> attributes. Nobody's had the chance to eliminate dead calls yet.
>
> it would be nice if SimplifyCFG interacted nicely with SCC passes:
> if you specify -simplifycfg -functionattrs it would be great if
> simplifycfg was run on each function in each SCC before functionattrs
> is. Thus both passes would work their way up the callgraph. Eg if
> f calls g, you would get:
> simplifycfg g
> functionattrs g
> simplifycfg f
> functionattrs f
> If g becomes readonly and is trivially dead in f, the simplifycfg
> run on f would eliminate the trivially dead use. This would also be
> useful for pruneeh: it would no longer need to have its own mini
> version of simplifycfg, since if g becomes nounwind then simplifycfg
> would take care of turning invokes of g in f into calls.
I'm not too keen on the notion of 'opt -simplifycfg -functionattrs'
behaving entirely differently from 'opt -simplifycfg | opt -functionattrs'.
Actually, that's one of the first things I check for when I encounter a
case where two passes together produce the wrong result. It usually
means someone isn't updating an analysis correctly.
Nick
>> I haven't redone the metrics with the new change. The answer is
>> "probably not much" but I don't think it hurts to leave it in.
>
> I agree.
>
>>>> - NumNoCapture++;
>>>> + ++NumNoCapture;
>>>>
>>> If this is an improvement, please change NumReadOnly++ etc.
>
> I already changed these.
>
> Ciao,
>
> Duncan.
>
More information about the llvm-commits
mailing list