Lines Matching refs:ConstantExpr
47 ConstantExpr *Op, ///< the first cast constant expression in foldConstantCastPair()
85 return ConstantExpr::getBitCast(ConstantVector::get(V), DestPTy); in FoldBitCast()
153 ConstantExpr *CE = dyn_cast<ConstantExpr>(C); in ExtractConstantBytes()
185 return ConstantExpr::isDesirableCastOp(opc) in foldMaybeUndesirableCast()
186 ? ConstantExpr::getCast(opc, V, DestTy) in foldMaybeUndesirableCast()
211 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) { in ConstantFoldCastInstruction()
241 Constant *C = ConstantExpr::getExtractElement(V, ConstantInt::get(Ty, i)); in ConstantFoldCastInstruction()
348 Constant *V1Element = ConstantExpr::getExtractElement(V1, in ConstantFoldSelectInstruction()
350 Constant *V2Element = ConstantExpr::getExtractElement(V2, in ConstantFoldSelectInstruction()
394 if (isa<ConstantExpr>(C)) in ConstantFoldSelectInstruction()
437 if (auto *CE = dyn_cast<ConstantExpr>(Val)) { in ConstantFoldExtractElementInstruction()
444 Constant *ScalarOp = ConstantExpr::getExtractElement(Op, Idx); in ConstantFoldExtractElementInstruction()
459 return ConstantExpr::getExtractElement(CE->getOperand(0), CIdx); in ConstantFoldExtractElementInstruction()
512 Constant *C = ConstantExpr::getExtractElement(Val, ConstantInt::get(Ty, i)); in ConstantFoldInsertElementInstruction()
537 ConstantExpr::getExtractElement(V1, ConstantInt::get(Ty, 0)); in ConstantFoldShuffleVectorInstruction()
566 ConstantExpr::getExtractElement(V2, in ConstantFoldShuffleVectorInstruction()
570 InElt = ConstantExpr::getExtractElement(V1, ConstantInt::get(Ty, Elt)); in ConstantFoldShuffleVectorInstruction()
662 Constant *Elt = ConstantExpr::getExtractElement(C, ExtractIdx); in ConstantFoldUnaryInstruction()
682 if (Constant *Identity = ConstantExpr::getBinOpIdentity( in ConstantFoldBinaryInstruction()
688 } else if (Constant *Identity = ConstantExpr::getBinOpIdentity( in ConstantFoldBinaryInstruction()
822 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) { in ConstantFoldBinaryInstruction()
866 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) { in ConstantFoldBinaryInstruction()
876 return ConstantExpr::getCompare(pred, CE1->getOperand(0), in ConstantFoldBinaryInstruction()
885 return ConstantExpr::isDesirableBinOp(Opcode) in ConstantFoldBinaryInstruction()
886 ? ConstantExpr::get(Opcode, C2, C1) in ConstantFoldBinaryInstruction()
985 ConstantExpr::isDesirableBinOp(Opcode) in ConstantFoldBinaryInstruction()
986 ? ConstantExpr::get(Opcode, C1Splat, C2Splat) in ConstantFoldBinaryInstruction()
1000 Constant *LHS = ConstantExpr::getExtractElement(C1, ExtractIdx); in ConstantFoldBinaryInstruction()
1001 Constant *RHS = ConstantExpr::getExtractElement(C2, ExtractIdx); in ConstantFoldBinaryInstruction()
1007 Constant *Res = ConstantExpr::isDesirableBinOp(Opcode) in ConstantFoldBinaryInstruction()
1008 ? ConstantExpr::get(Opcode, LHS, RHS) in ConstantFoldBinaryInstruction()
1019 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) { in ConstantFoldBinaryInstruction()
1027 Constant *T = ConstantExpr::get(Opcode, CE1->getOperand(1), C2); in ConstantFoldBinaryInstruction()
1028 if (!isa<ConstantExpr>(T) || cast<ConstantExpr>(T)->getOpcode() != Opcode) in ConstantFoldBinaryInstruction()
1029 return ConstantExpr::get(Opcode, CE1->getOperand(0), T); in ConstantFoldBinaryInstruction()
1031 } else if (isa<ConstantExpr>(C2)) { in ConstantFoldBinaryInstruction()
1043 return ConstantExpr::getXor(C1, C2); in ConstantFoldBinaryInstruction()
1113 if (isa<ConstantExpr>(V)) in evaluateICmpRelation()
1160 ConstantExpr *CE1 = cast<ConstantExpr>(V1); in evaluateICmpRelation()
1263 return ConstantExpr::getXor(C1, ConstantExpr::getNot(C2)); in ConstantFoldCompareInstruction()
1264 return ConstantExpr::getXor(ConstantExpr::getNot(C1), C2); in ConstantFoldCompareInstruction()
1266 return ConstantExpr::getXor(C1, C2); in ConstantFoldCompareInstruction()
1287 ConstantExpr::getCompare(Predicate, C1Splat, C2Splat)); in ConstantFoldCompareInstruction()
1302 ConstantExpr::getExtractElement(C1, ConstantInt::get(Ty, I)); in ConstantFoldCompareInstruction()
1304 ConstantExpr::getExtractElement(C2, ConstantInt::get(Ty, I)); in ConstantFoldCompareInstruction()
1306 ResElts.push_back(ConstantExpr::getCompare(Predicate, C1E, C2E)); in ConstantFoldCompareInstruction()
1408 if ((!isa<ConstantExpr>(C1) && isa<ConstantExpr>(C2)) || in ConstantFoldCompareInstruction()
1414 return ConstantExpr::getICmp(Predicate, C2, C1); in ConstantFoldCompareInstruction()
1479 return ConstantExpr::getGetElementPtr( in foldGEPOfGEP()
1527 NewIndices.push_back(ConstantExpr::get(Instruction::Add, Idx0, LastIdx)); in foldGEPOfGEP()
1537 return ConstantExpr::getGetElementPtr( in foldGEPOfGEP()
1574 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) in ConstantFoldGetElementPtr()
1716 NewIdxs[i - 1] = ConstantExpr::getAdd(PrevIdx, Div); in ConstantFoldGetElementPtr()
1723 return ConstantExpr::getGetElementPtr(PointeeTy, C, NewIdxs, InBounds, in ConstantFoldGetElementPtr()
1733 return ConstantExpr::getGetElementPtr(PointeeTy, C, Idxs, in ConstantFoldGetElementPtr()