[llvm-commits] [llvm] r61552 - in /llvm/trunk: lib/Transforms/IPO/FunctionAttrs.cpp test/Transforms/FunctionAttrs/2008-12-31-NoCapture.ll

Duncan Sands baldrick at free.fr
Sun Jan 4 09:44:25 PST 2009


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 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