Lines Matching refs:ConstantExpr

12 // Also, to supplement the basic VMCore ConstantExpr simplifications,
46 /// ConstantExpr if unfoldable.
59 return ConstantExpr::getBitCast(C, DestTy);
72 C = ConstantExpr::getBitCast(C, SrcIVTy);
94 return ConstantExpr::getBitCast(C, DestTy);
105 return ConstantExpr::getBitCast(C, DestTy);
111 return ConstantExpr::getBitCast(C, DestTy);
135 return ConstantExpr::getBitCast(C, DestTy);
145 C = ConstantExpr::getBitCast(C, SrcIVTy);
172 return ConstantExpr::getBitCast(C, DestTy);
175 Src = ConstantExpr::getZExt(Src, Elt->getType());
178 Src = ConstantExpr::getShl(Src,
183 Elt = ConstantExpr::getOr(Elt, Src);
198 return ConstantExpr::getBitCast(C, DestTy);
204 Constant *Elt = ConstantExpr::getLShr(Src,
209 Result.push_back(ConstantExpr::getTrunc(Elt, DstEltTy));
229 ConstantExpr *CE = dyn_cast<ConstantExpr>(C);
379 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) {
465 ConstantExpr *CE = dyn_cast<ConstantExpr>(C);
506 Res = ConstantExpr::getBitCast(Res, Ty);
588 NewIdxs.push_back(ConstantExpr::getCast(CastInst::getCastOpcode(Ops[i],
599 ConstantExpr::getGetElementPtr(Ops[0], NewIdxs);
600 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C))
617 Ptr = ConstantExpr::getBitCast(Ptr, NewPtrTy);
643 ConstantExpr *CE = dyn_cast<ConstantExpr>(Ops[1]);
648 Constant *Res = ConstantExpr::getPtrToInt(Ptr, CE->getType());
649 Res = ConstantExpr::getSub(Res, CE->getOperand(1));
650 Res = ConstantExpr::getIntToPtr(Res, ResultTy);
651 if (ConstantExpr *ResCE = dyn_cast<ConstantExpr>(Res))
690 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ptr))
696 return ConstantExpr::getIntToPtr(C, ResultTy);
765 ConstantExpr::getGetElementPtr(Ptr, NewIdxs);
808 if (ConstantExpr *NewC = dyn_cast<ConstantExpr>(C))
831 if (ConstantExpr *NewCE = dyn_cast<ConstantExpr>(Op))
845 return ConstantExpr::getInsertValue(
851 return ConstantExpr::getExtractValue(
861 Constant *llvm::ConstantFoldConstantExpression(const ConstantExpr *CE,
868 // Recursively fold the ConstantExpr's operands.
869 if (ConstantExpr *NewCE = dyn_cast<ConstantExpr>(NewC))
896 if (isa<ConstantExpr>(Ops[0]) || isa<ConstantExpr>(Ops[1]))
900 return ConstantExpr::get(Opcode, Ops[0], Ops[1]);
914 // the width of a pointer, so it can't be done in ConstantExpr::getCast.
915 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ops[0])) {
923 Input = ConstantExpr::getAnd(Input, Mask);
926 return ConstantExpr::getIntegerCast(Input, DestTy, false);
929 return ConstantExpr::getCast(Opcode, Ops[0], DestTy);
933 // pointer, so it can't be done in ConstantExpr::getCast.
934 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ops[0]))
940 return ConstantExpr::getCast(Opcode, Ops[0], DestTy);
950 return ConstantExpr::getCast(Opcode, Ops[0], DestTy);
954 return ConstantExpr::getBitCast(Ops[0], DestTy);
956 return ConstantExpr::getSelect(Ops[0], Ops[1], Ops[2]);
958 return ConstantExpr::getExtractElement(Ops[0], Ops[1]);
960 return ConstantExpr::getInsertElement(Ops[0], Ops[1], Ops[2]);
962 return ConstantExpr::getShuffleVector(Ops[0], Ops[1], Ops[2]);
969 return ConstantExpr::getGetElementPtr(Ops[0], Ops.slice(1));
986 // ConstantExpr::getCompare cannot do this, because it doesn't have TD
988 if (ConstantExpr *CE0 = dyn_cast<ConstantExpr>(Ops0)) {
994 Constant *C = ConstantExpr::getIntegerCast(CE0->getOperand(0),
1010 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(Ops1)) {
1017 Constant *C0 = ConstantExpr::getIntegerCast(CE0->getOperand(0),
1019 Constant *C1 = ConstantExpr::getIntegerCast(CE1->getOperand(0),
1051 return ConstantExpr::getCompare(Predicate, Ops0, Ops1);
1059 ConstantExpr *CE) {