Lines Matching refs:Ty

554     Type *Ty = cast<PointerType>(CE->getType())->getElementType();
555 unsigned NumBits = Ty->getPrimitiveSizeInBits();
559 (isa<IntegerType>(Ty) || Ty->isFloatingPointTy())) {
578 if (Ty->isFloatingPointTy())
579 Res = ConstantExpr::getBitCast(Res, Ty);
810 Type *Ty = Ptr->getType();
811 assert(Ty->isPointerTy() && "Forming regular GEP of non-pointer type");
815 if (SequentialType *ATy = dyn_cast<SequentialType>(Ty)) {
829 // The element size is 0. This may be [0 x Ty]*, so just use a zero
840 Ty = ATy->getElementType();
841 } else if (StructType *STy = dyn_cast<StructType>(Ty)) {
854 NewIdxs.push_back(ConstantInt::get(Type::getInt32Ty(Ty->getContext()),
857 Ty = STy->getTypeAtIndex(ElIdx);
862 } while (Ty != ResultElementTy);
872 assert(C->getType()->getPointerElementType() == Ty &&
877 if (Ty != ResultElementTy)
1307 static Constant *GetConstantFoldFPValue(double V, Type *Ty) {
1308 if (Ty->isHalfTy()) {
1312 return ConstantFP::get(Ty->getContext(), APF);
1314 if (Ty->isFloatTy())
1315 return ConstantFP::get(Ty->getContext(), APFloat((float)V));
1316 if (Ty->isDoubleTy())
1317 return ConstantFP::get(Ty->getContext(), APFloat(V));
1345 Type *Ty) {
1353 return GetConstantFoldFPValue(V, Ty);
1357 double V, double W, Type *Ty) {
1365 return GetConstantFoldFPValue(V, Ty);
1372 /// mode. The desired integer type Ty is used to select how many bits are
1377 bool roundTowardZero, Type *Ty) {
1379 unsigned ResultWidth = Ty->getIntegerBitWidth();
1392 return ConstantInt::get(Ty, UIntVal, /*isSigned=*/true);
1396 Type *Ty = Op->getType();
1398 if (Ty->isFloatTy())
1401 if (Ty->isDoubleTy())
1411 Type *Ty, ArrayRef<Constant *> Operands,
1421 return ConstantInt::get(Ty->getContext(), Val.bitcastToAPInt());
1424 if (!Ty->isHalfTy() && !Ty->isFloatTy() && !Ty->isDoubleTy())
1430 return ConstantFP::get(Ty->getContext(), V);
1448 return ConstantFoldFP(fabs, V, Ty);
1451 return ConstantFoldFP(log2, V, Ty);
1455 return ConstantFoldFP(log, V, Ty);
1459 return ConstantFoldFP(log10, V, Ty);
1463 return ConstantFoldFP(exp, V, Ty);
1467 return ConstantFoldFP(exp2, V, Ty);
1470 return ConstantFoldFP(floor, V, Ty);
1472 return ConstantFoldFP(ceil, V, Ty);
1481 return ConstantFoldFP(acos, V, Ty);
1483 return ConstantFoldFP(asin, V, Ty);
1485 return ConstantFoldFP(atan, V, Ty);
1489 return ConstantFoldFP(ceil, V, Ty);
1491 return ConstantFoldFP(cos, V, Ty);
1493 return ConstantFoldFP(cosh, V, Ty);
1495 return ConstantFoldFP(cos, V, Ty);
1499 return ConstantFoldFP(exp, V, Ty);
1504 return ConstantFoldBinaryFP(pow, 2.0, V, Ty);
1509 return ConstantFoldFP(fabs, V, Ty);
1511 return ConstantFoldFP(floor, V, Ty);
1515 return ConstantFoldFP(log, V, Ty);
1517 return ConstantFoldFP(log10, V, Ty);
1519 (Ty->isHalfTy() || Ty->isFloatTy() || Ty->isDoubleTy())) {
1521 return ConstantFoldFP(sqrt, V, Ty);
1523 return Constant::getNullValue(Ty);
1528 return ConstantFoldFP(sin, V, Ty);
1530 return ConstantFoldFP(sinh, V, Ty);
1532 return ConstantFoldFP(sqrt, V, Ty);
1534 return ConstantFoldFP(sqrt, V, Ty);
1536 return ConstantFoldFP(sin, V, Ty);
1540 return ConstantFoldFP(tan, V, Ty);
1542 return ConstantFoldFP(tanh, V, Ty);
1553 return ConstantInt::get(Ty->getContext(), Op->getValue().byteSwap());
1555 return ConstantInt::get(Ty, Op->getValue().countPopulation());
1568 return ConstantFP::get(Ty->getContext(), Val);
1588 /*roundTowardZero=*/false, Ty);
1596 /*roundTowardZero=*/true, Ty);
1611 if (!Ty->isHalfTy() && !Ty->isFloatTy() && !Ty->isDoubleTy())
1621 return ConstantFoldBinaryFP(pow, Op1V, Op2V, Ty);
1627 return ConstantFP::get(Ty->getContext(), V1);
1632 return ConstantFoldBinaryFP(pow, Op1V, Op2V, Ty);
1634 return ConstantFoldBinaryFP(fmod, Op1V, Op2V, Ty);
1636 return ConstantFoldBinaryFP(atan2, Op1V, Op2V, Ty);
1638 if (IntrinsicID == Intrinsic::powi && Ty->isHalfTy())
1639 return ConstantFP::get(Ty->getContext(),
1642 if (IntrinsicID == Intrinsic::powi && Ty->isFloatTy())
1643 return ConstantFP::get(Ty->getContext(),
1646 if (IntrinsicID == Intrinsic::powi && Ty->isDoubleTy())
1647 return ConstantFP::get(Ty->getContext(),
1688 ConstantInt::get(Ty->getContext(), Res),
1689 ConstantInt::get(Type::getInt1Ty(Ty->getContext()), Overflow)
1691 return ConstantStruct::get(cast<StructType>(Ty), Ops);
1695 return UndefValue::get(Ty);
1696 return ConstantInt::get(Ty, Op1->getValue().countTrailingZeros());
1699 return UndefValue::get(Ty);
1700 return ConstantInt::get(Ty, Op1->getValue().countLeadingZeros());
1724 return ConstantFP::get(Ty->getContext(), V);
1742 Type *Ty = VTy->getElementType();
1755 Constant *Folded = ConstantFoldScalarCall(Name, IntrinsicID, Ty, Lane, TLI);
1773 Type *Ty = F->getReturnType();
1775 if (VectorType *VTy = dyn_cast<VectorType>(Ty))
1778 return ConstantFoldScalarCall(Name, F->getIntrinsicID(), Ty, Operands, TLI);