• Home
  • Raw
  • Download

Lines Matching refs:ConstantExpr

62       ConstantExpr::getExtractElement(CV, ConstantInt::get(Ty, i));  in BitCastConstantVector()
63 C = ConstantExpr::getBitCast(C, DstEltTy); in BitCastConstantVector()
77 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()
356 return ConstantExpr::getNUWMul(E, N); in getFoldedSizeOf()
364 return ConstantExpr::getNullValue(DestTy); in getFoldedSizeOf()
377 return ConstantExpr::getNUWMul(MemberSize, N); in getFoldedSizeOf()
396 Constant *C = ConstantExpr::getSizeOf(Ty); in getFoldedSizeOf()
397 C = ConstantExpr::getCast(CastInst::getCastOpcode(C, false, in getFoldedSizeOf()
412 Constant *C = ConstantExpr::getAlignOf(ATy->getElementType()); in getFoldedAlignOf()
413 C = ConstantExpr::getCast(CastInst::getCastOpcode(C, false, in getFoldedAlignOf()
461 Constant *C = ConstantExpr::getAlignOf(Ty); in getFoldedAlignOf()
462 C = ConstantExpr::getCast(CastInst::getCastOpcode(C, false, in getFoldedAlignOf()
476 Constant *N = ConstantExpr::getCast(CastInst::getCastOpcode(FieldNo, false, in getFoldedOffsetOf()
480 return ConstantExpr::getNUWMul(E, N); in getFoldedOffsetOf()
500 Constant *N = ConstantExpr::getCast(CastInst::getCastOpcode(FieldNo, in getFoldedOffsetOf()
505 return ConstantExpr::getNUWMul(MemberSize, N); in getFoldedOffsetOf()
515 Constant *C = ConstantExpr::getOffsetOf(Ty, FieldNo); in getFoldedOffsetOf()
516 C = ConstantExpr::getCast(CastInst::getCastOpcode(C, false, in getFoldedOffsetOf()
540 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) { in ConstantFoldCastInstruction()
544 return ConstantExpr::getCast(newOpc, CE->getOperand(0), DestTy); in ConstantFoldCastInstruction()
559 return ConstantExpr::getPointerCast(CE->getOperand(0), DestTy); in ConstantFoldCastInstruction()
575 ConstantExpr::getExtractElement(V, ConstantInt::get(Ty, i)); in ConstantFoldCastInstruction()
576 res.push_back(ConstantExpr::getCast(opc, C, DstEltTy)); in ConstantFoldCastInstruction()
631 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) in ConstantFoldCastInstruction()
641 Idx = ConstantExpr::getCast(CastInst::getCastOpcode(Idx, true, in ConstantFoldCastInstruction()
644 return ConstantExpr::getMul(C, Idx); in ConstantFoldCastInstruction()
737 Constant *V1Element = ConstantExpr::getExtractElement(V1, in ConstantFoldSelectInstruction()
739 Constant *V2Element = ConstantExpr::getExtractElement(V2, in ConstantFoldSelectInstruction()
766 if (ConstantExpr *TrueVal = dyn_cast<ConstantExpr>(V1)) { in ConstantFoldSelectInstruction()
769 return ConstantExpr::getSelect(Cond, TrueVal->getOperand(1), V2); in ConstantFoldSelectInstruction()
771 if (ConstantExpr *FalseVal = dyn_cast<ConstantExpr>(V2)) { in ConstantFoldSelectInstruction()
774 return ConstantExpr::getSelect(Cond, V1, FalseVal->getOperand(2)); in ConstantFoldSelectInstruction()
822 Constant *C = ConstantExpr::getExtractElement(Val, ConstantInt::get(Ty, i)); in ConstantFoldInsertElementInstruction()
840 if (isa<ConstantExpr>(Mask)) return nullptr; in ConstantFoldShuffleVectorInstruction()
858 ConstantExpr::getExtractElement(V2, in ConstantFoldShuffleVectorInstruction()
862 InElt = ConstantExpr::getExtractElement(V1, ConstantInt::get(Ty, Elt)); in ConstantFoldShuffleVectorInstruction()
1051 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) { in ConstantFoldBinaryInstruction()
1092 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) { in ConstantFoldBinaryInstruction()
1101 return ConstantExpr::getCompare(pred, CE1->getOperand(0), in ConstantFoldBinaryInstruction()
1108 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) in ConstantFoldBinaryInstruction()
1110 return ConstantExpr::getLShr(C1, C2); in ConstantFoldBinaryInstruction()
1116 return ConstantExpr::get(Opcode, C2, C1); in ConstantFoldBinaryInstruction()
1213 ConstantExpr::getExtractElement(C1, ConstantInt::get(Ty, i)); in ConstantFoldBinaryInstruction()
1215 ConstantExpr::getExtractElement(C2, ConstantInt::get(Ty, i)); in ConstantFoldBinaryInstruction()
1217 Result.push_back(ConstantExpr::get(Opcode, LHS, RHS)); in ConstantFoldBinaryInstruction()
1223 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) { in ConstantFoldBinaryInstruction()
1231 Constant *T = ConstantExpr::get(Opcode, CE1->getOperand(1), C2); in ConstantFoldBinaryInstruction()
1232 if (!isa<ConstantExpr>(T) || cast<ConstantExpr>(T)->getOpcode() != Opcode) in ConstantFoldBinaryInstruction()
1233 return ConstantExpr::get(Opcode, CE1->getOperand(0), T); in ConstantFoldBinaryInstruction()
1235 } else if (isa<ConstantExpr>(C2)) { in ConstantFoldBinaryInstruction()
1247 return ConstantExpr::getXor(C1, C2); in ConstantFoldBinaryInstruction()
1249 return ConstantExpr::getAnd(C1, C2); in ConstantFoldBinaryInstruction()
1350 if (!isa<ConstantExpr>(V1)) { in evaluateFCmpRelation()
1351 if (!isa<ConstantExpr>(V2)) { in evaluateFCmpRelation()
1355 ConstantExpr::getFCmp(FCmpInst::FCMP_OEQ, V1, V2)); in evaluateFCmpRelation()
1359 ConstantExpr::getFCmp(FCmpInst::FCMP_OLT, V1, V2)); in evaluateFCmpRelation()
1363 ConstantExpr::getFCmp(FCmpInst::FCMP_OGT, V1, V2)); in evaluateFCmpRelation()
1378 ConstantExpr *CE1 = cast<ConstantExpr>(V1); in evaluateFCmpRelation()
1437 if (!isa<ConstantExpr>(V1) && !isa<GlobalValue>(V1) && in evaluateICmpRelation()
1439 if (!isa<GlobalValue>(V2) && !isa<ConstantExpr>(V2) && in evaluateICmpRelation()
1445 R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, V1, V2)); in evaluateICmpRelation()
1449 R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, V1, V2)); in evaluateICmpRelation()
1453 R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, V1, V2)); in evaluateICmpRelation()
1468 if (isa<ConstantExpr>(V2)) { // Swap as necessary. in evaluateICmpRelation()
1491 if (isa<ConstantExpr>(V2)) { // Swap as necessary. in evaluateICmpRelation()
1517 ConstantExpr *CE1 = cast<ConstantExpr>(V1); in evaluateICmpRelation()
1603 ConstantExpr *CE2 = cast<ConstantExpr>(V2); in evaluateICmpRelation()
1739 return ConstantExpr::getXor(C1, ConstantExpr::getNot(C2)); in ConstantFoldCompareInstruction()
1740 return ConstantExpr::getXor(ConstantExpr::getNot(C1), C2); in ConstantFoldCompareInstruction()
1742 return ConstantExpr::getXor(C1, C2); in ConstantFoldCompareInstruction()
1815 ConstantExpr::getExtractElement(C1, ConstantInt::get(Ty, i)); in ConstantFoldCompareInstruction()
1817 ConstantExpr::getExtractElement(C2, ConstantInt::get(Ty, i)); in ConstantFoldCompareInstruction()
1819 ResElts.push_back(ConstantExpr::getCompare(pred, C1E, C2E)); in ConstantFoldCompareInstruction()
1828 (isa<ConstantExpr>(C1) || isa<ConstantExpr>(C2))) { in ConstantFoldCompareInstruction()
1960 if (ConstantExpr *CE2 = dyn_cast<ConstantExpr>(C2)) { in ConstantFoldCompareInstruction()
1964 Constant *Inverse = ConstantExpr::getBitCast(C1, CE2Op0->getType()); in ConstantFoldCompareInstruction()
1965 return ConstantExpr::getICmp(pred, Inverse, CE2Op0); in ConstantFoldCompareInstruction()
1970 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) { in ConstantFoldCompareInstruction()
1976 Constant *CE1Inverse = ConstantExpr::getTrunc(CE1, CE1Op0->getType()); in ConstantFoldCompareInstruction()
1979 Constant *C2Inverse = ConstantExpr::getTrunc(C2, CE1Op0->getType()); in ConstantFoldCompareInstruction()
1980 if (ConstantExpr::getCast(CE1->getOpcode(), C2Inverse, in ConstantFoldCompareInstruction()
1982 return ConstantExpr::getICmp(pred, CE1Inverse, C2Inverse); in ConstantFoldCompareInstruction()
1987 if ((!isa<ConstantExpr>(C1) && isa<ConstantExpr>(C2)) || in ConstantFoldCompareInstruction()
1993 return ConstantExpr::getICmp(pred, C2, C1); in ConstantFoldCompareInstruction()
2087 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) { in ConstantFoldGetElementPtrImpl()
2142 Constant *C1 = ConstantExpr::getSExtOrBitCast(Idx0, CommonTy); in ConstantFoldGetElementPtrImpl()
2143 Constant *C2 = ConstantExpr::getSExtOrBitCast(Combined, CommonTy); in ConstantFoldGetElementPtrImpl()
2144 Combined = ConstantExpr::get(Instruction::Add, C1, C2); in ConstantFoldGetElementPtrImpl()
2147 ConstantExpr::get(Instruction::Add, Idx0, Combined); in ConstantFoldGetElementPtrImpl()
2153 return ConstantExpr::getGetElementPtr( in ConstantFoldGetElementPtrImpl()
2180 return ConstantExpr::getGetElementPtr( in ConstantFoldGetElementPtrImpl()
2237 NewIdxs[i] = ConstantExpr::getSRem(CI, Factor); in ConstantFoldGetElementPtrImpl()
2240 Constant *Div = ConstantExpr::getSDiv(CI, Factor); in ConstantFoldGetElementPtrImpl()
2250 PrevIdx = ConstantExpr::getSExt( in ConstantFoldGetElementPtrImpl()
2253 Div = ConstantExpr::getSExt( in ConstantFoldGetElementPtrImpl()
2256 NewIdxs[i - 1] = ConstantExpr::getAdd(PrevIdx, Div); in ConstantFoldGetElementPtrImpl()
2263 return ConstantExpr::getGetElementPtr(PointeeTy, C, NewIdxs, inBounds); in ConstantFoldGetElementPtrImpl()
2271 return ConstantExpr::getInBoundsGetElementPtr(PointeeTy, C, Idxs); in ConstantFoldGetElementPtrImpl()