Changes in directory llvm/lib/Transforms/Utils:
Local.cpp updated: 1.55 -> 1.56 --- Log message: Patch for a new instcombine xform, patch contributed by Nick Lewycky! This implements Transforms/InstCombine/2006-05-10-InvalidIndexUndef.ll --- Diffs of the changes: (+4 -2) Local.cpp | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/lib/Transforms/Utils/Local.cpp diff -u llvm/lib/Transforms/Utils/Local.cpp:1.55 llvm/lib/Transforms/Utils/Local.cpp:1.56 --- llvm/lib/Transforms/Utils/Local.cpp:1.55 Fri Apr 7 20:19:12 2006 +++ llvm/lib/Transforms/Utils/Local.cpp Wed May 24 12:34:30 2006 @@ -273,7 +273,8 @@ } } else if (ConstantInt *CI = dyn_cast<ConstantInt>(I.getOperand())) { if (const ArrayType *ATy = dyn_cast<ArrayType>(*I)) { - if ((uint64_t)CI->getRawValue() >= ATy->getNumElements()) return 0; + if ((uint64_t)CI->getRawValue() >= ATy->getNumElements()) + C = UndefValue::get(ATy->getElementType()); if (ConstantArray *CA = dyn_cast<ConstantArray>(C)) C = CA->getOperand((unsigned)CI->getRawValue()); else if (isa<ConstantAggregateZero>(C)) @@ -283,7 +284,8 @@ else return 0; } else if (const PackedType *PTy = dyn_cast<PackedType>(*I)) { - if ((uint64_t)CI->getRawValue() >= PTy->getNumElements()) return 0; + if ((uint64_t)CI->getRawValue() >= PTy->getNumElements()) + C = UndefValue::get(PTy->getElementType()); if (ConstantPacked *CP = dyn_cast<ConstantPacked>(C)) C = CP->getOperand((unsigned)CI->getRawValue()); else if (isa<ConstantAggregateZero>(C)) _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits