Lines Matching refs:Ty
559 Type *Ty = cast<PointerType>(CE->getType())->getElementType(); in ConstantFoldLoadFromConstPtr() local
560 unsigned NumBits = Ty->getPrimitiveSizeInBits(); in ConstantFoldLoadFromConstPtr()
564 (isa<IntegerType>(Ty) || Ty->isFloatingPointTy())) { in ConstantFoldLoadFromConstPtr()
583 if (Ty->isFloatingPointTy()) in ConstantFoldLoadFromConstPtr()
584 Res = ConstantExpr::getBitCast(Res, Ty); in ConstantFoldLoadFromConstPtr()
808 Type *Ty = Ptr->getType(); in SymbolicallyEvaluateGEP() local
809 assert(Ty->isPointerTy() && "Forming regular GEP of non-pointer type"); in SymbolicallyEvaluateGEP()
813 if (SequentialType *ATy = dyn_cast<SequentialType>(Ty)) { in SymbolicallyEvaluateGEP()
838 Ty = ATy->getElementType(); in SymbolicallyEvaluateGEP()
839 } else if (StructType *STy = dyn_cast<StructType>(Ty)) { in SymbolicallyEvaluateGEP()
852 NewIdxs.push_back(ConstantInt::get(Type::getInt32Ty(Ty->getContext()), in SymbolicallyEvaluateGEP()
855 Ty = STy->getTypeAtIndex(ElIdx); in SymbolicallyEvaluateGEP()
860 } while (Ty != ResultElementTy); in SymbolicallyEvaluateGEP()
870 assert(C->getType()->getPointerElementType() == Ty && in SymbolicallyEvaluateGEP()
875 if (Ty != ResultElementTy) in SymbolicallyEvaluateGEP()
1299 static Constant *GetConstantFoldFPValue(double V, Type *Ty) { in GetConstantFoldFPValue() argument
1300 if (Ty->isHalfTy()) { in GetConstantFoldFPValue()
1304 return ConstantFP::get(Ty->getContext(), APF); in GetConstantFoldFPValue()
1306 if (Ty->isFloatTy()) in GetConstantFoldFPValue()
1307 return ConstantFP::get(Ty->getContext(), APFloat((float)V)); in GetConstantFoldFPValue()
1308 if (Ty->isDoubleTy()) in GetConstantFoldFPValue()
1309 return ConstantFP::get(Ty->getContext(), APFloat(V)); in GetConstantFoldFPValue()
1337 Type *Ty) { in ConstantFoldFP() argument
1345 return GetConstantFoldFPValue(V, Ty); in ConstantFoldFP()
1349 double V, double W, Type *Ty) { in ConstantFoldBinaryFP() argument
1357 return GetConstantFoldFPValue(V, Ty); in ConstantFoldBinaryFP()
1368 bool roundTowardZero, Type *Ty) { in ConstantFoldConvertToInt() argument
1370 unsigned ResultWidth = Ty->getIntegerBitWidth(); in ConstantFoldConvertToInt()
1383 return ConstantInt::get(Ty, UIntVal, /*isSigned=*/true); in ConstantFoldConvertToInt()
1387 Type *Ty = Op->getType(); in getValueAsDouble() local
1389 if (Ty->isFloatTy()) in getValueAsDouble()
1392 if (Ty->isDoubleTy()) in getValueAsDouble()
1402 Type *Ty, ArrayRef<Constant *> Operands, in ConstantFoldScalarCall() argument
1412 return ConstantInt::get(Ty->getContext(), Val.bitcastToAPInt()); in ConstantFoldScalarCall()
1415 if (!Ty->isHalfTy() && !Ty->isFloatTy() && !Ty->isDoubleTy()) in ConstantFoldScalarCall()
1421 return ConstantFP::get(Ty->getContext(), V); in ConstantFoldScalarCall()
1439 return ConstantFoldFP(fabs, V, Ty); in ConstantFoldScalarCall()
1441 return ConstantFoldFP(log2, V, Ty); in ConstantFoldScalarCall()
1443 return ConstantFoldFP(log, V, Ty); in ConstantFoldScalarCall()
1445 return ConstantFoldFP(log10, V, Ty); in ConstantFoldScalarCall()
1447 return ConstantFoldFP(exp, V, Ty); in ConstantFoldScalarCall()
1449 return ConstantFoldFP(exp2, V, Ty); in ConstantFoldScalarCall()
1451 return ConstantFoldFP(floor, V, Ty); in ConstantFoldScalarCall()
1453 return ConstantFoldFP(ceil, V, Ty); in ConstantFoldScalarCall()
1462 return ConstantFoldFP(acos, V, Ty); in ConstantFoldScalarCall()
1464 return ConstantFoldFP(asin, V, Ty); in ConstantFoldScalarCall()
1466 return ConstantFoldFP(atan, V, Ty); in ConstantFoldScalarCall()
1470 return ConstantFoldFP(ceil, V, Ty); in ConstantFoldScalarCall()
1472 return ConstantFoldFP(cos, V, Ty); in ConstantFoldScalarCall()
1474 return ConstantFoldFP(cosh, V, Ty); in ConstantFoldScalarCall()
1476 return ConstantFoldFP(cos, V, Ty); in ConstantFoldScalarCall()
1480 return ConstantFoldFP(exp, V, Ty); in ConstantFoldScalarCall()
1485 return ConstantFoldBinaryFP(pow, 2.0, V, Ty); in ConstantFoldScalarCall()
1490 return ConstantFoldFP(fabs, V, Ty); in ConstantFoldScalarCall()
1492 return ConstantFoldFP(floor, V, Ty); in ConstantFoldScalarCall()
1496 return ConstantFoldFP(log, V, Ty); in ConstantFoldScalarCall()
1498 return ConstantFoldFP(log10, V, Ty); in ConstantFoldScalarCall()
1500 (Ty->isHalfTy() || Ty->isFloatTy() || Ty->isDoubleTy())) { in ConstantFoldScalarCall()
1502 return ConstantFoldFP(sqrt, V, Ty); in ConstantFoldScalarCall()
1509 return UndefValue::get(Ty); in ConstantFoldScalarCall()
1515 return ConstantFoldFP(sin, V, Ty); in ConstantFoldScalarCall()
1517 return ConstantFoldFP(sinh, V, Ty); in ConstantFoldScalarCall()
1519 return ConstantFoldFP(sqrt, V, Ty); in ConstantFoldScalarCall()
1521 return ConstantFoldFP(sqrt, V, Ty); in ConstantFoldScalarCall()
1523 return ConstantFoldFP(sin, V, Ty); in ConstantFoldScalarCall()
1527 return ConstantFoldFP(tan, V, Ty); in ConstantFoldScalarCall()
1529 return ConstantFoldFP(tanh, V, Ty); in ConstantFoldScalarCall()
1540 return ConstantInt::get(Ty->getContext(), Op->getValue().byteSwap()); in ConstantFoldScalarCall()
1542 return ConstantInt::get(Ty, Op->getValue().countPopulation()); in ConstantFoldScalarCall()
1555 return ConstantFP::get(Ty->getContext(), Val); in ConstantFoldScalarCall()
1575 /*roundTowardZero=*/false, Ty); in ConstantFoldScalarCall()
1583 /*roundTowardZero=*/true, Ty); in ConstantFoldScalarCall()
1598 if (!Ty->isHalfTy() && !Ty->isFloatTy() && !Ty->isDoubleTy()) in ConstantFoldScalarCall()
1608 return ConstantFoldBinaryFP(pow, Op1V, Op2V, Ty); in ConstantFoldScalarCall()
1614 return ConstantFP::get(Ty->getContext(), V1); in ConstantFoldScalarCall()
1620 return ConstantFP::get(Ty->getContext(), minnum(C1, C2)); in ConstantFoldScalarCall()
1626 return ConstantFP::get(Ty->getContext(), maxnum(C1, C2)); in ConstantFoldScalarCall()
1632 return ConstantFoldBinaryFP(pow, Op1V, Op2V, Ty); in ConstantFoldScalarCall()
1634 return ConstantFoldBinaryFP(fmod, Op1V, Op2V, Ty); in ConstantFoldScalarCall()
1636 return ConstantFoldBinaryFP(atan2, Op1V, Op2V, Ty); in ConstantFoldScalarCall()
1638 if (IntrinsicID == Intrinsic::powi && Ty->isHalfTy()) in ConstantFoldScalarCall()
1639 return ConstantFP::get(Ty->getContext(), in ConstantFoldScalarCall()
1642 if (IntrinsicID == Intrinsic::powi && Ty->isFloatTy()) in ConstantFoldScalarCall()
1643 return ConstantFP::get(Ty->getContext(), in ConstantFoldScalarCall()
1646 if (IntrinsicID == Intrinsic::powi && Ty->isDoubleTy()) in ConstantFoldScalarCall()
1647 return ConstantFP::get(Ty->getContext(), in ConstantFoldScalarCall()
1688 ConstantInt::get(Ty->getContext(), Res), in ConstantFoldScalarCall()
1689 ConstantInt::get(Type::getInt1Ty(Ty->getContext()), Overflow) in ConstantFoldScalarCall()
1691 return ConstantStruct::get(cast<StructType>(Ty), Ops); in ConstantFoldScalarCall()
1695 return UndefValue::get(Ty); in ConstantFoldScalarCall()
1696 return ConstantInt::get(Ty, Op1->getValue().countTrailingZeros()); in ConstantFoldScalarCall()
1699 return UndefValue::get(Ty); in ConstantFoldScalarCall()
1700 return ConstantInt::get(Ty, Op1->getValue().countLeadingZeros()); in ConstantFoldScalarCall()
1724 return ConstantFP::get(Ty->getContext(), V); in ConstantFoldScalarCall()
1742 Type *Ty = VTy->getElementType(); in ConstantFoldVectorCall() local
1755 Constant *Folded = ConstantFoldScalarCall(Name, IntrinsicID, Ty, Lane, TLI); in ConstantFoldVectorCall()
1773 Type *Ty = F->getReturnType(); in ConstantFoldCall() local
1775 if (VectorType *VTy = dyn_cast<VectorType>(Ty)) in ConstantFoldCall()
1778 return ConstantFoldScalarCall(Name, F->getIntrinsicID(), Ty, Operands, TLI); in ConstantFoldCall()