Lines Matching refs:ConstantExpr
67 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
79 C = ConstantExpr::getBitCast(C, SrcIVTy); in FoldBitCast()
95 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
107 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
118 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
124 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
148 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
158 C = ConstantExpr::getBitCast(C, SrcIVTy); in FoldBitCast()
185 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
188 Src = ConstantExpr::getZExt(Src, Elt->getType()); in FoldBitCast()
191 Src = ConstantExpr::getShl(Src, in FoldBitCast()
196 Elt = ConstantExpr::getOr(Elt, Src); in FoldBitCast()
211 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
217 Constant *Elt = ConstantExpr::getLShr(Src, in FoldBitCast()
225 Constant *CE = ConstantExpr::getTrunc(Elt, DstIntTy); in FoldBitCast()
226 Result.push_back(ConstantExpr::getIntToPtr(CE, DstEltTy)); in FoldBitCast()
231 Result.push_back(ConstantExpr::getTrunc(Elt, DstEltTy)); in FoldBitCast()
252 auto *CE = dyn_cast<ConstantExpr>(C); in IsConstantOffsetFromGlobal()
396 if (auto *CE = dyn_cast<ConstantExpr>(C)) { in ReadDataFromGlobal()
497 Constant *ConstantFoldLoadThroughBitcast(ConstantExpr *CE, Type *DestTy, in ConstantFoldLoadThroughBitcast()
524 return ConstantExpr::getCast(Cast, C, DestTy); in ConstantFoldLoadThroughBitcast()
556 auto *CE = dyn_cast<ConstantExpr>(C); in ConstantFoldLoadFromConstPtr()
603 Res = ConstantExpr::getBitCast(Res, Ty); in ConstantFoldLoadFromConstPtr()
704 NewIdxs.push_back(ConstantExpr::getCast(CastInst::getCastOpcode(Ops[i], in CastGEPIndices()
716 Constant *C = ConstantExpr::getGetElementPtr(SrcElemTy, Ops[0], NewIdxs); in CastGEPIndices()
717 if (auto *CE = dyn_cast<ConstantExpr>(C)) { in CastGEPIndices()
737 Ptr = ConstantExpr::getPointerCast(Ptr, NewPtrTy); in StripPtrCastKeepAS()
770 auto *CE = dyn_cast<ConstantExpr>(Ops[1]); in SymbolicallyEvaluateGEP()
775 Constant *Res = ConstantExpr::getPtrToInt(Ptr, CE->getType()); in SymbolicallyEvaluateGEP()
776 Res = ConstantExpr::getSub(Res, CE->getOperand(1)); in SymbolicallyEvaluateGEP()
777 Res = ConstantExpr::getIntToPtr(Res, ResTy); in SymbolicallyEvaluateGEP()
778 if (auto *ResCE = dyn_cast<ConstantExpr>(Res)) in SymbolicallyEvaluateGEP()
817 if (auto *CE = dyn_cast<ConstantExpr>(Ptr)) { in SymbolicallyEvaluateGEP()
826 return ConstantExpr::getIntToPtr(C, ResTy); in SymbolicallyEvaluateGEP()
901 Constant *C = ConstantExpr::getGetElementPtr(SrcElemTy, Ptr, NewIdxs); in SymbolicallyEvaluateGEP()
939 return ConstantExpr::getGetElementPtr(GEP->getSourceElementType(), in ConstantFoldInstOperandsImpl()
953 return ConstantExpr::getSelect(Ops[0], Ops[1], Ops[2]); in ConstantFoldInstOperandsImpl()
955 return ConstantExpr::getExtractElement(Ops[0], Ops[1]); in ConstantFoldInstOperandsImpl()
957 return ConstantExpr::getInsertElement(Ops[0], Ops[1], Ops[2]); in ConstantFoldInstOperandsImpl()
959 return ConstantExpr::getShuffleVector(Ops[0], Ops[1], Ops[2]); in ConstantFoldInstOperandsImpl()
987 if (auto *NewC = dyn_cast<ConstantExpr>(C)) in ConstantFoldInstruction()
1010 if (auto *NewCE = dyn_cast<ConstantExpr>(Op)) in ConstantFoldInstruction()
1024 return ConstantExpr::getInsertValue( in ConstantFoldInstruction()
1031 return ConstantExpr::getExtractValue( in ConstantFoldInstruction()
1042 ConstantFoldConstantExpressionImpl(const ConstantExpr *CE, const DataLayout &DL, in ConstantFoldConstantExpressionImpl()
1044 SmallPtrSetImpl<ConstantExpr *> &FoldedOps) { in ConstantFoldConstantExpressionImpl()
1050 if (auto *NewCE = dyn_cast<ConstantExpr>(NewC)) { in ConstantFoldConstantExpressionImpl()
1067 Constant *llvm::ConstantFoldConstantExpression(const ConstantExpr *CE, in ConstantFoldConstantExpression()
1070 SmallPtrSet<ConstantExpr *, 4> FoldedOps; in ConstantFoldConstantExpression()
1102 if (auto *CE0 = dyn_cast<ConstantExpr>(Ops0)) { in ConstantFoldCompareInstOperands()
1108 Constant *C = ConstantExpr::getIntegerCast(CE0->getOperand(0), in ConstantFoldCompareInstOperands()
1126 if (auto *CE1 = dyn_cast<ConstantExpr>(Ops1)) { in ConstantFoldCompareInstOperands()
1133 Constant *C0 = ConstantExpr::getIntegerCast(CE0->getOperand(0), in ConstantFoldCompareInstOperands()
1135 Constant *C1 = ConstantExpr::getIntegerCast(CE1->getOperand(0), in ConstantFoldCompareInstOperands()
1167 return ConstantExpr::getCompare(Predicate, Ops0, Ops1); in ConstantFoldCompareInstOperands()
1174 if (isa<ConstantExpr>(LHS) || isa<ConstantExpr>(RHS)) in ConstantFoldBinaryOpOperands()
1178 return ConstantExpr::get(Opcode, LHS, RHS); in ConstantFoldBinaryOpOperands()
1190 if (auto *CE = dyn_cast<ConstantExpr>(C)) { in ConstantFoldCastOperand()
1199 Input = ConstantExpr::getAnd(Input, Mask); in ConstantFoldCastOperand()
1202 return ConstantExpr::getIntegerCast(Input, DestTy, false); in ConstantFoldCastOperand()
1205 return ConstantExpr::getCast(Opcode, C, DestTy); in ConstantFoldCastOperand()
1211 if (auto *CE = dyn_cast<ConstantExpr>(C)) { in ConstantFoldCastOperand()
1225 return ConstantExpr::getCast(Opcode, C, DestTy); in ConstantFoldCastOperand()
1236 return ConstantExpr::getCast(Opcode, C, DestTy); in ConstantFoldCastOperand()
1243 ConstantExpr *CE) { in ConstantFoldLoadThroughGEPConstantExpr()