Lines Matching defs:ConstantInt
217 SmallVector<std::pair<Constant *, SmallVector<ConstantInt *, 4>>, 2>;
226 ConstantInt *Value;
229 ValueEqualityComparisonCase(ConstantInt *Value, BasicBlock *Dest)
479 /// Extract ConstantInt from value, looking through IntToPtr
481 static ConstantInt *GetConstantInt(Value *V, const DataLayout &DL) {
483 ConstantInt *CI = dyn_cast<ConstantInt>(V);
489 // ConstantInt if possible.
494 return ConstantInt::get(PtrTy, 0);
499 if (ConstantInt *CI = dyn_cast<ConstantInt>(CE->getOperand(0))) {
504 return cast<ConstantInt>(
532 SmallVector<ConstantInt *, 8> Vals;
566 ConstantInt *C;
629 ConstantInt::get(C->getContext(),
651 Vals.push_back(ConstantInt::get(C->getContext(),
696 Vals.push_back(ConstantInt::get(I->getContext(), Tmp));
841 ConstantInt *TheVal = (*V1)[0].Value;
989 ConstantInt *TIV = nullptr;
1047 /// applications that sort ConstantInt's to ensure uniqueness.
1049 bool operator()(const ConstantInt *LHS, const ConstantInt *RHS) const {
1056 static int ConstantIntSortPredicate(ConstantInt *const *P1,
1057 ConstantInt *const *P2) {
1058 const ConstantInt *LHS = *P1;
1059 const ConstantInt *RHS = *P2;
1210 std::set<ConstantInt *, ConstantIntOrdering> PTIHandled;
1266 std::set<ConstantInt *, ConstantIntOrdering> PTIHandled;
1267 std::map<ConstantInt *, uint64_t> WeightsForHandled;
1298 for (ConstantInt *I : PTIHandled) {
3283 static ConstantInt *getKnownValueOnEdge(Value *V, BasicBlock *From,
3295 return BI->getSuccessor(0) == To ? ConstantInt::getTrue(BI->getContext())
3296 : ConstantInt::getFalse(BI->getContext());
3308 SmallMapVector<ConstantInt *, SmallSetVector<BasicBlock *, 2>, 2> KnownValues;
3320 if (auto *CB = dyn_cast<ConstantInt>(U))
3324 if (ConstantInt *CB = getKnownValueOnEdge(Cond, Pred, BB))
3341 ConstantInt *CB = Pair.first;
3495 if (isa<ConstantInt>(IfCond))
4408 ConstantInt::get(Type::getInt1Ty(BB->getContext()), CondIsTrue));
4700 ConstantInt *TrueVal = dyn_cast<ConstantInt>(Select->getTrueValue());
4701 ConstantInt *FalseVal = dyn_cast<ConstantInt>(Select->getFalseValue());
4778 ConstantInt *Cst = cast<ConstantInt>(ICI->getOperand(1));
4795 ConstantInt *VVal = SI->findCaseDest(BB);
4813 V = ConstantInt::getFalse(BB->getContext());
4815 V = ConstantInt::getTrue(BB->getContext());
4833 Constant *DefaultCst = ConstantInt::getTrue(BB->getContext());
4834 Constant *NewCst = ConstantInt::getFalse(BB->getContext());
4892 SmallVectorImpl<ConstantInt *> &Values = ConstantCompare.Vals;
5482 static bool CasesAreContiguous(SmallVectorImpl<ConstantInt *> &Cases) {
5531 SmallVector<ConstantInt *, 16> CasesA;
5532 SmallVector<ConstantInt *, 16> CasesB;
5561 SmallVectorImpl<ConstantInt *> *ContiguousCases = nullptr;
5579 ConstantInt::get(Offset->getType(), ContiguousCases->size());
5588 Cmp = ConstantInt::getTrue(SI->getContext());
5661 SmallVector<ConstantInt *, 8> DeadCases;
5712 cast<ConstantInt>(ConstantInt::get(Cond->getType(), MissingCaseVal));
5725 for (ConstantInt *DeadCase : DeadCases) {
5750 static PHINode *FindPHIForConditionForwarding(ConstantInt *CaseValue,
5788 ConstantInt *CaseValue = Case.getCaseValue();
5845 if (!isa<ConstantFP>(C) && !isa<ConstantInt>(C) &&
5908 getCaseResults(SwitchInst *SI, ConstantInt *CaseVal, BasicBlock *CaseDest,
5979 static size_t mapCaseToResult(ConstantInt *CaseVal,
5989 std::make_pair(Result, SmallVector<ConstantInt *, 4>(1, CaseVal)));
6005 ConstantInt *CaseVal = I.getCaseValue();
6067 ConstantInt *FirstCase = ResultVector[0].second[0];
6068 ConstantInt *SecondCase = ResultVector[1].second[0];
6084 ArrayRef<ConstantInt *> CaseValues = ResultVector[0].second;
6091 ConstantInt *MinCaseVal = CaseValues[0];
6199 Module &M, uint64_t TableSize, ConstantInt *Offset,
6200 const SmallVectorImpl<std::pair<ConstantInt *, Constant *>> &Values,
6239 ConstantInt *BitMap = nullptr;
6243 ConstantInt *LinearOffset = nullptr;
6244 ConstantInt *LinearMultiplier = nullptr;
6254 Module &M, uint64_t TableSize, ConstantInt *Offset,
6255 const SmallVectorImpl<std::pair<ConstantInt *, Constant *>> &Values,
6268 ConstantInt *CaseVal = Values[I].first;
6312 ConstantInt *ConstVal = dyn_cast<ConstantInt>(TableContents[I]);
6334 LinearOffset = cast<ConstantInt>(TableContents[0]);
6335 LinearMultiplier = ConstantInt::get(M.getContext(), DistToPrev);
6354 ConstantInt *Val = cast<ConstantInt>(TableContents[I - 1]);
6358 BitMap = ConstantInt::get(M.getContext(), TableInt);
6411 ShiftAmt, ConstantInt::get(MapTy, BitMapElementTy->getBitWidth()),
6542 ConstantInt &MinCaseVal, const ConstantInt &MaxCaseVal,
6581 const SmallVectorImpl<std::pair<ConstantInt *, Constant *>> &Values) {
6596 Constant *TrueConst = ConstantInt::getTrue(RangeCmp->getType());
6597 Constant *FalseConst = ConstantInt::getFalse(RangeCmp->getType());
6633 RangeCmp, ConstantInt::get(RangeCmp->getType(), 1), "inverted.cmp",
6672 ConstantInt *MinCaseVal = CI->getCaseValue();
6673 ConstantInt *MaxCaseVal = CI->getCaseValue();
6677 using ResultListTy = SmallVector<std::pair<ConstantInt *, Constant *>, 4>;
6685 ConstantInt *CaseVal = CI->getCaseValue();
6785 ConstantInt *TableIndexOffset;
6787 TableIndexOffset = ConstantInt::get(MaxCaseVal->getIntegerType(), 0);
6838 TableIndex, ConstantInt::get(MinCaseVal->getType(), TableSize));
6868 ConstantInt *TableMask = ConstantInt::get(Mod.getContext(), MaskInt);
7021 Builder.CreateSub(SI->getCondition(), ConstantInt::get(Ty, Base));
7024 {Sub, Sub, ConstantInt::get(Ty, Ty->getBitWidth() - Shift)});
7030 Case.setValue(cast<ConstantInt>(ConstantInt::get(Ty, Sub.lshr(Shift))));
7056 {Condition, ConstantInt::getTrue(Context)}),
7096 Case.setValue(ConstantInt::get(OrigValue->getIntegerType(),
7102 Intrinsic::cttz, {CondTy}, {Condition, ConstantInt::getTrue(Context)});
7329 if (ICI->isEquality() && isa<ConstantInt>(ICI->getOperand(1))) {
7459 !isa<ConstantInt>(BI->getCondition()) &&
7500 ConstantInt *TorF = *Imp ? ConstantInt::getTrue(BB->getContext())
7501 : ConstantInt::getFalse(BB->getContext());