From 50df36ac0a7131b9208c26b8031066cd5b4b69ed Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 28 Aug 2010 03:36:51 +0000 Subject: for completeness, allow undef also. llvm-svn: 112351 --- llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/lib') diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp index 0434d6ba0fd..6c2477d52c7 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp @@ -1381,6 +1381,9 @@ static unsigned getTypeSizeIndex(unsigned Value, const Type *Ty) { static bool CollectInsertionElements(Value *V, unsigned ElementIndex, SmallVectorImpl &Elements, const Type *VecEltTy) { + // Undef values never contribute useful bits to the result. + if (isa(V)) return true; + // If we got down to a value of the right type, we win, try inserting into the // right element. if (V->getType() == VecEltTy) { -- cgit v1.2.3