Lines Matching refs:ConstantInt
71 ConstantExpr::getExtractElement(CV, ConstantInt::get(Ty, i)); in BitCastConstantVector()
156 if (isa<ConstantInt>(V) || isa<ConstantFP>(V)) in FoldBitCast()
166 if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) { in FoldBitCast()
197 return ConstantInt::get(FP->getContext(), in FoldBitCast()
224 if (ConstantInt *CI = dyn_cast<ConstantInt>(C)) { in ExtractConstantBytes()
229 return ConstantInt::get(CI->getContext(), V); in ExtractConstantBytes()
245 if (ConstantInt *RHSC = dyn_cast<ConstantInt>(RHS)) in ExtractConstantBytes()
269 ConstantInt *Amt = dyn_cast<ConstantInt>(CE->getOperand(1)); in ExtractConstantBytes()
292 ConstantInt *Amt = dyn_cast<ConstantInt>(CE->getOperand(1)); in ExtractConstantBytes()
339 ConstantInt::get(Res->getType(), ByteStart*8)); in ExtractConstantBytes()
422 ConstantExpr::getExtractElement(V, ConstantInt::get(Ty, i)); in ConstantFoldCastInstruction()
456 return ConstantInt::get(FPC->getContext(), IntVal); in ConstantFoldCastInstruction()
466 return ConstantInt::get(DestTy, 0); in ConstantFoldCastInstruction()
471 if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) { in ConstantFoldCastInstruction()
481 if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) { in ConstantFoldCastInstruction()
483 return ConstantInt::get(V->getContext(), in ConstantFoldCastInstruction()
488 if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) { in ConstantFoldCastInstruction()
490 return ConstantInt::get(V->getContext(), in ConstantFoldCastInstruction()
499 if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) { in ConstantFoldCastInstruction()
500 return ConstantInt::get(V->getContext(), in ConstantFoldCastInstruction()
535 ConstantInt::get(Ty, i)); in ConstantFoldSelectInstruction()
537 ConstantInt::get(Ty, i)); in ConstantFoldSelectInstruction()
546 if (!isa<ConstantInt>(Cond)) break; in ConstantFoldSelectInstruction()
583 if (isa<ConstantInt>(C) || isa<GlobalVariable>(C) || isa<ConstantFP>(C) || in ConstantFoldSelectInstruction()
623 auto *CIdx = dyn_cast<ConstantInt>(Idx); in ConstantFoldExtractElementInstruction()
651 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()
734 ConstantExpr::getExtractElement(V1, ConstantInt::get(Ty, 0)); in ConstantFoldShuffleVectorInstruction()
764 ConstantInt::get(Ty, Elt - SrcNumElts)); in ConstantFoldShuffleVectorInstruction()
767 InElt = ConstantExpr::getExtractElement(V1, ConstantInt::get(Ty, Elt)); in ConstantFoldShuffleVectorInstruction()
837 assert(!isa<ConstantInt>(C) && "Unexpected Integer UnaryOp"); in ConstantFoldUnaryInstruction()
859 Constant *ExtractIdx = ConstantInt::get(Ty, i); in ConstantFoldUnaryInstruction()
1007 if (ConstantInt *CI2 = dyn_cast<ConstantInt>(C2)) { in ConstantFoldBinaryInstruction()
1121 } else if (isa<ConstantInt>(C1)) { in ConstantFoldBinaryInstruction()
1127 if (ConstantInt *CI1 = dyn_cast<ConstantInt>(C1)) { in ConstantFoldBinaryInstruction()
1128 if (ConstantInt *CI2 = dyn_cast<ConstantInt>(C2)) { in ConstantFoldBinaryInstruction()
1135 return ConstantInt::get(CI1->getContext(), C1V + C2V); in ConstantFoldBinaryInstruction()
1137 return ConstantInt::get(CI1->getContext(), C1V - C2V); in ConstantFoldBinaryInstruction()
1139 return ConstantInt::get(CI1->getContext(), C1V * C2V); in ConstantFoldBinaryInstruction()
1142 return ConstantInt::get(CI1->getContext(), C1V.udiv(C2V)); in ConstantFoldBinaryInstruction()
1147 return ConstantInt::get(CI1->getContext(), C1V.sdiv(C2V)); in ConstantFoldBinaryInstruction()
1150 return ConstantInt::get(CI1->getContext(), C1V.urem(C2V)); in ConstantFoldBinaryInstruction()
1155 return ConstantInt::get(CI1->getContext(), C1V.srem(C2V)); in ConstantFoldBinaryInstruction()
1157 return ConstantInt::get(CI1->getContext(), C1V & C2V); in ConstantFoldBinaryInstruction()
1159 return ConstantInt::get(CI1->getContext(), C1V | C2V); in ConstantFoldBinaryInstruction()
1161 return ConstantInt::get(CI1->getContext(), C1V ^ C2V); in ConstantFoldBinaryInstruction()
1164 return ConstantInt::get(CI1->getContext(), C1V.shl(C2V)); in ConstantFoldBinaryInstruction()
1168 return ConstantInt::get(CI1->getContext(), C1V.lshr(C2V)); in ConstantFoldBinaryInstruction()
1172 return ConstantInt::get(CI1->getContext(), C1V.ashr(C2V)); in ConstantFoldBinaryInstruction()
1236 Constant *ExtractIdx = ConstantInt::get(Ty, i); in ConstantFoldBinaryInstruction()
1298 return ConstantInt::getFalse(C1->getContext()); in ConstantFoldBinaryInstruction()
1330 ConstantInt *R = nullptr; in evaluateFCmpRelation()
1331 R = dyn_cast<ConstantInt>( in evaluateFCmpRelation()
1335 R = dyn_cast<ConstantInt>( in evaluateFCmpRelation()
1339 R = dyn_cast<ConstantInt>( in evaluateFCmpRelation()
1420 ConstantInt *R = nullptr; in evaluateICmpRelation()
1422 R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, V1, V2)); in evaluateICmpRelation()
1426 R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, V1, V2)); in evaluateICmpRelation()
1430 R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, V1, V2)); in evaluateICmpRelation()
1612 return ConstantInt::get(ResultTy, CmpInst::isTrueWhenEqual(Predicate)); in ConstantFoldCompareInstruction()
1616 return ConstantInt::get(ResultTy, CmpInst::isUnordered(Predicate)); in ConstantFoldCompareInstruction()
1627 return ConstantInt::getFalse(C1->getContext()); in ConstantFoldCompareInstruction()
1629 return ConstantInt::getTrue(C1->getContext()); in ConstantFoldCompareInstruction()
1639 return ConstantInt::getFalse(C1->getContext()); in ConstantFoldCompareInstruction()
1641 return ConstantInt::getTrue(C1->getContext()); in ConstantFoldCompareInstruction()
1659 if (isa<ConstantInt>(C2)) in ConstantFoldCompareInstruction()
1669 if (isa<ConstantInt>(C1) && isa<ConstantInt>(C2)) { in ConstantFoldCompareInstruction()
1670 const APInt &V1 = cast<ConstantInt>(C1)->getValue(); in ConstantFoldCompareInstruction()
1671 const APInt &V2 = cast<ConstantInt>(C2)->getValue(); in ConstantFoldCompareInstruction()
1672 return ConstantInt::get(ResultTy, ICmpInst::compare(V1, V2, Predicate)); in ConstantFoldCompareInstruction()
1676 return ConstantInt::get(ResultTy, FCmpInst::compare(C1V, C2V, Predicate)); in ConstantFoldCompareInstruction()
1699 ConstantExpr::getExtractElement(C1, ConstantInt::get(Ty, I)); in ConstantFoldCompareInstruction()
1701 ConstantExpr::getExtractElement(C2, ConstantInt::get(Ty, I)); in ConstantFoldCompareInstruction()
1780 return ConstantInt::get(ResultTy, Result); in ConstantFoldCompareInstruction()
1868 return ConstantInt::get(ResultTy, Result); in ConstantFoldCompareInstruction()
1925 if (auto *CI = dyn_cast<ConstantInt>(Idxs[0])) { in isInBoundsIndices()
1930 CI = dyn_cast_or_null<ConstantInt>(CV->getSplatValue()); in isInBoundsIndices()
1943 const ConstantInt *CI) { in isIndexInRangeOfArrayType()
1988 ConstantInt *CI = dyn_cast<ConstantInt>(Idx0); in foldGEPOfGEP()
2140 !isa<ConstantInt>(Idxs[0]) && !isa<ConstantDataVector>(Idxs[0]); in ConstantFoldGetElementPtr()
2143 if (!isa<ConstantInt>(Idxs[i]) && !isa<ConstantDataVector>(Idxs[i])) { in ConstantFoldGetElementPtr()
2148 if (!isa<ConstantInt>(Idxs[i - 1]) && !isa<ConstantDataVector>(Idxs[i - 1])) in ConstantFoldGetElementPtr()
2167 if (ConstantInt *CI = dyn_cast<ConstantInt>(Idxs[i])) { in ConstantFoldGetElementPtr()
2180 auto *CI = cast<ConstantInt>(CV->getElementAsConstant(I)); in ConstantFoldGetElementPtr()
2222 ConstantInt::get(CurrIdx->getType()->getScalarType(), NumElements); in ConstantFoldGetElementPtr()