diff options
author | Chris Lattner <sabre@nondot.org> | 2006-04-02 05:43:13 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-04-02 05:43:13 +0000 |
commit | 4132afb0d2398ae6d211edc9ffc9d2ec25b7abb2 (patch) | |
tree | 1dca7f87fe8e5b36edcf2a4b371bc3233d0da906 | |
parent | a3124a3d1eb4349d22b4abaac3a08b4d112d87a5 (diff) |
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]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27355 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 82e70073e8..65548aff04 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -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; } |