Lines Matching refs:ConstantExpr
66 ConstantExpr::getBitCast(Splat, DstEltTy)); in BitCastConstantVector()
73 ConstantExpr::getExtractElement(CV, ConstantInt::get(Ty, i)); in BitCastConstantVector()
74 C = ConstantExpr::getBitCast(C, DstEltTy); in BitCastConstantVector()
88 ConstantExpr *Op, ///< the first cast constant expression in foldConstantCastPair()
135 return ConstantExpr::getInBoundsGetElementPtr(PTy->getElementType(), in FoldBitCast()
159 return ConstantExpr::getBitCast(ConstantVector::get(V), DestPTy); in FoldBitCast()
236 ConstantExpr *CE = dyn_cast<ConstantExpr>(C); in ExtractConstantBytes()
254 return ConstantExpr::getOr(LHS, RHS); in ExtractConstantBytes()
268 return ConstantExpr::getAnd(LHS, RHS); in ExtractConstantBytes()
340 Res = ConstantExpr::getLShr(Res, in ExtractConstantBytes()
342 return ConstantExpr::getTrunc(Res, IntegerType::get(C->getContext(), in ExtractConstantBytes()
373 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) { in ConstantFoldCastInstruction()
377 return ConstantExpr::getCast(newOpc, CE->getOperand(0), DestTy); in ConstantFoldCastInstruction()
399 return ConstantExpr::getPointerCast(CE->getOperand(0), DestTy); in ConstantFoldCastInstruction()
416 ConstantExpr::getCast(opc, Splat, DstEltTy)); in ConstantFoldCastInstruction()
424 ConstantExpr::getExtractElement(V, ConstantInt::get(Ty, i)); in ConstantFoldCastInstruction()
425 res.push_back(ConstantExpr::getCast(opc, C, DstEltTy)); in ConstantFoldCastInstruction()
542 Constant *V1Element = ConstantExpr::getExtractElement(V1, in ConstantFoldSelectInstruction()
544 Constant *V2Element = ConstantExpr::getExtractElement(V2, in ConstantFoldSelectInstruction()
588 if (isa<ConstantExpr>(C)) in ConstantFoldSelectInstruction()
604 if (ConstantExpr *TrueVal = dyn_cast<ConstantExpr>(V1)) { in ConstantFoldSelectInstruction()
607 return ConstantExpr::getSelect(Cond, TrueVal->getOperand(1), V2); in ConstantFoldSelectInstruction()
609 if (ConstantExpr *FalseVal = dyn_cast<ConstantExpr>(V2)) { in ConstantFoldSelectInstruction()
612 return ConstantExpr::getSelect(Cond, V1, FalseVal->getOperand(2)); in ConstantFoldSelectInstruction()
642 if (auto *CE = dyn_cast<ConstantExpr>(Val)) { in ConstantFoldExtractElementInstruction()
649 Constant *ScalarOp = ConstantExpr::getExtractElement(Op, Idx); in ConstantFoldExtractElementInstruction()
664 return ConstantExpr::getExtractElement(CE->getOperand(0), CIdx); in ConstantFoldExtractElementInstruction()
709 Constant *C = ConstantExpr::getExtractElement(Val, ConstantInt::get(Ty, i)); in ConstantFoldInsertElementInstruction()
735 ConstantExpr::getExtractElement(V1, ConstantInt::get(Ty, 0)); in ConstantFoldShuffleVectorInstruction()
759 ConstantExpr::getExtractElement(V2, in ConstantFoldShuffleVectorInstruction()
763 InElt = ConstantExpr::getExtractElement(V1, ConstantInt::get(Ty, Elt)); in ConstantFoldShuffleVectorInstruction()
848 Constant *Elt = ConstantExpr::get(Opcode, Splat); in ConstantFoldUnaryInstruction()
856 Constant *Elt = ConstantExpr::getExtractElement(C, ExtractIdx); in ConstantFoldUnaryInstruction()
858 Result.push_back(ConstantExpr::get(Opcode, Elt)); in ConstantFoldUnaryInstruction()
877 Constant *Identity = ConstantExpr::getBinOpIdentity(Opcode, C1->getType()); in ConstantFoldBinaryInstruction()
1035 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) { in ConstantFoldBinaryInstruction()
1096 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) { in ConstantFoldBinaryInstruction()
1105 return ConstantExpr::getCompare(pred, CE1->getOperand(0), in ConstantFoldBinaryInstruction()
1112 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) in ConstantFoldBinaryInstruction()
1114 return ConstantExpr::getLShr(C1, C2); in ConstantFoldBinaryInstruction()
1120 return ConstantExpr::get(Opcode, C2, C1); in ConstantFoldBinaryInstruction()
1219 ConstantExpr::get(Opcode, C1Splat, C2Splat)); in ConstantFoldBinaryInstruction()
1229 Constant *LHS = ConstantExpr::getExtractElement(C1, ExtractIdx); in ConstantFoldBinaryInstruction()
1230 Constant *RHS = ConstantExpr::getExtractElement(C2, ExtractIdx); in ConstantFoldBinaryInstruction()
1236 Result.push_back(ConstantExpr::get(Opcode, LHS, RHS)); in ConstantFoldBinaryInstruction()
1243 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) { in ConstantFoldBinaryInstruction()
1251 Constant *T = ConstantExpr::get(Opcode, CE1->getOperand(1), C2); in ConstantFoldBinaryInstruction()
1252 if (!isa<ConstantExpr>(T) || cast<ConstantExpr>(T)->getOpcode() != Opcode) in ConstantFoldBinaryInstruction()
1253 return ConstantExpr::get(Opcode, CE1->getOperand(0), T); in ConstantFoldBinaryInstruction()
1255 } else if (isa<ConstantExpr>(C2)) { in ConstantFoldBinaryInstruction()
1267 return ConstantExpr::getXor(C1, C2); in ConstantFoldBinaryInstruction()
1269 return ConstantExpr::getAnd(C1, C2); in ConstantFoldBinaryInstruction()
1371 if (!isa<ConstantExpr>(V1)) { in evaluateFCmpRelation()
1372 if (!isa<ConstantExpr>(V2)) { in evaluateFCmpRelation()
1376 ConstantExpr::getFCmp(FCmpInst::FCMP_OEQ, V1, V2)); in evaluateFCmpRelation()
1380 ConstantExpr::getFCmp(FCmpInst::FCMP_OLT, V1, V2)); in evaluateFCmpRelation()
1384 ConstantExpr::getFCmp(FCmpInst::FCMP_OGT, V1, V2)); in evaluateFCmpRelation()
1399 ConstantExpr *CE1 = cast<ConstantExpr>(V1); in evaluateFCmpRelation()
1458 if (!isa<ConstantExpr>(V1) && !isa<GlobalValue>(V1) && in evaluateICmpRelation()
1460 if (!isa<GlobalValue>(V2) && !isa<ConstantExpr>(V2) && 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()
1489 if (isa<ConstantExpr>(V2)) { // Swap as necessary. in evaluateICmpRelation()
1517 if (isa<ConstantExpr>(V2)) { // Swap as necessary. in evaluateICmpRelation()
1543 ConstantExpr *CE1 = cast<ConstantExpr>(V1); in evaluateICmpRelation()
1626 ConstantExpr *CE2 = cast<ConstantExpr>(V2); in evaluateICmpRelation()
1780 return ConstantExpr::getXor(C1, ConstantExpr::getNot(C2)); in ConstantFoldCompareInstruction()
1781 return ConstantExpr::getXor(ConstantExpr::getNot(C1), C2); in ConstantFoldCompareInstruction()
1783 return ConstantExpr::getXor(C1, C2); in ConstantFoldCompareInstruction()
1855 ConstantExpr::getCompare(pred, C1Splat, C2Splat)); in ConstantFoldCompareInstruction()
1870 ConstantExpr::getExtractElement(C1, ConstantInt::get(Ty, I)); in ConstantFoldCompareInstruction()
1872 ConstantExpr::getExtractElement(C2, ConstantInt::get(Ty, I)); in ConstantFoldCompareInstruction()
1874 ResElts.push_back(ConstantExpr::getCompare(pred, C1E, C2E)); in ConstantFoldCompareInstruction()
1883 (isa<ConstantExpr>(C1) || isa<ConstantExpr>(C2))) { in ConstantFoldCompareInstruction()
2022 if (ConstantExpr *CE2 = dyn_cast<ConstantExpr>(C2)) { in ConstantFoldCompareInstruction()
2027 Constant *Inverse = ConstantExpr::getBitCast(C1, CE2Op0->getType()); in ConstantFoldCompareInstruction()
2028 return ConstantExpr::getICmp(pred, Inverse, CE2Op0); in ConstantFoldCompareInstruction()
2033 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) { in ConstantFoldCompareInstruction()
2039 Constant *CE1Inverse = ConstantExpr::getTrunc(CE1, CE1Op0->getType()); in ConstantFoldCompareInstruction()
2042 Constant *C2Inverse = ConstantExpr::getTrunc(C2, CE1Op0->getType()); in ConstantFoldCompareInstruction()
2043 if (ConstantExpr::getCast(CE1->getOpcode(), C2Inverse, in ConstantFoldCompareInstruction()
2045 return ConstantExpr::getICmp(pred, CE1Inverse, C2Inverse); in ConstantFoldCompareInstruction()
2050 if ((!isa<ConstantExpr>(C1) && isa<ConstantExpr>(C2)) || in ConstantFoldCompareInstruction()
2056 return ConstantExpr::getICmp(pred, C2, C1); in ConstantFoldCompareInstruction()
2121 return ConstantExpr::getGetElementPtr( in foldGEPOfGEP()
2178 Idx0 = ConstantExpr::getSExtOrBitCast(Idx0, CommonTy); in foldGEPOfGEP()
2179 LastIdx = ConstantExpr::getSExtOrBitCast(LastIdx, CommonTy); in foldGEPOfGEP()
2182 NewIndices.push_back(ConstantExpr::get(Instruction::Add, Idx0, LastIdx)); in foldGEPOfGEP()
2192 return ConstantExpr::getGetElementPtr( in foldGEPOfGEP()
2254 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) { in ConstantFoldGetElementPtr()
2280 return ConstantExpr::getGetElementPtr(SrcArrayTy, in ConstantFoldGetElementPtr()
2385 NewIdxs[i] = ConstantExpr::getSRem(CurrIdx, Factor); in ConstantFoldGetElementPtr()
2387 Constant *Div = ConstantExpr::getSDiv(CurrIdx, Factor); in ConstantFoldGetElementPtr()
2405 PrevIdx = ConstantExpr::getSExt(PrevIdx, ExtendedTy); in ConstantFoldGetElementPtr()
2408 Div = ConstantExpr::getSExt(Div, ExtendedTy); in ConstantFoldGetElementPtr()
2410 NewIdxs[i - 1] = ConstantExpr::getAdd(PrevIdx, Div); in ConstantFoldGetElementPtr()
2417 return ConstantExpr::getGetElementPtr(PointeeTy, C, NewIdxs, InBounds, in ConstantFoldGetElementPtr()
2426 return ConstantExpr::getGetElementPtr(PointeeTy, C, Idxs, in ConstantFoldGetElementPtr()