[llvm-commits] [llvm] r69574 - /llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp

Dan Gohman gohman at apple.com
Mon Apr 20 08:31:12 PDT 2009


Hello,

Are you planning to resubmit r58505?  It was reverted in r58547 with
a message indicating that it would be resubmitted.  That patch would
appear to make this r69574 unnecessary.

Dan

On Apr 19, 2009, at 11:05 PM, Sanjiv Gupta wrote:

> Author: sgupta
> Date: Mon Apr 20 01:05:54 2009
> New Revision: 69574
>
> URL: http://llvm.org/viewvc/llvm-project?rev=69574&view=rev
> Log:
> Before trying to introduce/eliminate cast/ext/trunc to make indices  
> type as
> pointer type, make sure that the pointer size is a valid sequential  
> index type.
>
> Modified:
>    llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
>
> Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=69574&r1=69573&r2=69574&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp  
> (original)
> +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Mon  
> Apr 20 01:05:54 2009
> @@ -10695,7 +10695,12 @@
>   gep_type_iterator GTI = gep_type_begin(GEP);
>   for (User::op_iterator i = GEP.op_begin() + 1, e = GEP.op_end();
>        i != e; ++i, ++GTI) {
> -    if (isa<SequentialType>(*GTI)) {
> +    // Before trying to eliminate/introduce cast/ext/trunc to make
> +    // indices as pointer types, make sure that the pointer size
> +    // makes a valid sequential index.
> +    const SequentialType *ST = dyn_cast<SequentialType>(*GTI);
> +    Value *PtrTypeVal = Constant::getNullValue(TD->getIntPtrType());
> +    if (ST && ST->indexValid(PtrTypeVal)) {
>       if (CastInst *CI = dyn_cast<CastInst>(*i)) {
>         if (CI->getOpcode() == Instruction::ZExt ||
>             CI->getOpcode() == Instruction::SExt) {
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list