[llvm-commits] [llvm] r118410 - in /llvm/trunk: lib/Transforms/IPO/FunctionAttrs.cpp test/Transforms/FunctionAttrs/2008-10-04-LocalMemory.ll

Duncan Sands baldrick at free.fr
Mon Nov 8 08:31:40 PST 2010


Hi Dan,

> Make FunctionAttrs use AliasAnalysis::getModRefBehavior, now that it
> knows about intrinsic functions.

I always took care to *not* have function attributes make any use of
alias analysis.  Partly this is to have the function attributes pass
stay fast, partly from a feeling that function attributes should be
layered below alias analysis not on top of it, and partly because using
alias analysis doesn't (or didn't in the past) win you much.  That said,
I can understand the temptation to have it use alias analysis - but what
is the cost/benefit ratio?

> @@ -167,26 +171,35 @@
>         // Some instructions can be ignored even if they read or write memory.
>         // Detect these now, skipping to the next instruction if one is found.
>         CallSite CS(cast<Value>(I));
> -      if (CS&&  CS.getCalledFunction()) {
> +      if (CS) {
>           // Ignore calls to functions in the same SCC.
> -        if (SCCNodes.count(CS.getCalledFunction()))
> +        if (CS.getCalledFunction()&&  SCCNodes.count(CS.getCalledFunction()))
> +          continue;

Shouldn't this be:
   if (!CS.getCalledFunction() || SCCNodes.count(CS.getCalledFunction()))
?

Ciao,

Duncan.



More information about the llvm-commits mailing list