summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-04-02 05:43:13 +0000
committerChris Lattner <sabre@nondot.org>2006-04-02 05:43:13 +0000
commitcaba72b6ff9aa81b5e1ad07d8c246d30ceb616e0 (patch)
tree424c07ee1837319fb8acbf3c59143ae2fe7ca4b1 /llvm/lib
parent7ee10dec05cdf2ddf24239aa8794402d77f385aa (diff)
downloadbcm5719-llvm-caba72b6ff9aa81b5e1ad07d8c246d30ceb616e0.tar.gz
bcm5719-llvm-caba72b6ff9aa81b5e1ad07d8c246d30ceb616e0.zip
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
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 82e70073e83..65548aff045 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud