[llvm-commits] [llvm] r112351 - /llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp
Chris Lattner
sabre at nondot.org
Fri Aug 27 20:36:51 PDT 2010
Author: lattner
Date: Fri Aug 27 22:36:51 2010
New Revision: 112351
URL: http://llvm.org/viewvc/llvm-project?rev=112351&view=rev
Log:
for completeness, allow undef also.
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp?rev=112351&r1=112350&r2=112351&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp Fri Aug 27 22:36:51 2010
@@ -1381,6 +1381,9 @@
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) {
More information about the llvm-commits
mailing list