[llvm-commits] [llvm] r47310 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp

Chris Lattner clattner at apple.com
Mon Feb 18 20:13:03 PST 2008


On Feb 18, 2008, at 7:27 PM, Owen Anderson wrote:

> Author: resistor
> Date: Mon Feb 18 21:27:34 2008
> New Revision: 47310
>
> URL: http://llvm.org/viewvc/llvm-project?rev=47310&view=rev
> Log:
> Factor the profitability check for return slot optimization out into  
> a static function.
> At some point in the future, this check will become smarter.

> +/// isReturnSlotOptznProfitable - Determine if performing a return  
> slot
> +/// fusion with the slot dest is profitable

Sentences end with punctuation :)

> /// performReturnSlotOptzn - takes a memcpy and a call that it  
> depends on,
> /// and checks for the possibility of a return slot optimization by  
> having
> /// the call write its result directly into the callees return  
> parameter
..

likewise.

>   // Make sure the call cannot modify the return slot in some  
> unpredicted way

likewise.

>   AliasAnalysis& AA = getAnalysis<AliasAnalysis>();
>   if (AA.getModRefInfo(C, cpy->getRawDest(), ~0UL) !=  
> AliasAnalysis::NoModRef)
>     return false;
>
> -  // If all checks passed, then we can perform the transformation
> +  // If all checks passed, then we can perform the transformation.

Nice! :)

-Chris




More information about the llvm-commits mailing list