vector casts of casts are eliminable. Transform this:

%tmp = cast <4 x uint> %tmp to <4 x int>                ; <<4 x int>> [#uses=1]
        %tmp = cast <4 x int> %tmp to <4 x float>               ; <<4 x float>> [#uses=1]

into:

        %tmp = cast <4 x uint> %tmp to <4 x float>              ; <<4 x float>> [#uses=1]

llvm-svn: 27355
This commit is contained in:
Chris Lattner 2006-04-02 05:43:13 +00:00
parent 7ee10dec05
commit caba72b6ff
1 changed files with 4 additions and 0 deletions

View File

@ -4539,6 +4539,10 @@ static bool isEliminableCastOfCast(const Type *SrcTy, const Type *MidTy,
SrcTy->getPrimitiveSize() < MidTy->getPrimitiveSize())
return true;
// Packed type conversions don't modify bits.
if (isa<PackedType>(SrcTy) && isa<PackedType>(MidTy) &&isa<PackedType>(DstTy))
return true;
return false;
}