Lines Matching defs:divisor

29 /// Normalize a division's `dividend` and the `divisor` by their GCD. For
30 /// example: if the dividend and divisor are [2,0,4] and 4 respectively,
31 /// they get normalized to [1,0,2] and 2. The divisor must be non-negative;
32 /// it is allowed for the divisor to be zero, but nothing is done in this case.
34 DynamicAPInt &divisor) {
35 assert(divisor > 0 && "divisor must be non-negative!");
40 DynamicAPInt gcd = llvm::gcd(abs(dividend.front()), divisor);
58 divisor /= gcd;
66 /// `expr floordiv divisor` if there are constraints of the form:
67 /// 0 <= expr - divisor * var <= divisor - 1
69 /// divisor * var - expr + (divisor - 1) >= 0 <-- Lower bound for 'var'
70 /// -divisor * var + expr >= 0 <-- Upper bound for 'var'
75 /// expr = 16*i + j, divisor = 32
80 /// expr = i + j + 1, divisor = 4
91 /// c <= expr - divisior * var <= divisor - 1, where 0 <= c <= divisor - 1
93 /// divisor * var - expr + (divisor - 1) >= 0 <-- Lower bound for 'var'
94 /// -divisor * var + expr - c >= 0 <-- Upper bound for 'var'
96 /// If successful, `expr` is set to dividend of the division and `divisor` is
102 DynamicAPInt &divisor) {
113 // Extract divisor from the lower bound.
114 divisor = cst.atIneq(lbIneq, pos);
128 // constants is `divisor - 1 - c`. From this, we can extract c:
131 DynamicAPInt c = divisor - 1 - constantSum;
133 // Check if `c` satisfies the condition `0 <= c <= divisor - 1`.
134 // This also implictly checks that `divisor` is positive.
135 if (!(0 <= c && c <= divisor - 1)) // NOLINT
149 normalizeDivisionByGCD(expr, divisor);
159 /// expr = 16*i + j - 31, divisor = 32
162 /// If successful, `expr` is set to dividend of the division and `divisor` is
168 DynamicAPInt &divisor) {
174 // Extract divisor, the divisor can be negative and hence its sign information
182 // The divisor is always a positive integer.
183 divisor = tempDiv * signDiv;
190 normalizeDivisionByGCD(expr, divisor);
220 /// function of other variables (where the divisor is a positive constant).
230 MutableArrayRef<DynamicAPInt> dividend, DynamicAPInt &divisor) {
243 if (getDivRepr(cst, pos, ubPos, lbPos, dividend, divisor).failed())
256 if (getDivRepr(cst, pos, eqPos, dividend, divisor).failed())
271 SmallVector<int64_t, 8> &dividend, unsigned &divisor) {
277 divisor = unsigned(int64_t(divisorDynamicAPInt));
317 const DynamicAPInt &divisor,
319 assert(divisor > 0 && "divisor must be positive!");
323 ineq[localVarIdx] = -divisor;
329 const DynamicAPInt &divisor,
331 assert(divisor > 0 && "divisor must be positive!");
337 ineq[localVarIdx] = divisor;
338 ineq.back() += divisor - 1;
496 const DynamicAPInt &divisor) {
501 denoms.insert(denoms.begin() + pos, divisor);