Lines Matching refs:Ty
856 AllocaInst::AllocaInst(Type *Ty, const Twine &Name, Instruction *InsertBefore) in AllocaInst() argument
857 : AllocaInst(Ty, /*ArraySize=*/nullptr, Name, InsertBefore) {} in AllocaInst()
859 AllocaInst::AllocaInst(Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd) in AllocaInst() argument
860 : AllocaInst(Ty, /*ArraySize=*/nullptr, Name, InsertAtEnd) {} in AllocaInst()
862 AllocaInst::AllocaInst(Type *Ty, Value *ArraySize, const Twine &Name, in AllocaInst() argument
864 : AllocaInst(Ty, ArraySize, /*Align=*/0, Name, InsertBefore) {} in AllocaInst()
866 AllocaInst::AllocaInst(Type *Ty, Value *ArraySize, const Twine &Name, in AllocaInst() argument
868 : AllocaInst(Ty, ArraySize, /*Align=*/0, Name, InsertAtEnd) {} in AllocaInst()
870 AllocaInst::AllocaInst(Type *Ty, Value *ArraySize, unsigned Align, in AllocaInst() argument
872 : UnaryInstruction(PointerType::getUnqual(Ty), Alloca, in AllocaInst()
873 getAISize(Ty->getContext(), ArraySize), InsertBefore) { in AllocaInst()
875 assert(!Ty->isVoidTy() && "Cannot allocate void!"); in AllocaInst()
879 AllocaInst::AllocaInst(Type *Ty, Value *ArraySize, unsigned Align, in AllocaInst() argument
881 : UnaryInstruction(PointerType::getUnqual(Ty), Alloca, in AllocaInst()
882 getAISize(Ty->getContext(), ArraySize), InsertAtEnd) { in AllocaInst()
884 assert(!Ty->isVoidTy() && "Cannot allocate void!"); in AllocaInst()
958 LoadInst::LoadInst(Type *Ty, Value *Ptr, const Twine &Name, bool isVolatile, in LoadInst() argument
961 : UnaryInstruction(Ty, Load, Ptr, InsertBef) { in LoadInst()
1292 Type *GetElementPtrInst::getIndexedType(Type *Ty, ArrayRef<Value *> IdxList) { in getIndexedType() argument
1293 return getIndexedTypeInternal(Ty, IdxList); in getIndexedType()
1296 Type *GetElementPtrInst::getIndexedType(Type *Ty, in getIndexedType() argument
1298 return getIndexedTypeInternal(Ty, IdxList); in getIndexedType()
1301 Type *GetElementPtrInst::getIndexedType(Type *Ty, ArrayRef<uint64_t> IdxList) { in getIndexedType() argument
1302 return getIndexedTypeInternal(Ty, IdxList); in getIndexedType()
1640 Type *Ty, const Twine &Name, in BinaryOperator() argument
1642 : Instruction(Ty, iType, in BinaryOperator()
1653 Type *Ty, const Twine &Name, in BinaryOperator() argument
1655 : Instruction(Ty, iType, in BinaryOperator()
2297 CastInst *CastInst::Create(Instruction::CastOps op, Value *S, Type *Ty, in Create() argument
2299 assert(castIsValid(op, S, Ty) && "Invalid cast!"); in Create()
2302 case Trunc: return new TruncInst (S, Ty, Name, InsertBefore); in Create()
2303 case ZExt: return new ZExtInst (S, Ty, Name, InsertBefore); in Create()
2304 case SExt: return new SExtInst (S, Ty, Name, InsertBefore); in Create()
2305 case FPTrunc: return new FPTruncInst (S, Ty, Name, InsertBefore); in Create()
2306 case FPExt: return new FPExtInst (S, Ty, Name, InsertBefore); in Create()
2307 case UIToFP: return new UIToFPInst (S, Ty, Name, InsertBefore); in Create()
2308 case SIToFP: return new SIToFPInst (S, Ty, Name, InsertBefore); in Create()
2309 case FPToUI: return new FPToUIInst (S, Ty, Name, InsertBefore); in Create()
2310 case FPToSI: return new FPToSIInst (S, Ty, Name, InsertBefore); in Create()
2311 case PtrToInt: return new PtrToIntInst (S, Ty, Name, InsertBefore); in Create()
2312 case IntToPtr: return new IntToPtrInst (S, Ty, Name, InsertBefore); in Create()
2313 case BitCast: return new BitCastInst (S, Ty, Name, InsertBefore); in Create()
2314 case AddrSpaceCast: return new AddrSpaceCastInst (S, Ty, Name, InsertBefore); in Create()
2319 CastInst *CastInst::Create(Instruction::CastOps op, Value *S, Type *Ty, in Create() argument
2321 assert(castIsValid(op, S, Ty) && "Invalid cast!"); in Create()
2324 case Trunc: return new TruncInst (S, Ty, Name, InsertAtEnd); in Create()
2325 case ZExt: return new ZExtInst (S, Ty, Name, InsertAtEnd); in Create()
2326 case SExt: return new SExtInst (S, Ty, Name, InsertAtEnd); in Create()
2327 case FPTrunc: return new FPTruncInst (S, Ty, Name, InsertAtEnd); in Create()
2328 case FPExt: return new FPExtInst (S, Ty, Name, InsertAtEnd); in Create()
2329 case UIToFP: return new UIToFPInst (S, Ty, Name, InsertAtEnd); in Create()
2330 case SIToFP: return new SIToFPInst (S, Ty, Name, InsertAtEnd); in Create()
2331 case FPToUI: return new FPToUIInst (S, Ty, Name, InsertAtEnd); in Create()
2332 case FPToSI: return new FPToSIInst (S, Ty, Name, InsertAtEnd); in Create()
2333 case PtrToInt: return new PtrToIntInst (S, Ty, Name, InsertAtEnd); in Create()
2334 case IntToPtr: return new IntToPtrInst (S, Ty, Name, InsertAtEnd); in Create()
2335 case BitCast: return new BitCastInst (S, Ty, Name, InsertAtEnd); in Create()
2336 case AddrSpaceCast: return new AddrSpaceCastInst (S, Ty, Name, InsertAtEnd); in Create()
2341 CastInst *CastInst::CreateZExtOrBitCast(Value *S, Type *Ty, in CreateZExtOrBitCast() argument
2344 if (S->getType()->getScalarSizeInBits() == Ty->getScalarSizeInBits()) in CreateZExtOrBitCast()
2345 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore); in CreateZExtOrBitCast()
2346 return Create(Instruction::ZExt, S, Ty, Name, InsertBefore); in CreateZExtOrBitCast()
2349 CastInst *CastInst::CreateZExtOrBitCast(Value *S, Type *Ty, in CreateZExtOrBitCast() argument
2352 if (S->getType()->getScalarSizeInBits() == Ty->getScalarSizeInBits()) in CreateZExtOrBitCast()
2353 return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd); in CreateZExtOrBitCast()
2354 return Create(Instruction::ZExt, S, Ty, Name, InsertAtEnd); in CreateZExtOrBitCast()
2357 CastInst *CastInst::CreateSExtOrBitCast(Value *S, Type *Ty, in CreateSExtOrBitCast() argument
2360 if (S->getType()->getScalarSizeInBits() == Ty->getScalarSizeInBits()) in CreateSExtOrBitCast()
2361 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore); in CreateSExtOrBitCast()
2362 return Create(Instruction::SExt, S, Ty, Name, InsertBefore); in CreateSExtOrBitCast()
2365 CastInst *CastInst::CreateSExtOrBitCast(Value *S, Type *Ty, in CreateSExtOrBitCast() argument
2368 if (S->getType()->getScalarSizeInBits() == Ty->getScalarSizeInBits()) in CreateSExtOrBitCast()
2369 return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd); in CreateSExtOrBitCast()
2370 return Create(Instruction::SExt, S, Ty, Name, InsertAtEnd); in CreateSExtOrBitCast()
2373 CastInst *CastInst::CreateTruncOrBitCast(Value *S, Type *Ty, in CreateTruncOrBitCast() argument
2376 if (S->getType()->getScalarSizeInBits() == Ty->getScalarSizeInBits()) in CreateTruncOrBitCast()
2377 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore); in CreateTruncOrBitCast()
2378 return Create(Instruction::Trunc, S, Ty, Name, InsertBefore); in CreateTruncOrBitCast()
2381 CastInst *CastInst::CreateTruncOrBitCast(Value *S, Type *Ty, in CreateTruncOrBitCast() argument
2384 if (S->getType()->getScalarSizeInBits() == Ty->getScalarSizeInBits()) in CreateTruncOrBitCast()
2385 return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd); in CreateTruncOrBitCast()
2386 return Create(Instruction::Trunc, S, Ty, Name, InsertAtEnd); in CreateTruncOrBitCast()
2389 CastInst *CastInst::CreatePointerCast(Value *S, Type *Ty, in CreatePointerCast() argument
2393 assert((Ty->isIntOrIntVectorTy() || Ty->isPtrOrPtrVectorTy()) && in CreatePointerCast()
2395 assert(Ty->isVectorTy() == S->getType()->isVectorTy() && "Invalid cast"); in CreatePointerCast()
2396 assert((!Ty->isVectorTy() || in CreatePointerCast()
2397 Ty->getVectorNumElements() == S->getType()->getVectorNumElements()) && in CreatePointerCast()
2400 if (Ty->isIntOrIntVectorTy()) in CreatePointerCast()
2401 return Create(Instruction::PtrToInt, S, Ty, Name, InsertAtEnd); in CreatePointerCast()
2403 return CreatePointerBitCastOrAddrSpaceCast(S, Ty, Name, InsertAtEnd); in CreatePointerCast()
2407 CastInst *CastInst::CreatePointerCast(Value *S, Type *Ty, in CreatePointerCast() argument
2411 assert((Ty->isIntOrIntVectorTy() || Ty->isPtrOrPtrVectorTy()) && in CreatePointerCast()
2413 assert(Ty->isVectorTy() == S->getType()->isVectorTy() && "Invalid cast"); in CreatePointerCast()
2414 assert((!Ty->isVectorTy() || in CreatePointerCast()
2415 Ty->getVectorNumElements() == S->getType()->getVectorNumElements()) && in CreatePointerCast()
2418 if (Ty->isIntOrIntVectorTy()) in CreatePointerCast()
2419 return Create(Instruction::PtrToInt, S, Ty, Name, InsertBefore); in CreatePointerCast()
2421 return CreatePointerBitCastOrAddrSpaceCast(S, Ty, Name, InsertBefore); in CreatePointerCast()
2425 Value *S, Type *Ty, in CreatePointerBitCastOrAddrSpaceCast() argument
2429 assert(Ty->isPtrOrPtrVectorTy() && "Invalid cast"); in CreatePointerBitCastOrAddrSpaceCast()
2431 if (S->getType()->getPointerAddressSpace() != Ty->getPointerAddressSpace()) in CreatePointerBitCastOrAddrSpaceCast()
2432 return Create(Instruction::AddrSpaceCast, S, Ty, Name, InsertAtEnd); in CreatePointerBitCastOrAddrSpaceCast()
2434 return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd); in CreatePointerBitCastOrAddrSpaceCast()
2438 Value *S, Type *Ty, in CreatePointerBitCastOrAddrSpaceCast() argument
2442 assert(Ty->isPtrOrPtrVectorTy() && "Invalid cast"); in CreatePointerBitCastOrAddrSpaceCast()
2444 if (S->getType()->getPointerAddressSpace() != Ty->getPointerAddressSpace()) in CreatePointerBitCastOrAddrSpaceCast()
2445 return Create(Instruction::AddrSpaceCast, S, Ty, Name, InsertBefore); in CreatePointerBitCastOrAddrSpaceCast()
2447 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore); in CreatePointerBitCastOrAddrSpaceCast()
2450 CastInst *CastInst::CreateBitOrPointerCast(Value *S, Type *Ty, in CreateBitOrPointerCast() argument
2453 if (S->getType()->isPointerTy() && Ty->isIntegerTy()) in CreateBitOrPointerCast()
2454 return Create(Instruction::PtrToInt, S, Ty, Name, InsertBefore); in CreateBitOrPointerCast()
2455 if (S->getType()->isIntegerTy() && Ty->isPointerTy()) in CreateBitOrPointerCast()
2456 return Create(Instruction::IntToPtr, S, Ty, Name, InsertBefore); in CreateBitOrPointerCast()
2458 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore); in CreateBitOrPointerCast()
2461 CastInst *CastInst::CreateIntegerCast(Value *C, Type *Ty, in CreateIntegerCast() argument
2464 assert(C->getType()->isIntOrIntVectorTy() && Ty->isIntOrIntVectorTy() && in CreateIntegerCast()
2467 unsigned DstBits = Ty->getScalarSizeInBits(); in CreateIntegerCast()
2472 return Create(opcode, C, Ty, Name, InsertBefore); in CreateIntegerCast()
2475 CastInst *CastInst::CreateIntegerCast(Value *C, Type *Ty, in CreateIntegerCast() argument
2478 assert(C->getType()->isIntOrIntVectorTy() && Ty->isIntOrIntVectorTy() && in CreateIntegerCast()
2481 unsigned DstBits = Ty->getScalarSizeInBits(); in CreateIntegerCast()
2486 return Create(opcode, C, Ty, Name, InsertAtEnd); in CreateIntegerCast()
2489 CastInst *CastInst::CreateFPCast(Value *C, Type *Ty, in CreateFPCast() argument
2492 assert(C->getType()->isFPOrFPVectorTy() && Ty->isFPOrFPVectorTy() && in CreateFPCast()
2495 unsigned DstBits = Ty->getScalarSizeInBits(); in CreateFPCast()
2499 return Create(opcode, C, Ty, Name, InsertBefore); in CreateFPCast()
2502 CastInst *CastInst::CreateFPCast(Value *C, Type *Ty, in CreateFPCast() argument
2505 assert(C->getType()->isFPOrFPVectorTy() && Ty->isFPOrFPVectorTy() && in CreateFPCast()
2508 unsigned DstBits = Ty->getScalarSizeInBits(); in CreateFPCast()
2512 return Create(opcode, C, Ty, Name, InsertAtEnd); in CreateFPCast()
2851 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore in TruncInst() argument
2852 ) : CastInst(Ty, Trunc, S, Name, InsertBefore) { in TruncInst()
2853 assert(castIsValid(getOpcode(), S, Ty) && "Illegal Trunc"); in TruncInst()
2857 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd in TruncInst() argument
2858 ) : CastInst(Ty, Trunc, S, Name, InsertAtEnd) { in TruncInst()
2859 assert(castIsValid(getOpcode(), S, Ty) && "Illegal Trunc"); in TruncInst()
2863 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore in ZExtInst() argument
2864 ) : CastInst(Ty, ZExt, S, Name, InsertBefore) { in ZExtInst()
2865 assert(castIsValid(getOpcode(), S, Ty) && "Illegal ZExt"); in ZExtInst()
2869 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd in ZExtInst() argument
2870 ) : CastInst(Ty, ZExt, S, Name, InsertAtEnd) { in ZExtInst()
2871 assert(castIsValid(getOpcode(), S, Ty) && "Illegal ZExt"); in ZExtInst()
2874 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore in SExtInst() argument
2875 ) : CastInst(Ty, SExt, S, Name, InsertBefore) { in SExtInst()
2876 assert(castIsValid(getOpcode(), S, Ty) && "Illegal SExt"); in SExtInst()
2880 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd in SExtInst() argument
2881 ) : CastInst(Ty, SExt, S, Name, InsertAtEnd) { in SExtInst()
2882 assert(castIsValid(getOpcode(), S, Ty) && "Illegal SExt"); in SExtInst()
2886 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore in FPTruncInst() argument
2887 ) : CastInst(Ty, FPTrunc, S, Name, InsertBefore) { in FPTruncInst()
2888 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPTrunc"); in FPTruncInst()
2892 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd in FPTruncInst() argument
2893 ) : CastInst(Ty, FPTrunc, S, Name, InsertAtEnd) { in FPTruncInst()
2894 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPTrunc"); in FPTruncInst()
2898 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore in FPExtInst() argument
2899 ) : CastInst(Ty, FPExt, S, Name, InsertBefore) { in FPExtInst()
2900 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPExt"); in FPExtInst()
2904 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd in FPExtInst() argument
2905 ) : CastInst(Ty, FPExt, S, Name, InsertAtEnd) { in FPExtInst()
2906 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPExt"); in FPExtInst()
2910 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore in UIToFPInst() argument
2911 ) : CastInst(Ty, UIToFP, S, Name, InsertBefore) { in UIToFPInst()
2912 assert(castIsValid(getOpcode(), S, Ty) && "Illegal UIToFP"); in UIToFPInst()
2916 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd in UIToFPInst() argument
2917 ) : CastInst(Ty, UIToFP, S, Name, InsertAtEnd) { in UIToFPInst()
2918 assert(castIsValid(getOpcode(), S, Ty) && "Illegal UIToFP"); in UIToFPInst()
2922 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore in SIToFPInst() argument
2923 ) : CastInst(Ty, SIToFP, S, Name, InsertBefore) { in SIToFPInst()
2924 assert(castIsValid(getOpcode(), S, Ty) && "Illegal SIToFP"); in SIToFPInst()
2928 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd in SIToFPInst() argument
2929 ) : CastInst(Ty, SIToFP, S, Name, InsertAtEnd) { in SIToFPInst()
2930 assert(castIsValid(getOpcode(), S, Ty) && "Illegal SIToFP"); in SIToFPInst()
2934 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore in FPToUIInst() argument
2935 ) : CastInst(Ty, FPToUI, S, Name, InsertBefore) { in FPToUIInst()
2936 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPToUI"); in FPToUIInst()
2940 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd in FPToUIInst() argument
2941 ) : CastInst(Ty, FPToUI, S, Name, InsertAtEnd) { in FPToUIInst()
2942 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPToUI"); in FPToUIInst()
2946 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore in FPToSIInst() argument
2947 ) : CastInst(Ty, FPToSI, S, Name, InsertBefore) { in FPToSIInst()
2948 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPToSI"); in FPToSIInst()
2952 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd in FPToSIInst() argument
2953 ) : CastInst(Ty, FPToSI, S, Name, InsertAtEnd) { in FPToSIInst()
2954 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPToSI"); in FPToSIInst()
2958 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore in PtrToIntInst() argument
2959 ) : CastInst(Ty, PtrToInt, S, Name, InsertBefore) { in PtrToIntInst()
2960 assert(castIsValid(getOpcode(), S, Ty) && "Illegal PtrToInt"); in PtrToIntInst()
2964 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd in PtrToIntInst() argument
2965 ) : CastInst(Ty, PtrToInt, S, Name, InsertAtEnd) { in PtrToIntInst()
2966 assert(castIsValid(getOpcode(), S, Ty) && "Illegal PtrToInt"); in PtrToIntInst()
2970 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore in IntToPtrInst() argument
2971 ) : CastInst(Ty, IntToPtr, S, Name, InsertBefore) { in IntToPtrInst()
2972 assert(castIsValid(getOpcode(), S, Ty) && "Illegal IntToPtr"); in IntToPtrInst()
2976 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd in IntToPtrInst() argument
2977 ) : CastInst(Ty, IntToPtr, S, Name, InsertAtEnd) { in IntToPtrInst()
2978 assert(castIsValid(getOpcode(), S, Ty) && "Illegal IntToPtr"); in IntToPtrInst()
2982 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore in BitCastInst() argument
2983 ) : CastInst(Ty, BitCast, S, Name, InsertBefore) { in BitCastInst()
2984 assert(castIsValid(getOpcode(), S, Ty) && "Illegal BitCast"); in BitCastInst()
2988 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd in BitCastInst() argument
2989 ) : CastInst(Ty, BitCast, S, Name, InsertAtEnd) { in BitCastInst()
2990 assert(castIsValid(getOpcode(), S, Ty) && "Illegal BitCast"); in BitCastInst()
2994 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore in AddrSpaceCastInst() argument
2995 ) : CastInst(Ty, AddrSpaceCast, S, Name, InsertBefore) { in AddrSpaceCastInst()
2996 assert(castIsValid(getOpcode(), S, Ty) && "Illegal AddrSpaceCast"); in AddrSpaceCastInst()
3000 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd in AddrSpaceCastInst() argument
3001 ) : CastInst(Ty, AddrSpaceCast, S, Name, InsertAtEnd) { in AddrSpaceCastInst()
3002 assert(castIsValid(getOpcode(), S, Ty) && "Illegal AddrSpaceCast"); in AddrSpaceCastInst()