Lines Matching defs:IdxDiff
1102 static bool checkIfSafeAddSequence(const APInt &IdxDiff, Instruction *AddOpA,
1105 LLVM_DEBUG(dbgs() << "LSV: checkIfSafeAddSequence IdxDiff=" << IdxDiff
1133 // Match `x +nsw/nuw y` and `x +nsw/nuw (y +nsw/nuw IdxDiff)`.
1140 IdxDiff.getSExtValue() == CstVal)
1150 IdxDiff.getSExtValue() == -CstVal)
1154 // `x +nsw/nuw (y +nsw/nuw (c + IdxDiff))`.
1167 IdxDiff.getSExtValue() == (CstValB - CstValA))
1227 APInt IdxDiff = *IdxDiffRange.getSingleElement();
1229 LLVM_DEBUG(dbgs() << "LSV: getConstantOffsetComplexAddrs IdxDiff=" << IdxDiff
1232 // Now we need to prove that adding IdxDiff to ValA won't overflow.
1235 // First attempt: if OpB is an add with NSW/NUW, and OpB is IdxDiff added to
1239 IdxDiff.sle(cast<ConstantInt>(OpB->getOperand(1))->getSExtValue()) &&
1255 Safe = checkIfSafeAddSequence(IdxDiff, OpA, MatchingOpIdxA, OpB,
1263 // Assuming IdxDiff is positive: If all set bits of IdxDiff or any higher
1267 // If IdxDiff is negative, do the same, but swap ValA and ValB.
1272 computeKnownBits((IdxDiff.sge(0) ? ValA : OpB), Known, DL, 0, &AC,
1274 APInt BitsAllowedToBeSet = Known.Zero.zext(IdxDiff.getBitWidth());
1277 if (BitsAllowedToBeSet.ult(IdxDiff.abs()))
1283 return IdxDiff * Stride;