Lines Matching refs:ConstantInt

63       ConstantExpr::getExtractElement(CV, ConstantInt::get(Ty, i));  in BitCastConstantVector()
155 if (isa<ConstantInt>(V) || isa<ConstantFP>(V)) in FoldBitCast()
165 if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) { in FoldBitCast()
196 return ConstantInt::get(FP->getContext(), in FoldBitCast()
223 if (ConstantInt *CI = dyn_cast<ConstantInt>(C)) { in ExtractConstantBytes()
228 return ConstantInt::get(CI->getContext(), V); in ExtractConstantBytes()
244 if (ConstantInt *RHSC = dyn_cast<ConstantInt>(RHS)) in ExtractConstantBytes()
268 ConstantInt *Amt = dyn_cast<ConstantInt>(CE->getOperand(1)); in ExtractConstantBytes()
290 ConstantInt *Amt = dyn_cast<ConstantInt>(CE->getOperand(1)); in ExtractConstantBytes()
336 ConstantInt::get(Res->getType(), ByteStart*8)); in ExtractConstantBytes()
353 Constant *N = ConstantInt::get(DestTy, ATy->getNumElements()); in getFoldedSizeOf()
375 Constant *N = ConstantInt::get(DestTy, NumElems); in getFoldedSizeOf()
421 return ConstantInt::get(DestTy, 1); in getFoldedAlignOf()
429 return ConstantInt::get(DestTy, 1); in getFoldedAlignOf()
579 ConstantExpr::getExtractElement(V, ConstantInt::get(Ty, i)); in ConstantFoldCastInstruction()
619 return ConstantInt::get(FPC->getContext(), IntVal); in ConstantFoldCastInstruction()
629 return ConstantInt::get(DestTy, 0); in ConstantFoldCastInstruction()
650 bool isOne = isa<ConstantInt>(Idx) && cast<ConstantInt>(Idx)->isOne(); in ConstantFoldCastInstruction()
662 ConstantInt *CI = cast<ConstantInt>(CE->getOperand(2)); in ConstantFoldCastInstruction()
681 if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) { in ConstantFoldCastInstruction()
691 if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) { in ConstantFoldCastInstruction()
693 return ConstantInt::get(V->getContext(), in ConstantFoldCastInstruction()
698 if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) { in ConstantFoldCastInstruction()
700 return ConstantInt::get(V->getContext(), in ConstantFoldCastInstruction()
709 if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) { in ConstantFoldCastInstruction()
710 return ConstantInt::get(V->getContext(), in ConstantFoldCastInstruction()
744 ConstantInt::get(Ty, i)); in ConstantFoldSelectInstruction()
746 ConstantInt::get(Ty, i)); in ConstantFoldSelectInstruction()
753 if (!isa<ConstantInt>(Cond)) break; in ConstantFoldSelectInstruction()
796 if (ConstantInt *CIdx = dyn_cast<ConstantInt>(Idx)) { in ConstantFoldExtractElementInstruction()
811 ConstantInt *CIdx = dyn_cast<ConstantInt>(Idx); in ConstantFoldInsertElementInstruction()
828 Constant *C = ConstantExpr::getExtractElement(Val, ConstantInt::get(Ty, i)); in ConstantFoldInsertElementInstruction()
865 ConstantInt::get(Ty, Elt - SrcNumElts)); in ConstantFoldShuffleVectorInstruction()
868 InElt = ConstantExpr::getExtractElement(V1, ConstantInt::get(Ty, Elt)); in ConstantFoldShuffleVectorInstruction()
1032 if (ConstantInt *CI2 = dyn_cast<ConstantInt>(C2)) { in ConstantFoldBinaryInstruction()
1126 } else if (isa<ConstantInt>(C1)) { in ConstantFoldBinaryInstruction()
1132 if (ConstantInt *CI1 = dyn_cast<ConstantInt>(C1)) { in ConstantFoldBinaryInstruction()
1133 if (ConstantInt *CI2 = dyn_cast<ConstantInt>(C2)) { in ConstantFoldBinaryInstruction()
1140 return ConstantInt::get(CI1->getContext(), C1V + C2V); in ConstantFoldBinaryInstruction()
1142 return ConstantInt::get(CI1->getContext(), C1V - C2V); in ConstantFoldBinaryInstruction()
1144 return ConstantInt::get(CI1->getContext(), C1V * C2V); in ConstantFoldBinaryInstruction()
1147 return ConstantInt::get(CI1->getContext(), C1V.udiv(C2V)); in ConstantFoldBinaryInstruction()
1152 return ConstantInt::get(CI1->getContext(), C1V.sdiv(C2V)); in ConstantFoldBinaryInstruction()
1155 return ConstantInt::get(CI1->getContext(), C1V.urem(C2V)); in ConstantFoldBinaryInstruction()
1160 return ConstantInt::get(CI1->getContext(), C1V.srem(C2V)); in ConstantFoldBinaryInstruction()
1162 return ConstantInt::get(CI1->getContext(), C1V & C2V); in ConstantFoldBinaryInstruction()
1164 return ConstantInt::get(CI1->getContext(), C1V | C2V); in ConstantFoldBinaryInstruction()
1166 return ConstantInt::get(CI1->getContext(), C1V ^ C2V); in ConstantFoldBinaryInstruction()
1169 return ConstantInt::get(CI1->getContext(), C1V.shl(C2V)); in ConstantFoldBinaryInstruction()
1173 return ConstantInt::get(CI1->getContext(), C1V.lshr(C2V)); in ConstantFoldBinaryInstruction()
1177 return ConstantInt::get(CI1->getContext(), C1V.ashr(C2V)); in ConstantFoldBinaryInstruction()
1225 Constant *ExtractIdx = ConstantInt::get(Ty, i); in ConstantFoldBinaryInstruction()
1281 return ConstantInt::getFalse(C1->getContext()); in ConstantFoldBinaryInstruction()
1320 if (!isa<ConstantInt>(C1) || !isa<ConstantInt>(C2)) in IdxCompare()
1324 if (cast<ConstantInt>(C1)->getValue().getActiveBits() > 64 || in IdxCompare()
1325 cast<ConstantInt>(C2)->getValue().getActiveBits() > 64) in IdxCompare()
1330 int64_t C1Val = cast<ConstantInt>(C1)->getSExtValue(); in IdxCompare()
1331 int64_t C2Val = cast<ConstantInt>(C2)->getSExtValue(); in IdxCompare()
1369 ConstantInt *R = nullptr; in evaluateFCmpRelation()
1370 R = dyn_cast<ConstantInt>( in evaluateFCmpRelation()
1374 R = dyn_cast<ConstantInt>( in evaluateFCmpRelation()
1378 R = dyn_cast<ConstantInt>( in evaluateFCmpRelation()
1459 ConstantInt *R = nullptr; in evaluateICmpRelation()
1461 R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, V1, V2)); in evaluateICmpRelation()
1465 R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, V1, V2)); in evaluateICmpRelation()
1469 R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, V1, V2)); in evaluateICmpRelation()
1670 if (isa<ConstantInt>(CE1->getOperand(i))) in evaluateICmpRelation()
1678 if (isa<ConstantInt>(CE2->getOperand(i))) in evaluateICmpRelation()
1726 return ConstantInt::get(ResultTy, CmpInst::isTrueWhenEqual(Predicate)); in ConstantFoldCompareInstruction()
1730 return ConstantInt::get(ResultTy, CmpInst::isUnordered(Predicate)); in ConstantFoldCompareInstruction()
1741 return ConstantInt::getFalse(C1->getContext()); in ConstantFoldCompareInstruction()
1743 return ConstantInt::getTrue(C1->getContext()); in ConstantFoldCompareInstruction()
1753 return ConstantInt::getFalse(C1->getContext()); in ConstantFoldCompareInstruction()
1755 return ConstantInt::getTrue(C1->getContext()); in ConstantFoldCompareInstruction()
1763 if (isa<ConstantInt>(C2)) in ConstantFoldCompareInstruction()
1773 if (isa<ConstantInt>(C1) && isa<ConstantInt>(C2)) { in ConstantFoldCompareInstruction()
1774 const APInt &V1 = cast<ConstantInt>(C1)->getValue(); in ConstantFoldCompareInstruction()
1775 const APInt &V2 = cast<ConstantInt>(C2)->getValue(); in ConstantFoldCompareInstruction()
1778 case ICmpInst::ICMP_EQ: return ConstantInt::get(ResultTy, V1 == V2); in ConstantFoldCompareInstruction()
1779 case ICmpInst::ICMP_NE: return ConstantInt::get(ResultTy, V1 != V2); in ConstantFoldCompareInstruction()
1780 case ICmpInst::ICMP_SLT: return ConstantInt::get(ResultTy, V1.slt(V2)); in ConstantFoldCompareInstruction()
1781 case ICmpInst::ICMP_SGT: return ConstantInt::get(ResultTy, V1.sgt(V2)); in ConstantFoldCompareInstruction()
1782 case ICmpInst::ICMP_SLE: return ConstantInt::get(ResultTy, V1.sle(V2)); in ConstantFoldCompareInstruction()
1783 case ICmpInst::ICMP_SGE: return ConstantInt::get(ResultTy, V1.sge(V2)); in ConstantFoldCompareInstruction()
1784 case ICmpInst::ICMP_ULT: return ConstantInt::get(ResultTy, V1.ult(V2)); in ConstantFoldCompareInstruction()
1785 case ICmpInst::ICMP_UGT: return ConstantInt::get(ResultTy, V1.ugt(V2)); in ConstantFoldCompareInstruction()
1786 case ICmpInst::ICMP_ULE: return ConstantInt::get(ResultTy, V1.ule(V2)); in ConstantFoldCompareInstruction()
1787 case ICmpInst::ICMP_UGE: return ConstantInt::get(ResultTy, V1.uge(V2)); in ConstantFoldCompareInstruction()
1798 return ConstantInt::get(ResultTy, R==APFloat::cmpUnordered); in ConstantFoldCompareInstruction()
1800 return ConstantInt::get(ResultTy, R!=APFloat::cmpUnordered); in ConstantFoldCompareInstruction()
1802 return ConstantInt::get(ResultTy, R==APFloat::cmpUnordered || in ConstantFoldCompareInstruction()
1805 return ConstantInt::get(ResultTy, R==APFloat::cmpEqual); in ConstantFoldCompareInstruction()
1807 return ConstantInt::get(ResultTy, R!=APFloat::cmpEqual); in ConstantFoldCompareInstruction()
1809 return ConstantInt::get(ResultTy, R==APFloat::cmpLessThan || in ConstantFoldCompareInstruction()
1812 return ConstantInt::get(ResultTy, R==APFloat::cmpUnordered || in ConstantFoldCompareInstruction()
1815 return ConstantInt::get(ResultTy, R==APFloat::cmpLessThan); in ConstantFoldCompareInstruction()
1817 return ConstantInt::get(ResultTy, R==APFloat::cmpUnordered || in ConstantFoldCompareInstruction()
1820 return ConstantInt::get(ResultTy, R==APFloat::cmpGreaterThan); in ConstantFoldCompareInstruction()
1822 return ConstantInt::get(ResultTy, R!=APFloat::cmpGreaterThan); in ConstantFoldCompareInstruction()
1824 return ConstantInt::get(ResultTy, R==APFloat::cmpLessThan || in ConstantFoldCompareInstruction()
1827 return ConstantInt::get(ResultTy, R!=APFloat::cmpLessThan); in ConstantFoldCompareInstruction()
1829 return ConstantInt::get(ResultTy, R==APFloat::cmpGreaterThan || in ConstantFoldCompareInstruction()
1840 ConstantExpr::getExtractElement(C1, ConstantInt::get(Ty, i)); in ConstantFoldCompareInstruction()
1842 ConstantExpr::getExtractElement(C2, ConstantInt::get(Ty, i)); in ConstantFoldCompareInstruction()
1909 return ConstantInt::get(ResultTy, Result); in ConstantFoldCompareInstruction()
1980 return ConstantInt::get(ResultTy, Result); in ConstantFoldCompareInstruction()
2035 if (auto *CI = dyn_cast<ConstantInt>(Idxs[0])) { in isInBoundsIndices()
2040 CI = dyn_cast_or_null<ConstantInt>(CV->getSplatValue()); in isInBoundsIndices()
2053 const ConstantInt *CI) { in isIndexInRangeOfArrayType()
2152 if (ConstantInt *CI = dyn_cast<ConstantInt>(Idx0)) in ConstantFoldGetElementPtr()
2240 !isa<ConstantInt>(Idxs[0]) && !isa<ConstantDataVector>(Idxs[0]); in ConstantFoldGetElementPtr()
2243 if (!isa<ConstantInt>(Idxs[i]) && !isa<ConstantDataVector>(Idxs[i])) { in ConstantFoldGetElementPtr()
2248 if (!isa<ConstantInt>(Idxs[i - 1]) && !isa<ConstantDataVector>(Idxs[i - 1])) in ConstantFoldGetElementPtr()
2267 if (ConstantInt *CI = dyn_cast<ConstantInt>(Idxs[i])) { in ConstantFoldGetElementPtr()
2280 auto *CI = cast<ConstantInt>(CV->getElementAsConstant(I)); in ConstantFoldGetElementPtr()
2322 ConstantInt::get(CurrIdx->getType()->getScalarType(), NumElements); in ConstantFoldGetElementPtr()