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()
390 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) { in ReadDataFromGlobal()
482 static Constant *ConstantFoldLoadThroughBitcast(ConstantExpr *CE, in ConstantFoldLoadThroughBitcast()
508 return ConstantExpr::getCast(Cast, C, DestTy); in ConstantFoldLoadThroughBitcast()
536 ConstantExpr *CE = dyn_cast<ConstantExpr>(C); in ConstantFoldLoadFromConstPtr()
584 Res = ConstantExpr::getBitCast(Res, Ty); in ConstantFoldLoadFromConstPtr()
689 NewIdxs.push_back(ConstantExpr::getCast(CastInst::getCastOpcode(Ops[i], in CastGEPIndices()
701 Constant *C = ConstantExpr::getGetElementPtr(SrcTy, Ops[0], NewIdxs); in CastGEPIndices()
702 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) { in CastGEPIndices()
721 Ptr = ConstantExpr::getPointerCast(Ptr, NewPtrTy); in StripPtrCastKeepAS()
746 ConstantExpr *CE = dyn_cast<ConstantExpr>(Ops[1]); in SymbolicallyEvaluateGEP()
751 Constant *Res = ConstantExpr::getPtrToInt(Ptr, CE->getType()); in SymbolicallyEvaluateGEP()
752 Res = ConstantExpr::getSub(Res, CE->getOperand(1)); in SymbolicallyEvaluateGEP()
753 Res = ConstantExpr::getIntToPtr(Res, ResultTy); in SymbolicallyEvaluateGEP()
754 if (ConstantExpr *ResCE = dyn_cast<ConstantExpr>(Res)) in SymbolicallyEvaluateGEP()
792 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ptr)) { in SymbolicallyEvaluateGEP()
801 return ConstantExpr::getIntToPtr(C, ResultTy); in SymbolicallyEvaluateGEP()
869 Constant *C = ConstantExpr::getGetElementPtr(SrcTy, Ptr, NewIdxs); in SymbolicallyEvaluateGEP()
911 if (ConstantExpr *NewC = dyn_cast<ConstantExpr>(C)) in ConstantFoldInstruction()
934 if (ConstantExpr *NewCE = dyn_cast<ConstantExpr>(Op)) in ConstantFoldInstruction()
948 return ConstantExpr::getInsertValue( in ConstantFoldInstruction()
955 return ConstantExpr::getExtractValue( in ConstantFoldInstruction()
964 ConstantFoldConstantExpressionImpl(const ConstantExpr *CE, const DataLayout &DL, in ConstantFoldConstantExpressionImpl()
966 SmallPtrSetImpl<ConstantExpr *> &FoldedOps) { in ConstantFoldConstantExpressionImpl()
973 if (ConstantExpr *NewCE = dyn_cast<ConstantExpr>(NewC)) { in ConstantFoldConstantExpressionImpl()
989 Constant *llvm::ConstantFoldConstantExpression(const ConstantExpr *CE, in ConstantFoldConstantExpression()
992 SmallPtrSet<ConstantExpr *, 4> FoldedOps; in ConstantFoldConstantExpression()
1012 if (isa<ConstantExpr>(Ops[0]) || isa<ConstantExpr>(Ops[1])) { in ConstantFoldInstOperands()
1017 return ConstantExpr::get(Opcode, Ops[0], Ops[1]); in ConstantFoldInstOperands()
1032 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ops[0])) { in ConstantFoldInstOperands()
1041 Input = ConstantExpr::getAnd(Input, Mask); in ConstantFoldInstOperands()
1044 return ConstantExpr::getIntegerCast(Input, DestTy, false); in ConstantFoldInstOperands()
1047 return ConstantExpr::getCast(Opcode, Ops[0], DestTy); in ConstantFoldInstOperands()
1053 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ops[0])) { in ConstantFoldInstOperands()
1067 return ConstantExpr::getCast(Opcode, Ops[0], DestTy); in ConstantFoldInstOperands()
1078 return ConstantExpr::getCast(Opcode, Ops[0], DestTy); in ConstantFoldInstOperands()
1082 return ConstantExpr::getSelect(Ops[0], Ops[1], Ops[2]); in ConstantFoldInstOperands()
1084 return ConstantExpr::getExtractElement(Ops[0], Ops[1]); in ConstantFoldInstOperands()
1086 return ConstantExpr::getInsertElement(Ops[0], Ops[1], Ops[2]); in ConstantFoldInstOperands()
1088 return ConstantExpr::getShuffleVector(Ops[0], Ops[1], Ops[2]); in ConstantFoldInstOperands()
1096 return ConstantExpr::getGetElementPtr(SrcTy, Ops[0], Ops.slice(1)); in ConstantFoldInstOperands()
1116 if (ConstantExpr *CE0 = dyn_cast<ConstantExpr>(Ops0)) { in ConstantFoldCompareInstOperands()
1122 Constant *C = ConstantExpr::getIntegerCast(CE0->getOperand(0), in ConstantFoldCompareInstOperands()
1140 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(Ops1)) { in ConstantFoldCompareInstOperands()
1147 Constant *C0 = ConstantExpr::getIntegerCast(CE0->getOperand(0), in ConstantFoldCompareInstOperands()
1149 Constant *C1 = ConstantExpr::getIntegerCast(CE1->getOperand(0), in ConstantFoldCompareInstOperands()
1182 return ConstantExpr::getCompare(Predicate, Ops0, Ops1); in ConstantFoldCompareInstOperands()
1190 ConstantExpr *CE) { in ConstantFoldLoadThroughGEPConstantExpr()