Lines Matching refs:ConstantInt

73       ConstantExpr::getExtractElement(CV, ConstantInt::get(Ty, i));  in BitCastConstantVector()
158 if (isa<ConstantInt>(V) || isa<ConstantFP>(V)) in FoldBitCast()
168 if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) { in FoldBitCast()
199 return ConstantInt::get(FP->getContext(), in FoldBitCast()
226 if (ConstantInt *CI = dyn_cast<ConstantInt>(C)) { in ExtractConstantBytes()
231 return ConstantInt::get(CI->getContext(), V); in ExtractConstantBytes()
247 if (ConstantInt *RHSC = dyn_cast<ConstantInt>(RHS)) in ExtractConstantBytes()
271 ConstantInt *Amt = dyn_cast<ConstantInt>(CE->getOperand(1)); in ExtractConstantBytes()
294 ConstantInt *Amt = dyn_cast<ConstantInt>(CE->getOperand(1)); in ExtractConstantBytes()
341 ConstantInt::get(Res->getType(), ByteStart*8)); in ExtractConstantBytes()
424 ConstantExpr::getExtractElement(V, ConstantInt::get(Ty, i)); in ConstantFoldCastInstruction()
464 return ConstantInt::get(FPC->getContext(), IntVal); in ConstantFoldCastInstruction()
474 return ConstantInt::get(DestTy, 0); in ConstantFoldCastInstruction()
479 if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) { in ConstantFoldCastInstruction()
489 if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) { in ConstantFoldCastInstruction()
491 return ConstantInt::get(V->getContext(), in ConstantFoldCastInstruction()
496 if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) { in ConstantFoldCastInstruction()
498 return ConstantInt::get(V->getContext(), in ConstantFoldCastInstruction()
507 if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) { in ConstantFoldCastInstruction()
508 return ConstantInt::get(V->getContext(), in ConstantFoldCastInstruction()
543 ConstantInt::get(Ty, i)); in ConstantFoldSelectInstruction()
545 ConstantInt::get(Ty, i)); in ConstantFoldSelectInstruction()
554 if (!isa<ConstantInt>(Cond)) break; in ConstantFoldSelectInstruction()
591 if (isa<ConstantInt>(C) || isa<GlobalVariable>(C) || isa<ConstantFP>(C) || in ConstantFoldSelectInstruction()
631 auto *CIdx = dyn_cast<ConstantInt>(Idx); in ConstantFoldExtractElementInstruction()
659 if (const auto *IEIdx = dyn_cast<ConstantInt>(CE->getOperand(2))) { in ConstantFoldExtractElementInstruction()
685 ConstantInt *CIdx = dyn_cast<ConstantInt>(Idx); in ConstantFoldInsertElementInstruction()
709 Constant *C = ConstantExpr::getExtractElement(Val, ConstantInt::get(Ty, i)); in ConstantFoldInsertElementInstruction()
735 ConstantExpr::getExtractElement(V1, ConstantInt::get(Ty, 0)); in ConstantFoldShuffleVectorInstruction()
760 ConstantInt::get(Ty, Elt - SrcNumElts)); in ConstantFoldShuffleVectorInstruction()
763 InElt = ConstantExpr::getExtractElement(V1, ConstantInt::get(Ty, Elt)); in ConstantFoldShuffleVectorInstruction()
833 assert(!isa<ConstantInt>(C) && "Unexpected Integer UnaryOp"); in ConstantFoldUnaryInstruction()
855 Constant *ExtractIdx = ConstantInt::get(Ty, i); in ConstantFoldUnaryInstruction()
1003 if (ConstantInt *CI2 = dyn_cast<ConstantInt>(C2)) { in ConstantFoldBinaryInstruction()
1117 } else if (isa<ConstantInt>(C1)) { in ConstantFoldBinaryInstruction()
1123 if (ConstantInt *CI1 = dyn_cast<ConstantInt>(C1)) { in ConstantFoldBinaryInstruction()
1124 if (ConstantInt *CI2 = dyn_cast<ConstantInt>(C2)) { in ConstantFoldBinaryInstruction()
1131 return ConstantInt::get(CI1->getContext(), C1V + C2V); in ConstantFoldBinaryInstruction()
1133 return ConstantInt::get(CI1->getContext(), C1V - C2V); in ConstantFoldBinaryInstruction()
1135 return ConstantInt::get(CI1->getContext(), C1V * C2V); in ConstantFoldBinaryInstruction()
1138 return ConstantInt::get(CI1->getContext(), C1V.udiv(C2V)); in ConstantFoldBinaryInstruction()
1143 return ConstantInt::get(CI1->getContext(), C1V.sdiv(C2V)); in ConstantFoldBinaryInstruction()
1146 return ConstantInt::get(CI1->getContext(), C1V.urem(C2V)); in ConstantFoldBinaryInstruction()
1151 return ConstantInt::get(CI1->getContext(), C1V.srem(C2V)); in ConstantFoldBinaryInstruction()
1153 return ConstantInt::get(CI1->getContext(), C1V & C2V); in ConstantFoldBinaryInstruction()
1155 return ConstantInt::get(CI1->getContext(), C1V | C2V); in ConstantFoldBinaryInstruction()
1157 return ConstantInt::get(CI1->getContext(), C1V ^ C2V); in ConstantFoldBinaryInstruction()
1160 return ConstantInt::get(CI1->getContext(), C1V.shl(C2V)); in ConstantFoldBinaryInstruction()
1164 return ConstantInt::get(CI1->getContext(), C1V.lshr(C2V)); in ConstantFoldBinaryInstruction()
1168 return ConstantInt::get(CI1->getContext(), C1V.ashr(C2V)); in ConstantFoldBinaryInstruction()
1228 Constant *ExtractIdx = ConstantInt::get(Ty, i); in ConstantFoldBinaryInstruction()
1285 return ConstantInt::getFalse(C1->getContext()); in ConstantFoldBinaryInstruction()
1324 if (!isa<ConstantInt>(C1) || !isa<ConstantInt>(C2)) in IdxCompare()
1328 if (cast<ConstantInt>(C1)->getValue().getActiveBits() > 64 || in IdxCompare()
1329 cast<ConstantInt>(C2)->getValue().getActiveBits() > 64) in IdxCompare()
1334 int64_t C1Val = cast<ConstantInt>(C1)->getSExtValue(); in IdxCompare()
1335 int64_t C2Val = cast<ConstantInt>(C2)->getSExtValue(); in IdxCompare()
1374 ConstantInt *R = nullptr; in evaluateFCmpRelation()
1375 R = dyn_cast<ConstantInt>( in evaluateFCmpRelation()
1379 R = dyn_cast<ConstantInt>( in evaluateFCmpRelation()
1383 R = dyn_cast<ConstantInt>( in evaluateFCmpRelation()
1464 ConstantInt *R = nullptr; in evaluateICmpRelation()
1466 R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, V1, V2)); in evaluateICmpRelation()
1470 R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, V1, V2)); in evaluateICmpRelation()
1474 R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, V1, V2)); in evaluateICmpRelation()
1673 if (isa<ConstantInt>(CE1->getOperand(i))) in evaluateICmpRelation()
1681 if (isa<ConstantInt>(CE2->getOperand(i))) in evaluateICmpRelation()
1732 return ConstantInt::get(ResultTy, CmpInst::isTrueWhenEqual(Predicate)); in ConstantFoldCompareInstruction()
1736 return ConstantInt::get(ResultTy, CmpInst::isUnordered(Predicate)); in ConstantFoldCompareInstruction()
1747 return ConstantInt::getFalse(C1->getContext()); in ConstantFoldCompareInstruction()
1749 return ConstantInt::getTrue(C1->getContext()); in ConstantFoldCompareInstruction()
1759 return ConstantInt::getFalse(C1->getContext()); in ConstantFoldCompareInstruction()
1761 return ConstantInt::getTrue(C1->getContext()); in ConstantFoldCompareInstruction()
1779 if (isa<ConstantInt>(C2)) in ConstantFoldCompareInstruction()
1789 if (isa<ConstantInt>(C1) && isa<ConstantInt>(C2)) { in ConstantFoldCompareInstruction()
1790 const APInt &V1 = cast<ConstantInt>(C1)->getValue(); in ConstantFoldCompareInstruction()
1791 const APInt &V2 = cast<ConstantInt>(C2)->getValue(); in ConstantFoldCompareInstruction()
1794 case ICmpInst::ICMP_EQ: return ConstantInt::get(ResultTy, V1 == V2); in ConstantFoldCompareInstruction()
1795 case ICmpInst::ICMP_NE: return ConstantInt::get(ResultTy, V1 != V2); in ConstantFoldCompareInstruction()
1796 case ICmpInst::ICMP_SLT: return ConstantInt::get(ResultTy, V1.slt(V2)); in ConstantFoldCompareInstruction()
1797 case ICmpInst::ICMP_SGT: return ConstantInt::get(ResultTy, V1.sgt(V2)); in ConstantFoldCompareInstruction()
1798 case ICmpInst::ICMP_SLE: return ConstantInt::get(ResultTy, V1.sle(V2)); in ConstantFoldCompareInstruction()
1799 case ICmpInst::ICMP_SGE: return ConstantInt::get(ResultTy, V1.sge(V2)); in ConstantFoldCompareInstruction()
1800 case ICmpInst::ICMP_ULT: return ConstantInt::get(ResultTy, V1.ult(V2)); in ConstantFoldCompareInstruction()
1801 case ICmpInst::ICMP_UGT: return ConstantInt::get(ResultTy, V1.ugt(V2)); in ConstantFoldCompareInstruction()
1802 case ICmpInst::ICMP_ULE: return ConstantInt::get(ResultTy, V1.ule(V2)); in ConstantFoldCompareInstruction()
1803 case ICmpInst::ICMP_UGE: return ConstantInt::get(ResultTy, V1.uge(V2)); in ConstantFoldCompareInstruction()
1814 return ConstantInt::get(ResultTy, R==APFloat::cmpUnordered); in ConstantFoldCompareInstruction()
1816 return ConstantInt::get(ResultTy, R!=APFloat::cmpUnordered); in ConstantFoldCompareInstruction()
1818 return ConstantInt::get(ResultTy, R==APFloat::cmpUnordered || in ConstantFoldCompareInstruction()
1821 return ConstantInt::get(ResultTy, R==APFloat::cmpEqual); in ConstantFoldCompareInstruction()
1823 return ConstantInt::get(ResultTy, R!=APFloat::cmpEqual); in ConstantFoldCompareInstruction()
1825 return ConstantInt::get(ResultTy, R==APFloat::cmpLessThan || in ConstantFoldCompareInstruction()
1828 return ConstantInt::get(ResultTy, R==APFloat::cmpUnordered || in ConstantFoldCompareInstruction()
1831 return ConstantInt::get(ResultTy, R==APFloat::cmpLessThan); in ConstantFoldCompareInstruction()
1833 return ConstantInt::get(ResultTy, R==APFloat::cmpUnordered || in ConstantFoldCompareInstruction()
1836 return ConstantInt::get(ResultTy, R==APFloat::cmpGreaterThan); in ConstantFoldCompareInstruction()
1838 return ConstantInt::get(ResultTy, R!=APFloat::cmpGreaterThan); in ConstantFoldCompareInstruction()
1840 return ConstantInt::get(ResultTy, R==APFloat::cmpLessThan || in ConstantFoldCompareInstruction()
1843 return ConstantInt::get(ResultTy, R!=APFloat::cmpLessThan); in ConstantFoldCompareInstruction()
1845 return ConstantInt::get(ResultTy, R==APFloat::cmpGreaterThan || in ConstantFoldCompareInstruction()
1870 ConstantExpr::getExtractElement(C1, ConstantInt::get(Ty, I)); in ConstantFoldCompareInstruction()
1872 ConstantExpr::getExtractElement(C2, ConstantInt::get(Ty, I)); in ConstantFoldCompareInstruction()
1945 return ConstantInt::get(ResultTy, Result); in ConstantFoldCompareInstruction()
2016 return ConstantInt::get(ResultTy, Result); in ConstantFoldCompareInstruction()
2073 if (auto *CI = dyn_cast<ConstantInt>(Idxs[0])) { in isInBoundsIndices()
2078 CI = dyn_cast_or_null<ConstantInt>(CV->getSplatValue()); in isInBoundsIndices()
2091 const ConstantInt *CI) { in isIndexInRangeOfArrayType()
2151 ConstantInt *CI = dyn_cast<ConstantInt>(Idx0); in foldGEPOfGEP()
2295 !isa<ConstantInt>(Idxs[0]) && !isa<ConstantDataVector>(Idxs[0]); in ConstantFoldGetElementPtr()
2298 if (!isa<ConstantInt>(Idxs[i]) && !isa<ConstantDataVector>(Idxs[i])) { in ConstantFoldGetElementPtr()
2303 if (!isa<ConstantInt>(Idxs[i - 1]) && !isa<ConstantDataVector>(Idxs[i - 1])) in ConstantFoldGetElementPtr()
2322 if (ConstantInt *CI = dyn_cast<ConstantInt>(Idxs[i])) { in ConstantFoldGetElementPtr()
2335 auto *CI = cast<ConstantInt>(CV->getElementAsConstant(I)); in ConstantFoldGetElementPtr()
2377 ConstantInt::get(CurrIdx->getType()->getScalarType(), NumElements); in ConstantFoldGetElementPtr()