Lines Matching defs:ArrayIdx
230 // A helper function that factors ArrayIdx to a product of a stride and a
233 void factorArrayIndex(Value *ArrayIdx, const SCEV *Base, uint64_t ElementSize,
487 void StraightLineStrengthReduce::factorArrayIndex(Value *ArrayIdx,
491 // At least, ArrayIdx = ArrayIdx *nsw 1.
493 Base, ConstantInt::get(cast<IntegerType>(ArrayIdx->getType()), 1),
494 ArrayIdx, ElementSize, GEP);
497 // One alternative is matching the SCEV of ArrayIdx instead of ArrayIdx
508 if (match(ArrayIdx, m_NSWMul(m_Value(LHS), m_ConstantInt(RHS)))) {
512 } else if (match(ArrayIdx, m_NSWShl(m_Value(LHS), m_ConstantInt(RHS)))) {
543 Value *ArrayIdx = GEP->getOperand(I);
545 if (ArrayIdx->getType()->getIntegerBitWidth() <=
547 // Skip factoring if ArrayIdx is wider than the index size, because
548 // ArrayIdx is implicitly truncated to the index size.
549 factorArrayIndex(ArrayIdx, BaseExpr, ElementSize, GEP);
551 // When ArrayIdx is the sext of a value, we try to factor that value as
555 if (match(ArrayIdx, m_SExt(m_Value(TruncatedArrayIdx))) &&