Lines Matching refs:ConstantExpr

65       return ConstantExpr::getBitCast(C, DestTy);  in FoldBitCast()
77 C = ConstantExpr::getBitCast(C, SrcIVTy); in FoldBitCast()
82 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
102 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
113 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
119 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
143 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
153 C = ConstantExpr::getBitCast(C, SrcIVTy); in FoldBitCast()
180 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
183 Src = ConstantExpr::getZExt(Src, Elt->getType()); in FoldBitCast()
186 Src = ConstantExpr::getShl(Src, in FoldBitCast()
191 Elt = ConstantExpr::getOr(Elt, Src); in FoldBitCast()
206 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
212 Constant *Elt = ConstantExpr::getLShr(Src, in FoldBitCast()
220 Constant *CE = ConstantExpr::getTrunc(Elt, DstIntTy); in FoldBitCast()
221 Result.push_back(ConstantExpr::getIntToPtr(CE, DstEltTy)); in FoldBitCast()
226 Result.push_back(ConstantExpr::getTrunc(Elt, DstEltTy)); in FoldBitCast()
246 ConstantExpr *CE = dyn_cast<ConstantExpr>(C); in IsConstantOffsetFromGlobal()
389 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) { in ReadDataFromGlobal()
481 static Constant *ConstantFoldLoadThroughBitcast(ConstantExpr *CE, in ConstantFoldLoadThroughBitcast()
507 return ConstantExpr::getCast(Cast, C, DestTy); in ConstantFoldLoadThroughBitcast()
539 ConstantExpr *CE = dyn_cast<ConstantExpr>(C); in ConstantFoldLoadFromConstPtr()
587 Res = ConstantExpr::getBitCast(Res, Ty); in ConstantFoldLoadFromConstPtr()
692 NewIdxs.push_back(ConstantExpr::getCast(CastInst::getCastOpcode(Ops[i], in CastGEPIndices()
704 Constant *C = ConstantExpr::getGetElementPtr(SrcTy, Ops[0], NewIdxs); in CastGEPIndices()
705 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) { in CastGEPIndices()
724 Ptr = ConstantExpr::getPointerCast(Ptr, NewPtrTy); in StripPtrCastKeepAS()
749 ConstantExpr *CE = dyn_cast<ConstantExpr>(Ops[1]); in SymbolicallyEvaluateGEP()
754 Constant *Res = ConstantExpr::getPtrToInt(Ptr, CE->getType()); in SymbolicallyEvaluateGEP()
755 Res = ConstantExpr::getSub(Res, CE->getOperand(1)); in SymbolicallyEvaluateGEP()
756 Res = ConstantExpr::getIntToPtr(Res, ResultTy); in SymbolicallyEvaluateGEP()
757 if (ConstantExpr *ResCE = dyn_cast<ConstantExpr>(Res)) in SymbolicallyEvaluateGEP()
795 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ptr)) { in SymbolicallyEvaluateGEP()
804 return ConstantExpr::getIntToPtr(C, ResultTy); in SymbolicallyEvaluateGEP()
872 Constant *C = ConstantExpr::getGetElementPtr(SrcTy, Ptr, NewIdxs); in SymbolicallyEvaluateGEP()
913 if (ConstantExpr *NewC = dyn_cast<ConstantExpr>(C)) in ConstantFoldInstruction()
936 if (ConstantExpr *NewCE = dyn_cast<ConstantExpr>(Op)) in ConstantFoldInstruction()
950 return ConstantExpr::getInsertValue( in ConstantFoldInstruction()
957 return ConstantExpr::getExtractValue( in ConstantFoldInstruction()
966 ConstantFoldConstantExpressionImpl(const ConstantExpr *CE, const DataLayout &DL, in ConstantFoldConstantExpressionImpl()
968 SmallPtrSetImpl<ConstantExpr *> &FoldedOps) { in ConstantFoldConstantExpressionImpl()
975 if (ConstantExpr *NewCE = dyn_cast<ConstantExpr>(NewC)) { in ConstantFoldConstantExpressionImpl()
991 Constant *llvm::ConstantFoldConstantExpression(const ConstantExpr *CE, in ConstantFoldConstantExpression()
994 SmallPtrSet<ConstantExpr *, 4> FoldedOps; in ConstantFoldConstantExpression()
1014 if (isa<ConstantExpr>(Ops[0]) || isa<ConstantExpr>(Ops[1])) { in ConstantFoldInstOperands()
1019 return ConstantExpr::get(Opcode, Ops[0], Ops[1]); in ConstantFoldInstOperands()
1034 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ops[0])) { in ConstantFoldInstOperands()
1043 Input = ConstantExpr::getAnd(Input, Mask); in ConstantFoldInstOperands()
1046 return ConstantExpr::getIntegerCast(Input, DestTy, false); in ConstantFoldInstOperands()
1049 return ConstantExpr::getCast(Opcode, Ops[0], DestTy); in ConstantFoldInstOperands()
1055 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ops[0])) { in ConstantFoldInstOperands()
1069 return ConstantExpr::getCast(Opcode, Ops[0], DestTy); in ConstantFoldInstOperands()
1080 return ConstantExpr::getCast(Opcode, Ops[0], DestTy); in ConstantFoldInstOperands()
1084 return ConstantExpr::getSelect(Ops[0], Ops[1], Ops[2]); in ConstantFoldInstOperands()
1086 return ConstantExpr::getExtractElement(Ops[0], Ops[1]); in ConstantFoldInstOperands()
1088 return ConstantExpr::getInsertElement(Ops[0], Ops[1], Ops[2]); in ConstantFoldInstOperands()
1090 return ConstantExpr::getShuffleVector(Ops[0], Ops[1], Ops[2]); in ConstantFoldInstOperands()
1098 return ConstantExpr::getGetElementPtr(SrcTy, Ops[0], Ops.slice(1)); in ConstantFoldInstOperands()
1118 if (ConstantExpr *CE0 = dyn_cast<ConstantExpr>(Ops0)) { in ConstantFoldCompareInstOperands()
1124 Constant *C = ConstantExpr::getIntegerCast(CE0->getOperand(0), in ConstantFoldCompareInstOperands()
1142 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(Ops1)) { in ConstantFoldCompareInstOperands()
1149 Constant *C0 = ConstantExpr::getIntegerCast(CE0->getOperand(0), in ConstantFoldCompareInstOperands()
1151 Constant *C1 = ConstantExpr::getIntegerCast(CE1->getOperand(0), in ConstantFoldCompareInstOperands()
1184 return ConstantExpr::getCompare(Predicate, Ops0, Ops1); in ConstantFoldCompareInstOperands()
1192 ConstantExpr *CE) { in ConstantFoldLoadThroughGEPConstantExpr()