Chris,

I believe this patch has broken these two instcombine tests:

FAIL: 
/proj/llvm/llvm-3/test/Regression/Transforms/InstCombine/2003-11-13-ConstExprCastCall.ll:
child process exited abnormally
        call i32 (...)* bitcast (void (i8*)* %free to i32 (...)*)( i32* 
%X.pntr.s1.u0 )         ; <i32>:0 [#uses=0]

FAIL: 
/proj/llvm/llvm-3/test/Regression/Transforms/InstCombine/call-cast-target.ll:
child process exited abnormally
        %tmp.s = call i32 bitcast (i8* (i32*)* %ctime to i32 (i32*)*)( i32* 
null )              ; <i32> [#uses=1]

Both of them are checking to see if the bitcast is gone which isn't the case 
any more.

Reid.

On Fri, 2007-01-05 at 20:09 -0600, Chris Lattner wrote:
> 
> Changes in directory llvm/lib/Transforms/Scalar:
> 
> InstructionCombining.cpp updated: 1.582 -> 1.583
> ---
> Log message:
> 
> simplify some more code now that there are not multiple different integer
> types of the same size
> 
> 
> ---
> Diffs of the changes:  (+4 -8)
> 
>  InstructionCombining.cpp |   12 ++++--------
>  1 files changed, 4 insertions(+), 8 deletions(-)
> 
> 
> Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
> diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.582 
> llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.583
> --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.582 Fri Jan  5 
> 19:45:59 2007
> +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp       Fri Jan  5 
> 20:09:32 2007
> @@ -7211,13 +7211,9 @@
>  
>    // Check to see if we are changing the return type...
>    if (OldRetTy != FT->getReturnType()) {
> -    if (Callee->isExternal() &&
> -        !Caller->use_empty() && 
> -        !(OldRetTy->canLosslesslyBitCastTo(FT->getReturnType()) ||
> -          (isa<PointerType>(FT->getReturnType()) && 
> -           TD->getIntPtrType()->canLosslesslyBitCastTo(OldRetTy)))
> -        )
> -      return false;   // Cannot transform this return value...
> +    if (Callee->isExternal() && !Caller->use_empty() && 
> +        OldRetTy != FT->getReturnType())
> +      return false;   // Cannot transform this return value.
>  
>      // If the callsite is an invoke instruction, and the return value is 
> used by
>      // a PHI node in a successor, we cannot change the return type of the 
> call
> @@ -7242,7 +7238,7 @@
>      const Type *ActTy = (*AI)->getType();
>      ConstantInt *c = dyn_cast<ConstantInt>(*AI);
>      //Either we can cast directly, or we can upconvert the argument
> -    bool isConvertible = ActTy->canLosslesslyBitCastTo(ParamTy) ||
> +    bool isConvertible = ActTy == ParamTy ||
>        (ParamTy->isIntegral() && ActTy->isIntegral() &&
>         ParamTy->getPrimitiveSize() >= ActTy->getPrimitiveSize()) ||
>        (c && ParamTy->getPrimitiveSize() >= ActTy->getPrimitiveSize() &&
> 
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to