Deleted Added
full compact
IndVarSimplify.cpp (193399) IndVarSimplify.cpp (193574)
1//===- IndVarSimplify.cpp - Induction Variable Elimination ----------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 740 unchanged lines hidden (view full) ---

749 if (!convertToInt(InitValue->getValueAPF(), &newInitValue))
750 return;
751
752 // Check IV increment. Reject this PH if increement operation is not
753 // an add or increment value can not be represented by an integer.
754 BinaryOperator *Incr =
755 dyn_cast<BinaryOperator>(PH->getIncomingValue(BackEdge));
756 if (!Incr) return;
1//===- IndVarSimplify.cpp - Induction Variable Elimination ----------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 740 unchanged lines hidden (view full) ---

749 if (!convertToInt(InitValue->getValueAPF(), &newInitValue))
750 return;
751
752 // Check IV increment. Reject this PH if increement operation is not
753 // an add or increment value can not be represented by an integer.
754 BinaryOperator *Incr =
755 dyn_cast<BinaryOperator>(PH->getIncomingValue(BackEdge));
756 if (!Incr) return;
757 if (Incr->getOpcode() != Instruction::Add) return;
757 if (Incr->getOpcode() != Instruction::FAdd) return;
758 ConstantFP *IncrValue = NULL;
759 unsigned IncrVIndex = 1;
760 if (Incr->getOperand(1) == PH)
761 IncrVIndex = 0;
762 IncrValue = dyn_cast<ConstantFP>(Incr->getOperand(IncrVIndex));
763 if (!IncrValue) return;
764 uint64_t newIncrValue = Type::Int32Ty->getPrimitiveSizeInBits();
765 if (!convertToInt(IncrValue->getValueAPF(), &newIncrValue))

--- 113 unchanged lines hidden ---
758 ConstantFP *IncrValue = NULL;
759 unsigned IncrVIndex = 1;
760 if (Incr->getOperand(1) == PH)
761 IncrVIndex = 0;
762 IncrValue = dyn_cast<ConstantFP>(Incr->getOperand(IncrVIndex));
763 if (!IncrValue) return;
764 uint64_t newIncrValue = Type::Int32Ty->getPrimitiveSizeInBits();
765 if (!convertToInt(IncrValue->getValueAPF(), &newIncrValue))

--- 113 unchanged lines hidden ---