[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
Fri Jan 2 00:26:55 PST 2009


Hi Nick,

> +      // Does not escape if the callee is readonly and doesn't return a
> +      // copy through its own return value.
> +      if (CS.onlyReadsMemory() && I->getType() == Type::VoidTy)
> +        continue;

such function calls are trivially dead, so shouldn't occur.  Does this turn
up in practice?

> +    // If the function is readonly and doesn't return any value, we 
> +    // know that the pointer value can't escape. Mark all of its pointer 
> +    // arguments nocapture.

Because of this, the above nocapture logic enhancement shouldn't be needed.

> -        NumNoCapture++;
> +        ++NumNoCapture;

If this is an improvement, please change NumReadOnly++ etc.

Ciao,

Duncan.



More information about the llvm-commits mailing list