Lines Matching defs:Ty

718 CallInst::CallInst(FunctionType *Ty, Value *Func, const Twine &Name,
720 : CallBase(Ty->getReturnType(), Instruction::Call,
722 init(Ty, Func, Name);
1196 static Align computeAllocaDefaultAlign(Type *Ty, InsertPosition Pos) {
1203 return DL.getPrefTypeAlign(Ty);
1206 AllocaInst::AllocaInst(Type *Ty, unsigned AddrSpace, const Twine &Name,
1208 : AllocaInst(Ty, AddrSpace, /*ArraySize=*/nullptr, Name, InsertBefore) {}
1210 AllocaInst::AllocaInst(Type *Ty, unsigned AddrSpace, Value *ArraySize,
1212 : AllocaInst(Ty, AddrSpace, ArraySize,
1213 computeAllocaDefaultAlign(Ty, InsertBefore), Name,
1216 AllocaInst::AllocaInst(Type *Ty, unsigned AddrSpace, Value *ArraySize,
1219 : UnaryInstruction(PointerType::get(Ty, AddrSpace), Alloca,
1220 getAISize(Ty->getContext(), ArraySize), InsertBefore),
1221 AllocatedType(Ty) {
1223 assert(!Ty->isVoidTy() && "Cannot allocate void!");
1254 static Align computeLoadStoreDefaultAlign(Type *Ty, InsertPosition Pos) {
1261 return DL.getABITypeAlign(Ty);
1264 LoadInst::LoadInst(Type *Ty, Value *Ptr, const Twine &Name,
1266 : LoadInst(Ty, Ptr, Name, /*isVolatile=*/false, InsertBef) {}
1268 LoadInst::LoadInst(Type *Ty, Value *Ptr, const Twine &Name, bool isVolatile,
1270 : LoadInst(Ty, Ptr, Name, isVolatile,
1271 computeLoadStoreDefaultAlign(Ty, InsertBef), InsertBef) {}
1273 LoadInst::LoadInst(Type *Ty, Value *Ptr, const Twine &Name, bool isVolatile,
1275 : LoadInst(Ty, Ptr, Name, isVolatile, Align, AtomicOrdering::NotAtomic,
1278 LoadInst::LoadInst(Type *Ty, Value *Ptr, const Twine &Name, bool isVolatile,
1281 : UnaryInstruction(Ty, Load, Ptr, InsertBef) {
1476 Type *GetElementPtrInst::getTypeAtIndex(Type *Ty, Value *Idx) {
1477 if (auto *Struct = dyn_cast<StructType>(Ty)) {
1484 if (auto *Array = dyn_cast<ArrayType>(Ty))
1486 if (auto *Vector = dyn_cast<VectorType>(Ty))
1491 Type *GetElementPtrInst::getTypeAtIndex(Type *Ty, uint64_t Idx) {
1492 if (auto *Struct = dyn_cast<StructType>(Ty)) {
1497 if (auto *Array = dyn_cast<ArrayType>(Ty))
1499 if (auto *Vector = dyn_cast<VectorType>(Ty))
1505 static Type *getIndexedTypeInternal(Type *Ty, ArrayRef<IndexTy> IdxList) {
1507 return Ty;
1509 Ty = GetElementPtrInst::getTypeAtIndex(Ty, V);
1510 if (!Ty)
1511 return Ty;
1513 return Ty;
1516 Type *GetElementPtrInst::getIndexedType(Type *Ty, ArrayRef<Value *> IdxList) {
1517 return getIndexedTypeInternal(Ty, IdxList);
1520 Type *GetElementPtrInst::getIndexedType(Type *Ty,
1522 return getIndexedTypeInternal(Ty, IdxList);
1525 Type *GetElementPtrInst::getIndexedType(Type *Ty, ArrayRef<uint64_t> IdxList) {
1526 return getIndexedTypeInternal(Ty, IdxList);
2527 UnaryOperator::UnaryOperator(UnaryOps iType, Value *S, Type *Ty,
2529 : UnaryInstruction(Ty, iType, S, InsertBefore) {
2561 BinaryOperator::BinaryOperator(BinaryOps iType, Value *S1, Value *S2, Type *Ty,
2563 : Instruction(Ty, iType, OperandTraits<BinaryOperator>::op_begin(this),
2972 CastInst *CastInst::Create(Instruction::CastOps op, Value *S, Type *Ty,
2974 assert(castIsValid(op, S, Ty) && "Invalid cast!");
2977 case Trunc: return new TruncInst (S, Ty, Name, InsertBefore);
2978 case ZExt: return new ZExtInst (S, Ty, Name, InsertBefore);
2979 case SExt: return new SExtInst (S, Ty, Name, InsertBefore);
2980 case FPTrunc: return new FPTruncInst (S, Ty, Name, InsertBefore);
2981 case FPExt: return new FPExtInst (S, Ty, Name, InsertBefore);
2982 case UIToFP: return new UIToFPInst (S, Ty, Name, InsertBefore);
2983 case SIToFP: return new SIToFPInst (S, Ty, Name, InsertBefore);
2984 case FPToUI: return new FPToUIInst (S, Ty, Name, InsertBefore);
2985 case FPToSI: return new FPToSIInst (S, Ty, Name, InsertBefore);
2986 case PtrToInt: return new PtrToIntInst (S, Ty, Name, InsertBefore);
2987 case IntToPtr: return new IntToPtrInst (S, Ty, Name, InsertBefore);
2989 return new BitCastInst(S, Ty, Name, InsertBefore);
2991 return new AddrSpaceCastInst(S, Ty, Name, InsertBefore);
2997 CastInst *CastInst::CreateZExtOrBitCast(Value *S, Type *Ty, const Twine &Name,
2999 if (S->getType()->getScalarSizeInBits() == Ty->getScalarSizeInBits())
3000 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
3001 return Create(Instruction::ZExt, S, Ty, Name, InsertBefore);
3004 CastInst *CastInst::CreateSExtOrBitCast(Value *S, Type *Ty, const Twine &Name,
3006 if (S->getType()->getScalarSizeInBits() == Ty->getScalarSizeInBits())
3007 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
3008 return Create(Instruction::SExt, S, Ty, Name, InsertBefore);
3011 CastInst *CastInst::CreateTruncOrBitCast(Value *S, Type *Ty, const Twine &Name,
3013 if (S->getType()->getScalarSizeInBits() == Ty->getScalarSizeInBits())
3014 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
3015 return Create(Instruction::Trunc, S, Ty, Name, InsertBefore);
3019 CastInst *CastInst::CreatePointerCast(Value *S, Type *Ty, const Twine &Name,
3022 assert((Ty->isIntOrIntVectorTy() || Ty->isPtrOrPtrVectorTy()) &&
3024 assert(Ty->isVectorTy() == S->getType()->isVectorTy() && "Invalid cast");
3025 assert((!Ty->isVectorTy() ||
3026 cast<VectorType>(Ty)->getElementCount() ==
3030 if (Ty->isIntOrIntVectorTy())
3031 return Create(Instruction::PtrToInt, S, Ty, Name, InsertBefore);
3033 return CreatePointerBitCastOrAddrSpaceCast(S, Ty, Name, InsertBefore);
3037 Value *S, Type *Ty, const Twine &Name, InsertPosition InsertBefore) {
3039 assert(Ty->isPtrOrPtrVectorTy() && "Invalid cast");
3041 if (S->getType()->getPointerAddressSpace() != Ty->getPointerAddressSpace())
3042 return Create(Instruction::AddrSpaceCast, S, Ty, Name, InsertBefore);
3044 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
3047 CastInst *CastInst::CreateBitOrPointerCast(Value *S, Type *Ty,
3050 if (S->getType()->isPointerTy() && Ty->isIntegerTy())
3051 return Create(Instruction::PtrToInt, S, Ty, Name, InsertBefore);
3052 if (S->getType()->isIntegerTy() && Ty->isPointerTy())
3053 return Create(Instruction::IntToPtr, S, Ty, Name, InsertBefore);
3055 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
3058 CastInst *CastInst::CreateIntegerCast(Value *C, Type *Ty, bool isSigned,
3061 assert(C->getType()->isIntOrIntVectorTy() && Ty->isIntOrIntVectorTy() &&
3064 unsigned DstBits = Ty->getScalarSizeInBits();
3069 return Create(opcode, C, Ty, Name, InsertBefore);
3072 CastInst *CastInst::CreateFPCast(Value *C, Type *Ty, const Twine &Name,
3074 assert(C->getType()->isFPOrFPVectorTy() && Ty->isFPOrFPVectorTy() &&
3077 unsigned DstBits = Ty->getScalarSizeInBits();
3078 assert((C->getType() == Ty || SrcBits != DstBits) && "Invalid cast");
3082 return Create(opcode, C, Ty, Name, InsertBefore);
3143 // castIsValid( getCastOpcode(Val, Ty), Val, Ty)
3349 TruncInst::TruncInst(Value *S, Type *Ty, const Twine &Name,
3351 : CastInst(Ty, Trunc, S, Name, InsertBefore) {
3352 assert(castIsValid(getOpcode(), S, Ty) && "Illegal Trunc");
3355 ZExtInst::ZExtInst(Value *S, Type *Ty, const Twine &Name,
3357 : CastInst(Ty, ZExt, S, Name, InsertBefore) {
3358 assert(castIsValid(getOpcode(), S, Ty) && "Illegal ZExt");
3361 SExtInst::SExtInst(Value *S, Type *Ty, const Twine &Name,
3363 : CastInst(Ty, SExt, S, Name, InsertBefore) {
3364 assert(castIsValid(getOpcode(), S, Ty) && "Illegal SExt");
3367 FPTruncInst::FPTruncInst(Value *S, Type *Ty, const Twine &Name,
3369 : CastInst(Ty, FPTrunc, S, Name, InsertBefore) {
3370 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPTrunc");
3373 FPExtInst::FPExtInst(Value *S, Type *Ty, const Twine &Name,
3375 : CastInst(Ty, FPExt, S, Name, InsertBefore) {
3376 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPExt");
3379 UIToFPInst::UIToFPInst(Value *S, Type *Ty, const Twine &Name,
3381 : CastInst(Ty, UIToFP, S, Name, InsertBefore) {
3382 assert(castIsValid(getOpcode(), S, Ty) && "Illegal UIToFP");
3385 SIToFPInst::SIToFPInst(Value *S, Type *Ty, const Twine &Name,
3387 : CastInst(Ty, SIToFP, S, Name, InsertBefore) {
3388 assert(castIsValid(getOpcode(), S, Ty) && "Illegal SIToFP");
3391 FPToUIInst::FPToUIInst(Value *S, Type *Ty, const Twine &Name,
3393 : CastInst(Ty, FPToUI, S, Name, InsertBefore) {
3394 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPToUI");
3397 FPToSIInst::FPToSIInst(Value *S, Type *Ty, const Twine &Name,
3399 : CastInst(Ty, FPToSI, S, Name, InsertBefore) {
3400 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPToSI");
3403 PtrToIntInst::PtrToIntInst(Value *S, Type *Ty, const Twine &Name,
3405 : CastInst(Ty, PtrToInt, S, Name, InsertBefore) {
3406 assert(castIsValid(getOpcode(), S, Ty) && "Illegal PtrToInt");
3409 IntToPtrInst::IntToPtrInst(Value *S, Type *Ty, const Twine &Name,
3411 : CastInst(Ty, IntToPtr, S, Name, InsertBefore) {
3412 assert(castIsValid(getOpcode(), S, Ty) && "Illegal IntToPtr");
3415 BitCastInst::BitCastInst(Value *S, Type *Ty, const Twine &Name,
3417 : CastInst(Ty, BitCast, S, Name, InsertBefore) {
3418 assert(castIsValid(getOpcode(), S, Ty) && "Illegal BitCast");
3421 AddrSpaceCastInst::AddrSpaceCastInst(Value *S, Type *Ty, const Twine &Name,
3423 : CastInst(Ty, AddrSpaceCast, S, Name, InsertBefore) {
3424 assert(castIsValid(getOpcode(), S, Ty) && "Illegal AddrSpaceCast");