Lines Matching refs:ConstantExpr

64                                     ConstantExpr::getBitCast(Splat, DstEltTy));  in BitCastConstantVector()
71 ConstantExpr::getExtractElement(CV, ConstantInt::get(Ty, i)); in BitCastConstantVector()
72 C = ConstantExpr::getBitCast(C, DstEltTy); in BitCastConstantVector()
86 ConstantExpr *Op, ///< the first cast constant expression in foldConstantCastPair()
133 return ConstantExpr::getInBoundsGetElementPtr( in FoldBitCast()
157 return ConstantExpr::getBitCast(ConstantVector::get(V), DestPTy); in FoldBitCast()
234 ConstantExpr *CE = dyn_cast<ConstantExpr>(C); in ExtractConstantBytes()
252 return ConstantExpr::getOr(LHS, RHS); in ExtractConstantBytes()
266 return ConstantExpr::getAnd(LHS, RHS); in ExtractConstantBytes()
338 Res = ConstantExpr::getLShr(Res, in ExtractConstantBytes()
340 return ConstantExpr::getTrunc(Res, IntegerType::get(C->getContext(), in ExtractConstantBytes()
371 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) { in ConstantFoldCastInstruction()
375 return ConstantExpr::getCast(newOpc, CE->getOperand(0), DestTy); in ConstantFoldCastInstruction()
397 return ConstantExpr::getPointerCast(CE->getOperand(0), DestTy); in ConstantFoldCastInstruction()
414 ConstantExpr::getCast(opc, Splat, DstEltTy)); in ConstantFoldCastInstruction()
422 ConstantExpr::getExtractElement(V, ConstantInt::get(Ty, i)); in ConstantFoldCastInstruction()
423 res.push_back(ConstantExpr::getCast(opc, C, DstEltTy)); in ConstantFoldCastInstruction()
534 Constant *V1Element = ConstantExpr::getExtractElement(V1, in ConstantFoldSelectInstruction()
536 Constant *V2Element = ConstantExpr::getExtractElement(V2, in ConstantFoldSelectInstruction()
580 if (isa<ConstantExpr>(C)) in ConstantFoldSelectInstruction()
596 if (ConstantExpr *TrueVal = dyn_cast<ConstantExpr>(V1)) { in ConstantFoldSelectInstruction()
599 return ConstantExpr::getSelect(Cond, TrueVal->getOperand(1), V2); in ConstantFoldSelectInstruction()
601 if (ConstantExpr *FalseVal = dyn_cast<ConstantExpr>(V2)) { in ConstantFoldSelectInstruction()
604 return ConstantExpr::getSelect(Cond, V1, FalseVal->getOperand(2)); in ConstantFoldSelectInstruction()
634 if (auto *CE = dyn_cast<ConstantExpr>(Val)) { in ConstantFoldExtractElementInstruction()
641 Constant *ScalarOp = ConstantExpr::getExtractElement(Op, Idx); in ConstantFoldExtractElementInstruction()
656 return ConstantExpr::getExtractElement(CE->getOperand(0), CIdx); in ConstantFoldExtractElementInstruction()
709 Constant *C = ConstantExpr::getExtractElement(Val, ConstantInt::get(Ty, i)); in ConstantFoldInsertElementInstruction()
734 ConstantExpr::getExtractElement(V1, ConstantInt::get(Ty, 0)); in ConstantFoldShuffleVectorInstruction()
763 ConstantExpr::getExtractElement(V2, in ConstantFoldShuffleVectorInstruction()
767 InElt = ConstantExpr::getExtractElement(V1, ConstantInt::get(Ty, Elt)); in ConstantFoldShuffleVectorInstruction()
852 Constant *Elt = ConstantExpr::get(Opcode, Splat); in ConstantFoldUnaryInstruction()
860 Constant *Elt = ConstantExpr::getExtractElement(C, ExtractIdx); in ConstantFoldUnaryInstruction()
862 Result.push_back(ConstantExpr::get(Opcode, Elt)); in ConstantFoldUnaryInstruction()
881 Constant *Identity = ConstantExpr::getBinOpIdentity(Opcode, C1->getType()); in ConstantFoldBinaryInstruction()
1039 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) { in ConstantFoldBinaryInstruction()
1100 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) { in ConstantFoldBinaryInstruction()
1109 return ConstantExpr::getCompare(pred, CE1->getOperand(0), in ConstantFoldBinaryInstruction()
1116 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) in ConstantFoldBinaryInstruction()
1118 return ConstantExpr::getLShr(C1, C2); in ConstantFoldBinaryInstruction()
1124 return ConstantExpr::get(Opcode, C2, C1); in ConstantFoldBinaryInstruction()
1222 ConstantExpr::isDesirableBinOp(Opcode) in ConstantFoldBinaryInstruction()
1223 ? ConstantExpr::get(Opcode, C1Splat, C2Splat) in ConstantFoldBinaryInstruction()
1237 Constant *LHS = ConstantExpr::getExtractElement(C1, ExtractIdx); in ConstantFoldBinaryInstruction()
1238 Constant *RHS = ConstantExpr::getExtractElement(C2, ExtractIdx); in ConstantFoldBinaryInstruction()
1244 Constant *Res = ConstantExpr::isDesirableBinOp(Opcode) in ConstantFoldBinaryInstruction()
1245 ? ConstantExpr::get(Opcode, LHS, RHS) in ConstantFoldBinaryInstruction()
1256 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) { in ConstantFoldBinaryInstruction()
1264 Constant *T = ConstantExpr::get(Opcode, CE1->getOperand(1), C2); in ConstantFoldBinaryInstruction()
1265 if (!isa<ConstantExpr>(T) || cast<ConstantExpr>(T)->getOpcode() != Opcode) in ConstantFoldBinaryInstruction()
1266 return ConstantExpr::get(Opcode, CE1->getOperand(0), T); in ConstantFoldBinaryInstruction()
1268 } else if (isa<ConstantExpr>(C2)) { in ConstantFoldBinaryInstruction()
1280 return ConstantExpr::getXor(C1, C2); in ConstantFoldBinaryInstruction()
1282 return ConstantExpr::getAnd(C1, C2); in ConstantFoldBinaryInstruction()
1327 if (!isa<ConstantExpr>(V1)) { in evaluateFCmpRelation()
1328 if (!isa<ConstantExpr>(V2)) { in evaluateFCmpRelation()
1332 ConstantExpr::getFCmp(FCmpInst::FCMP_OEQ, V1, V2)); in evaluateFCmpRelation()
1336 ConstantExpr::getFCmp(FCmpInst::FCMP_OLT, V1, V2)); in evaluateFCmpRelation()
1340 ConstantExpr::getFCmp(FCmpInst::FCMP_OGT, V1, V2)); in evaluateFCmpRelation()
1355 ConstantExpr *CE1 = cast<ConstantExpr>(V1); in evaluateFCmpRelation()
1414 if (!isa<ConstantExpr>(V1) && !isa<GlobalValue>(V1) && in evaluateICmpRelation()
1416 if (!isa<GlobalValue>(V2) && !isa<ConstantExpr>(V2) && 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()
1445 if (isa<ConstantExpr>(V2)) { // Swap as necessary. in evaluateICmpRelation()
1473 if (isa<ConstantExpr>(V2)) { // Swap as necessary. in evaluateICmpRelation()
1499 ConstantExpr *CE1 = cast<ConstantExpr>(V1); in evaluateICmpRelation()
1660 return ConstantExpr::getXor(C1, ConstantExpr::getNot(C2)); in ConstantFoldCompareInstruction()
1661 return ConstantExpr::getXor(ConstantExpr::getNot(C1), C2); in ConstantFoldCompareInstruction()
1663 return ConstantExpr::getXor(C1, C2); in ConstantFoldCompareInstruction()
1684 ConstantExpr::getCompare(Predicate, C1Splat, C2Splat)); in ConstantFoldCompareInstruction()
1699 ConstantExpr::getExtractElement(C1, ConstantInt::get(Ty, I)); in ConstantFoldCompareInstruction()
1701 ConstantExpr::getExtractElement(C2, ConstantInt::get(Ty, I)); in ConstantFoldCompareInstruction()
1703 ResElts.push_back(ConstantExpr::getCompare(Predicate, C1E, C2E)); in ConstantFoldCompareInstruction()
1712 (isa<ConstantExpr>(C1) || isa<ConstantExpr>(C2))) { in ConstantFoldCompareInstruction()
1874 if (ConstantExpr *CE2 = dyn_cast<ConstantExpr>(C2)) { in ConstantFoldCompareInstruction()
1879 Constant *Inverse = ConstantExpr::getBitCast(C1, CE2Op0->getType()); in ConstantFoldCompareInstruction()
1880 return ConstantExpr::getICmp(Predicate, Inverse, CE2Op0); in ConstantFoldCompareInstruction()
1885 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) { in ConstantFoldCompareInstruction()
1891 Constant *CE1Inverse = ConstantExpr::getTrunc(CE1, CE1Op0->getType()); in ConstantFoldCompareInstruction()
1894 Constant *C2Inverse = ConstantExpr::getTrunc(C2, CE1Op0->getType()); in ConstantFoldCompareInstruction()
1895 if (ConstantExpr::getCast(CE1->getOpcode(), C2Inverse, in ConstantFoldCompareInstruction()
1897 return ConstantExpr::getICmp(Predicate, CE1Inverse, C2Inverse); in ConstantFoldCompareInstruction()
1902 if ((!isa<ConstantExpr>(C1) && isa<ConstantExpr>(C2)) || in ConstantFoldCompareInstruction()
1908 return ConstantExpr::getICmp(Predicate, C2, C1); in ConstantFoldCompareInstruction()
1973 return ConstantExpr::getGetElementPtr( in foldGEPOfGEP()
2012 Idx0 = ConstantExpr::getSExtOrBitCast(Idx0, CommonTy); in foldGEPOfGEP()
2013 LastIdx = ConstantExpr::getSExtOrBitCast(LastIdx, CommonTy); in foldGEPOfGEP()
2016 NewIndices.push_back(ConstantExpr::get(Instruction::Add, Idx0, LastIdx)); in foldGEPOfGEP()
2026 return ConstantExpr::getGetElementPtr( in foldGEPOfGEP()
2097 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) { in ConstantFoldGetElementPtr()
2125 return ConstantExpr::getGetElementPtr(SrcArrayTy, in ConstantFoldGetElementPtr()
2256 PrevIdx = ConstantExpr::getSExt(PrevIdx, ExtendedTy); in ConstantFoldGetElementPtr()
2259 Div = ConstantExpr::getSExt(Div, ExtendedTy); in ConstantFoldGetElementPtr()
2261 NewIdxs[i - 1] = ConstantExpr::getAdd(PrevIdx, Div); in ConstantFoldGetElementPtr()
2268 return ConstantExpr::getGetElementPtr(PointeeTy, C, NewIdxs, InBounds, in ConstantFoldGetElementPtr()
2277 return ConstantExpr::getGetElementPtr(PointeeTy, C, Idxs, in ConstantFoldGetElementPtr()