[llvm-commits] [llvm] r51947 - in /llvm/trunk/lib: Analysis/IPA/CallGraph.cpp Transforms/IPO/DeadArgumentElimination.cpp

Chris Lattner clattner at apple.com
Wed Jun 4 10:02:16 PDT 2008


On Jun 4, 2008, at 9:57 AM, Matthijs Kooijman wrote:
> URL: http://llvm.org/viewvc/llvm-project?rev=51947&view=rev
> Log:
> Replace two manual loops with calls to CallSite::hasArguments (no  
> functional changes).

Ok.

> +++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Wed  
> Jun  4 11:57:50 2008
> @@ -331,13 +331,11 @@
>           }
>
>       // If the function is PASSED IN as an argument, its address  
> has been taken
> +      if (CS.hasArgument(&F)) {
> +        FunctionIntrinsicallyLive = true;
> +        break;
> +      }
>     }

Actually, this can be checked in O(1) time by just calling  
I.getOperandNo().  If the use_iterator is for the callee operand of  
the function, then it is ok.  If not,  you know it is passing in the  
address of the function.  The DeadArgElim code was written before  
getOperandNo() existed on use_iterator.

-Chris




More information about the llvm-commits mailing list