Home | History | Annotate | Download | only in IR

Lines Matching full:endpoints

461 static bool tryMergeRange(SmallVector<Value*, 4> &EndPoints, ConstantInt *Low,
464 unsigned Size = EndPoints.size();
465 APInt LB = cast<ConstantInt>(EndPoints[Size - 2])->getValue();
466 APInt LE = cast<ConstantInt>(EndPoints[Size - 1])->getValue();
471 EndPoints[Size - 2] = ConstantInt::get(Ty, Union.getLower());
472 EndPoints[Size - 1] = ConstantInt::get(Ty, Union.getUpper());
478 static void addRange(SmallVector<Value*, 4> &EndPoints, ConstantInt *Low,
480 if (!EndPoints.empty())
481 if (tryMergeRange(EndPoints, Low, High))
484 EndPoints.push_back(Low);
485 EndPoints.push_back(High);
501 SmallVector<Value*, 4> EndPoints;
511 addRange(EndPoints, ALow, cast<ConstantInt>(A->getOperand(2 * AI + 1)));
514 addRange(EndPoints, BLow, cast<ConstantInt>(B->getOperand(2 * BI + 1)));
519 addRange(EndPoints
524 addRange(EndPoints, cast<ConstantInt>(B->getOperand(2 * BI)),
529 // If we have more than 2 ranges (4 endpoints) we have to try to merge
531 unsigned Size = EndPoints.size();
533 ConstantInt *FB = cast<ConstantInt>(EndPoints[0]);
534 ConstantInt *FE = cast<ConstantInt>(EndPoints[1]);
535 if (tryMergeRange(EndPoints, FB, FE)) {
537 EndPoints[i] = EndPoints[i + 2];
539 EndPoints.resize(Size - 2);
545 if (EndPoints.size() == 2) {
546 ConstantRange Range(cast<ConstantInt>(EndPoints[0])->getValue(),
547 cast<ConstantInt>(EndPoints[1])->getValue());
552 return MDNode::get(A->getContext(), EndPoints);