Lines Matching defs:ArrayIdx
186 // A helper function that factors ArrayIdx to a product of a stride and a
189 void factorArrayIndex(Value *ArrayIdx, const SCEV *Base, uint64_t ElementSize,
476 void StraightLineStrengthReduce::factorArrayIndex(Value *ArrayIdx,
480 // At least, ArrayIdx = ArrayIdx *nsw 1.
482 Base, ConstantInt::get(cast<IntegerType>(ArrayIdx->getType()), 1),
483 ArrayIdx, ElementSize, GEP);
486 // One alternative is matching the SCEV of ArrayIdx instead of ArrayIdx
497 if (match(ArrayIdx, m_NSWMul(m_Value(LHS), m_ConstantInt(RHS)))) {
501 } else if (match(ArrayIdx, m_NSWShl(m_Value(LHS), m_ConstantInt(RHS)))) {
534 Value *ArrayIdx = GEP->getOperand(I);
536 factorArrayIndex(ArrayIdx, BaseExpr, ElementSize, GEP);
537 // When ArrayIdx is the sext of a value, we try to factor that value as
541 if (match(ArrayIdx, m_SExt(m_Value(TruncatedArrayIdx))))