Lines Matching defs:ConstantInt
231 SmallVector<std::pair<Constant *, SmallVector<ConstantInt *, 4>>, 2>;
240 ConstantInt *Value;
243 ValueEqualityComparisonCase(ConstantInt *Value, BasicBlock *Dest)
490 /// Extract ConstantInt from value, looking through IntToPtr
492 static ConstantInt *getConstantInt(Value *V, const DataLayout &DL) {
494 ConstantInt *CI = dyn_cast<ConstantInt>(V);
500 // ConstantInt if possible.
505 return ConstantInt::get(PtrTy, 0);
510 if (ConstantInt *CI = dyn_cast<ConstantInt>(CE->getOperand(0))) {
515 return cast<ConstantInt>(
543 SmallVector<ConstantInt *, 8> Vals;
577 ConstantInt *C;
640 ConstantInt::get(C->getContext(),
662 Vals.push_back(ConstantInt::get(C->getContext(),
707 Vals.push_back(ConstantInt::get(I->getContext(), Tmp));
852 ConstantInt *TheVal = (*V1)[0].Value;
1000 ConstantInt *TIV = nullptr;
1058 /// applications that sort ConstantInt's to ensure uniqueness.
1060 bool operator()(const ConstantInt *LHS, const ConstantInt *RHS) const {
1067 static int constantIntSortPredicate(ConstantInt *const *P1,
1068 ConstantInt *const *P2) {
1069 const ConstantInt *LHS = *P1;
1070 const ConstantInt *RHS = *P2;
1221 std::set<ConstantInt *, ConstantIntOrdering> PTIHandled;
1277 std::set<ConstantInt *, ConstantIntOrdering> PTIHandled;
1278 std::map<ConstantInt *, uint64_t> WeightsForHandled;
1309 for (ConstantInt *I : PTIHandled) {
1687 *Invert ? Builder.CreateXor(Cond, ConstantInt::getTrue(Context)) : Cond,
1691 Builder.CreateXor(Cond, ConstantInt::getTrue(Context)), VCondTy);
3542 static ConstantInt *getKnownValueOnEdge(Value *V, BasicBlock *From,
3554 return BI->getSuccessor(0) == To ? ConstantInt::getTrue(BI->getContext())
3555 : ConstantInt::getFalse(BI->getContext());
3567 SmallMapVector<ConstantInt *, SmallSetVector<BasicBlock *, 2>, 2> KnownValues;
3579 if (auto *CB = dyn_cast<ConstantInt>(U))
3583 if (ConstantInt *CB = getKnownValueOnEdge(Cond, Pred, BB))
3600 ConstantInt *CB = Pair.first;
3755 if (isa<ConstantInt>(IfCond))
4663 ConstantInt::get(Type::getInt1Ty(BB->getContext()), CondIsTrue));
4955 ConstantInt *TrueVal = dyn_cast<ConstantInt>(Select->getTrueValue());
4956 ConstantInt *FalseVal = dyn_cast<ConstantInt>(Select->getFalseValue());
5033 ConstantInt *Cst = cast<ConstantInt>(ICI->getOperand(1));
5050 ConstantInt *VVal = SI->findCaseDest(BB);
5068 V = ConstantInt::getFalse(BB->getContext());
5070 V = ConstantInt::getTrue(BB->getContext());
5088 Constant *DefaultCst = ConstantInt::getTrue(BB->getContext());
5089 Constant *NewCst = ConstantInt::getFalse(BB->getContext());
5147 SmallVectorImpl<ConstantInt *> &Values = ConstantCompare.Vals;
5736 static bool casesAreContiguous(SmallVectorImpl<ConstantInt *> &Cases) {
5785 SmallVector<ConstantInt *, 16> CasesA;
5786 SmallVector<ConstantInt *, 16> CasesB;
5815 SmallVectorImpl<ConstantInt *> *ContiguousCases = nullptr;
5833 ConstantInt::get(Offset->getType(), ContiguousCases->size());
5842 Cmp = ConstantInt::getTrue(SI->getContext());
5915 SmallVector<ConstantInt *, 8> DeadCases;
5966 cast<ConstantInt>(ConstantInt::get(Cond->getType(), MissingCaseVal));
5979 for (ConstantInt *DeadCase : DeadCases) {
6004 static PHINode *findPHIForConditionForwarding(ConstantInt *CaseValue,
6042 ConstantInt *CaseValue = Case.getCaseValue();
6099 if (!isa<ConstantFP>(C) && !isa<ConstantInt>(C) &&
6162 getCaseResults(SwitchInst *SI, ConstantInt *CaseVal, BasicBlock *CaseDest,
6233 static size_t mapCaseToResult(ConstantInt *CaseVal,
6243 std::make_pair(Result, SmallVector<ConstantInt *, 4>(1, CaseVal)));
6259 ConstantInt *CaseVal = I.getCaseValue();
6321 ConstantInt *FirstCase = ResultVector[0].second[0];
6322 ConstantInt *SecondCase = ResultVector[1].second[0];
6338 ArrayRef<ConstantInt *> CaseValues = ResultVector[0].second;
6345 ConstantInt *MinCaseVal = CaseValues[0];
6453 Module &M, uint64_t TableSize, ConstantInt *Offset,
6454 const SmallVectorImpl<std::pair<ConstantInt *, Constant *>> &Values,
6493 ConstantInt *BitMap = nullptr;
6497 ConstantInt *LinearOffset = nullptr;
6498 ConstantInt *LinearMultiplier = nullptr;
6508 Module &M, uint64_t TableSize, ConstantInt *Offset,
6509 const SmallVectorImpl<std::pair<ConstantInt *, Constant *>> &Values,
6522 ConstantInt *CaseVal = Values[I].first;
6569 ConstantInt *ConstVal = dyn_cast<ConstantInt>(TableContents[I]);
6577 ConstVal = dyn_cast<ConstantInt>(Values[0].second);
6601 LinearOffset = cast<ConstantInt>(TableContents[0]);
6602 LinearMultiplier = ConstantInt::get(M.getContext(), DistToPrev);
6622 ConstantInt *Val = cast<ConstantInt>(TableContents[I - 1]);
6626 BitMap = ConstantInt::get(M.getContext(), TableInt);
6679 ShiftAmt, ConstantInt::get(MapTy, BitMapElementTy->getBitWidth()),
6810 ConstantInt &MinCaseVal, const ConstantInt &MaxCaseVal,
6849 const SmallVectorImpl<std::pair<ConstantInt *, Constant *>> &Values) {
6864 Constant *TrueConst = ConstantInt::getTrue(RangeCmp->getType());
6865 Constant *FalseConst = ConstantInt::getFalse(RangeCmp->getType());
6901 RangeCmp, ConstantInt::get(RangeCmp->getType(), 1), "inverted.cmp",
6940 ConstantInt *MinCaseVal = CI->getCaseValue();
6941 ConstantInt *MaxCaseVal = CI->getCaseValue();
6945 using ResultListTy = SmallVector<std::pair<ConstantInt *, Constant *>, 4>;
6953 ConstantInt *CaseVal = CI->getCaseValue();
7053 ConstantInt *TableIndexOffset;
7055 TableIndexOffset = ConstantInt::get(MaxCaseVal->getIntegerType(), 0);
7106 TableIndex, ConstantInt::get(MinCaseVal->getType(), TableSize));
7136 ConstantInt *TableMask = ConstantInt::get(Mod.getContext(), MaskInt);
7291 Builder.CreateSub(SI->getCondition(), ConstantInt::get(Ty, Base));
7294 {Sub, Sub, ConstantInt::get(Ty, Ty->getBitWidth() - Shift)});
7300 Case.setValue(cast<ConstantInt>(ConstantInt::get(Ty, Sub.lshr(Shift))));
7326 {Condition, ConstantInt::getTrue(Context)}),
7366 Case.setValue(ConstantInt::get(OrigValue->getIntegerType(),
7372 Intrinsic::cttz, {CondTy}, {Condition, ConstantInt::getTrue(Context)});
7895 if (ICI->isEquality() && isa<ConstantInt>(ICI->getOperand(1))) {
8025 !isa<ConstantInt>(BI->getCondition()) &&
8066 ConstantInt *TorF = *Imp ? ConstantInt::getTrue(BB->getContext())
8067 : ConstantInt::getFalse(BB->getContext());