Lines Matching refs:ConstantExpr
63 ConstantExpr::getExtractElement(CV, ConstantInt::get(Ty, i)); in BitCastConstantVector()
64 C = ConstantExpr::getBitCast(C, DstEltTy); in BitCastConstantVector()
78 ConstantExpr *Op, ///< the first cast constant expression in foldConstantCastPair()
133 return ConstantExpr::getInBoundsGetElementPtr(PTy->getElementType(), in FoldBitCast()
156 return ConstantExpr::getBitCast(ConstantVector::get(V), DestPTy); in FoldBitCast()
233 ConstantExpr *CE = dyn_cast<ConstantExpr>(C); in ExtractConstantBytes()
251 return ConstantExpr::getOr(LHS, RHS); in ExtractConstantBytes()
265 return ConstantExpr::getAnd(LHS, RHS); in ExtractConstantBytes()
335 Res = ConstantExpr::getLShr(Res, in ExtractConstantBytes()
337 return ConstantExpr::getTrunc(Res, IntegerType::get(C->getContext(), in ExtractConstantBytes()
355 return ConstantExpr::getNUWMul(E, N); in getFoldedSizeOf()
363 return ConstantExpr::getNullValue(DestTy); in getFoldedSizeOf()
376 return ConstantExpr::getNUWMul(MemberSize, N); in getFoldedSizeOf()
395 Constant *C = ConstantExpr::getSizeOf(Ty); in getFoldedSizeOf()
396 C = ConstantExpr::getCast(CastInst::getCastOpcode(C, false, in getFoldedSizeOf()
410 Constant *C = ConstantExpr::getAlignOf(ATy->getElementType()); in getFoldedAlignOf()
411 C = ConstantExpr::getCast(CastInst::getCastOpcode(C, false, in getFoldedAlignOf()
459 Constant *C = ConstantExpr::getAlignOf(Ty); in getFoldedAlignOf()
460 C = ConstantExpr::getCast(CastInst::getCastOpcode(C, false, in getFoldedAlignOf()
473 Constant *N = ConstantExpr::getCast(CastInst::getCastOpcode(FieldNo, false, in getFoldedOffsetOf()
477 return ConstantExpr::getNUWMul(E, N); in getFoldedOffsetOf()
497 Constant *N = ConstantExpr::getCast(CastInst::getCastOpcode(FieldNo, in getFoldedOffsetOf()
502 return ConstantExpr::getNUWMul(MemberSize, N); in getFoldedOffsetOf()
512 Constant *C = ConstantExpr::getOffsetOf(Ty, FieldNo); in getFoldedOffsetOf()
513 C = ConstantExpr::getCast(CastInst::getCastOpcode(C, false, in getFoldedOffsetOf()
537 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) { in ConstantFoldCastInstruction()
541 return ConstantExpr::getCast(newOpc, CE->getOperand(0), DestTy); in ConstantFoldCastInstruction()
563 return ConstantExpr::getPointerCast(CE->getOperand(0), DestTy); in ConstantFoldCastInstruction()
579 ConstantExpr::getExtractElement(V, ConstantInt::get(Ty, i)); in ConstantFoldCastInstruction()
580 res.push_back(ConstantExpr::getCast(opc, C, DstEltTy)); in ConstantFoldCastInstruction()
633 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) in ConstantFoldCastInstruction()
652 Idx = ConstantExpr::getCast(CastInst::getCastOpcode(Idx, true, in ConstantFoldCastInstruction()
655 return ConstantExpr::getMul(C, Idx); in ConstantFoldCastInstruction()
743 Constant *V1Element = ConstantExpr::getExtractElement(V1, in ConstantFoldSelectInstruction()
745 Constant *V2Element = ConstantExpr::getExtractElement(V2, in ConstantFoldSelectInstruction()
772 if (ConstantExpr *TrueVal = dyn_cast<ConstantExpr>(V1)) { in ConstantFoldSelectInstruction()
775 return ConstantExpr::getSelect(Cond, TrueVal->getOperand(1), V2); in ConstantFoldSelectInstruction()
777 if (ConstantExpr *FalseVal = dyn_cast<ConstantExpr>(V2)) { in ConstantFoldSelectInstruction()
780 return ConstantExpr::getSelect(Cond, V1, FalseVal->getOperand(2)); in ConstantFoldSelectInstruction()
828 Constant *C = ConstantExpr::getExtractElement(Val, ConstantInt::get(Ty, i)); in ConstantFoldInsertElementInstruction()
846 if (isa<ConstantExpr>(Mask)) return nullptr; in ConstantFoldShuffleVectorInstruction()
864 ConstantExpr::getExtractElement(V2, in ConstantFoldShuffleVectorInstruction()
868 InElt = ConstantExpr::getExtractElement(V1, ConstantInt::get(Ty, Elt)); in ConstantFoldShuffleVectorInstruction()
1064 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) { in ConstantFoldBinaryInstruction()
1105 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) { in ConstantFoldBinaryInstruction()
1114 return ConstantExpr::getCompare(pred, CE1->getOperand(0), in ConstantFoldBinaryInstruction()
1121 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) in ConstantFoldBinaryInstruction()
1123 return ConstantExpr::getLShr(C1, C2); in ConstantFoldBinaryInstruction()
1129 return ConstantExpr::get(Opcode, C2, C1); in ConstantFoldBinaryInstruction()
1226 Constant *LHS = ConstantExpr::getExtractElement(C1, ExtractIdx); in ConstantFoldBinaryInstruction()
1227 Constant *RHS = ConstantExpr::getExtractElement(C2, ExtractIdx); in ConstantFoldBinaryInstruction()
1233 Result.push_back(ConstantExpr::get(Opcode, LHS, RHS)); in ConstantFoldBinaryInstruction()
1239 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) { in ConstantFoldBinaryInstruction()
1247 Constant *T = ConstantExpr::get(Opcode, CE1->getOperand(1), C2); in ConstantFoldBinaryInstruction()
1248 if (!isa<ConstantExpr>(T) || cast<ConstantExpr>(T)->getOpcode() != Opcode) in ConstantFoldBinaryInstruction()
1249 return ConstantExpr::get(Opcode, CE1->getOperand(0), T); in ConstantFoldBinaryInstruction()
1251 } else if (isa<ConstantExpr>(C2)) { in ConstantFoldBinaryInstruction()
1263 return ConstantExpr::getXor(C1, C2); in ConstantFoldBinaryInstruction()
1265 return ConstantExpr::getAnd(C1, C2); in ConstantFoldBinaryInstruction()
1366 if (!isa<ConstantExpr>(V1)) { in evaluateFCmpRelation()
1367 if (!isa<ConstantExpr>(V2)) { in evaluateFCmpRelation()
1371 ConstantExpr::getFCmp(FCmpInst::FCMP_OEQ, V1, V2)); in evaluateFCmpRelation()
1375 ConstantExpr::getFCmp(FCmpInst::FCMP_OLT, V1, V2)); in evaluateFCmpRelation()
1379 ConstantExpr::getFCmp(FCmpInst::FCMP_OGT, V1, V2)); in evaluateFCmpRelation()
1394 ConstantExpr *CE1 = cast<ConstantExpr>(V1); in evaluateFCmpRelation()
1453 if (!isa<ConstantExpr>(V1) && !isa<GlobalValue>(V1) && in evaluateICmpRelation()
1455 if (!isa<GlobalValue>(V2) && !isa<ConstantExpr>(V2) && 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()
1484 if (isa<ConstantExpr>(V2)) { // Swap as necessary. in evaluateICmpRelation()
1512 if (isa<ConstantExpr>(V2)) { // Swap as necessary. in evaluateICmpRelation()
1538 ConstantExpr *CE1 = cast<ConstantExpr>(V1); in evaluateICmpRelation()
1623 ConstantExpr *CE2 = cast<ConstantExpr>(V2); in evaluateICmpRelation()
1764 return ConstantExpr::getXor(C1, ConstantExpr::getNot(C2)); in ConstantFoldCompareInstruction()
1765 return ConstantExpr::getXor(ConstantExpr::getNot(C1), C2); in ConstantFoldCompareInstruction()
1767 return ConstantExpr::getXor(C1, C2); in ConstantFoldCompareInstruction()
1840 ConstantExpr::getExtractElement(C1, ConstantInt::get(Ty, i)); in ConstantFoldCompareInstruction()
1842 ConstantExpr::getExtractElement(C2, ConstantInt::get(Ty, i)); in ConstantFoldCompareInstruction()
1844 ResElts.push_back(ConstantExpr::getCompare(pred, C1E, C2E)); in ConstantFoldCompareInstruction()
1853 (isa<ConstantExpr>(C1) || isa<ConstantExpr>(C2))) { in ConstantFoldCompareInstruction()
1985 if (ConstantExpr *CE2 = dyn_cast<ConstantExpr>(C2)) { in ConstantFoldCompareInstruction()
1989 Constant *Inverse = ConstantExpr::getBitCast(C1, CE2Op0->getType()); in ConstantFoldCompareInstruction()
1990 return ConstantExpr::getICmp(pred, Inverse, CE2Op0); in ConstantFoldCompareInstruction()
1995 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) { in ConstantFoldCompareInstruction()
2001 Constant *CE1Inverse = ConstantExpr::getTrunc(CE1, CE1Op0->getType()); in ConstantFoldCompareInstruction()
2004 Constant *C2Inverse = ConstantExpr::getTrunc(C2, CE1Op0->getType()); in ConstantFoldCompareInstruction()
2005 if (ConstantExpr::getCast(CE1->getOpcode(), C2Inverse, in ConstantFoldCompareInstruction()
2007 return ConstantExpr::getICmp(pred, CE1Inverse, C2Inverse); in ConstantFoldCompareInstruction()
2012 if ((!isa<ConstantExpr>(C1) && isa<ConstantExpr>(C2)) || in ConstantFoldCompareInstruction()
2018 return ConstantExpr::getICmp(pred, C2, C1); in ConstantFoldCompareInstruction()
2118 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) { in ConstantFoldGetElementPtr()
2179 Constant *C1 = ConstantExpr::getSExtOrBitCast(Idx0, CommonTy); in ConstantFoldGetElementPtr()
2180 Constant *C2 = ConstantExpr::getSExtOrBitCast(Combined, CommonTy); in ConstantFoldGetElementPtr()
2181 Combined = ConstantExpr::get(Instruction::Add, C1, C2); in ConstantFoldGetElementPtr()
2184 ConstantExpr::get(Instruction::Add, Idx0, Combined); in ConstantFoldGetElementPtr()
2198 return ConstantExpr::getGetElementPtr( in ConstantFoldGetElementPtr()
2226 return ConstantExpr::getGetElementPtr(SrcArrayTy, in ConstantFoldGetElementPtr()
2329 NewIdxs[i] = ConstantExpr::getSRem(CurrIdx, Factor); in ConstantFoldGetElementPtr()
2331 Constant *Div = ConstantExpr::getSDiv(CurrIdx, Factor); in ConstantFoldGetElementPtr()
2348 PrevIdx = ConstantExpr::getSExt(PrevIdx, ExtendedTy); in ConstantFoldGetElementPtr()
2351 Div = ConstantExpr::getSExt(Div, ExtendedTy); in ConstantFoldGetElementPtr()
2353 NewIdxs[i - 1] = ConstantExpr::getAdd(PrevIdx, Div); in ConstantFoldGetElementPtr()
2360 return ConstantExpr::getGetElementPtr(PointeeTy, C, NewIdxs, InBounds, in ConstantFoldGetElementPtr()
2369 return ConstantExpr::getGetElementPtr(PointeeTy, C, Idxs, in ConstantFoldGetElementPtr()