summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-08-28 03:36:51 +0000
committerChris Lattner <sabre@nondot.org>2010-08-28 03:36:51 +0000
commit50df36ac0a7131b9208c26b8031066cd5b4b69ed (patch)
treefc00f15830b49acec65695add20ccf684934106d /llvm/lib/Transforms/InstCombine
parent95bb297c26e0c51dfd351ef70b07268a48b0eb24 (diff)
downloadbcm5719-llvm-50df36ac0a7131b9208c26b8031066cd5b4b69ed.tar.gz
bcm5719-llvm-50df36ac0a7131b9208c26b8031066cd5b4b69ed.zip
for completeness, allow undef also.
llvm-svn: 112351
Diffstat (limited to 'llvm/lib/Transforms/InstCombine')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp3
1 files changed, 3 insertions, 0 deletions
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<Value*> &Elements,
const Type *VecEltTy) {
+ // Undef values never contribute useful bits to the result.
+ if (isa<UndefValue>(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) {
OpenPOWER on IntegriCloud