Lines Matching full:instruction
10 // This file implements all of the non-inline methods for the LLVM instruction
34 Instruction *II(getInstruction());
88 : Instruction(PN.getType(), Instruction::PHI,
182 Instruction *InsertBefore)
183 : Instruction(RetTy, Instruction::LandingPad, nullptr, 0, InsertBefore) {
190 : Instruction(RetTy, Instruction::LandingPad, nullptr, 0, InsertAtEnd) {
195 : Instruction(LP.getType(), Instruction::LandingPad,
212 Instruction *InsertBefore) {
303 Instruction *InsertBefore)
304 : Instruction(cast<FunctionType>(cast<PointerType>(Func->getType())
306 Instruction::Call,
314 : Instruction(cast<FunctionType>(cast<PointerType>(Func->getType())
316 Instruction::Call,
323 : Instruction(CI.getType(), Instruction::Call,
384 static Instruction *createMalloc(Instruction *InsertBefore,
437 Instruction *Result = nullptr;
442 // Create a cast instruction to convert to the right type...
449 // Create a cast instruction to convert to the right type...
469 Instruction *CallInst::CreateMalloc(Instruction *InsertBefore,
486 Instruction *CallInst::CreateMalloc(BasicBlock *InsertAtEnd,
494 static Instruction* createFree(Value* Source, Instruction *InsertBefore,
527 Instruction * CallInst::CreateFree(Value* Source, Instruction *InsertBefore) {
534 Instruction* CallInst::CreateFree(Value* Source, BasicBlock *InsertAtEnd) {
535 Instruction* FreeCall = createFree(Source, nullptr, InsertAtEnd);
570 : TerminatorInst(II.getType(), Instruction::Invoke,
641 : TerminatorInst(Type::getVoidTy(RI.getContext()), Instruction::Ret,
650 ReturnInst::ReturnInst(LLVMContext &C, Value *retVal, Instruction *InsertBefore)
651 : TerminatorInst(Type::getVoidTy(C), Instruction::Ret,
658 : TerminatorInst(Type::getVoidTy(C), Instruction::Ret,
665 : TerminatorInst(Type::getVoidTy(Context), Instruction::Ret,
691 : TerminatorInst(Type::getVoidTy(RI.getContext()), Instruction::Resume,
696 ResumeInst::ResumeInst(Value *Exn, Instruction *InsertBefore)
697 : TerminatorInst(Type::getVoidTy(Exn->getContext()), Instruction::Resume,
703 : TerminatorInst(Type::getVoidTy(Exn->getContext()), Instruction::Resume,
725 Instruction *InsertBefore)
726 : TerminatorInst(Type::getVoidTy(Context), Instruction::Unreachable,
730 : TerminatorInst(Type::getVoidTy(Context), Instruction::Unreachable,
756 BranchInst::BranchInst(BasicBlock *IfTrue, Instruction *InsertBefore)
757 : TerminatorInst(Type::getVoidTy(IfTrue->getContext()), Instruction::Br,
764 Instruction *InsertBefore)
765 : TerminatorInst(Type::getVoidTy(IfTrue->getContext()), Instruction::Br,
777 : TerminatorInst(Type::getVoidTy(IfTrue->getContext()), Instruction::Br,
786 : TerminatorInst(Type::getVoidTy(IfTrue->getContext()), Instruction::Br,
799 TerminatorInst(Type::getVoidTy(BI.getContext()), Instruction::Br,
856 AllocaInst::AllocaInst(Type *Ty, const Twine &Name, Instruction *InsertBefore)
863 Instruction *InsertBefore)
871 const Twine &Name, Instruction *InsertBefore)
934 LoadInst::LoadInst(Value *Ptr, const Twine &Name, Instruction *InsertBef)
941 Instruction *InsertBef)
949 unsigned Align, Instruction *InsertBef)
960 SynchronizationScope SynchScope, Instruction *InsertBef)
982 LoadInst::LoadInst(Value *Ptr, const char *Name, Instruction *InsertBef)
1003 Instruction *InsertBef)
1048 StoreInst::StoreInst(Value *val, Value *addr, Instruction *InsertBefore)
1055 Instruction *InsertBefore)
1063 Instruction *InsertBefore)
1075 Instruction *InsertBefore)
1076 : Instruction(Type::getVoidTy(val->getContext()), Store,
1092 : Instruction(Type::getVoidTy(val->getContext()), Store,
1152 Instruction *InsertBefore)
1153 : Instruction(
1166 : Instruction(
1201 Instruction *InsertBefore)
1202 : Instruction(Val->getType(), AtomicRMW,
1213 : Instruction(Val->getType(), AtomicRMW,
1226 Instruction *InsertBefore)
1227 : Instruction(Type::getVoidTy(C), Fence, nullptr, 0, InsertBefore) {
1235 : Instruction(Type::getVoidTy(C), Fence, nullptr, 0, InsertAtEnd) {
1253 : Instruction(GEPI.getType(), GetElementPtr,
1262 /// a gep instruction with the specified parameters.
1350 Instruction *InsertBef)
1351 : Instruction(cast<VectorType>(Val->getType())->getElementType(),
1356 "Invalid extractelement instruction operands!");
1365 : Instruction(cast<VectorType>(Val->getType())->getElementType(),
1370 "Invalid extractelement instruction operands!");
1391 Instruction *InsertBef)
1392 : Instruction(Vec->getType(), InsertElement,
1396 "Invalid insertelement instruction operands!");
1406 : Instruction(Vec->getType(), InsertElement,
1410 "Invalid insertelement instruction operands!");
1438 Instruction *InsertBefore)
1439 : Instruction(VectorType::get(cast<VectorType>(V1->getType())->getElementType(),
1446 "Invalid shuffle vector instruction operands!");
1456 : Instruction(VectorType::get(cast<VectorType>(V1->getType())->getElementType(),
1463 "Invalid shuffle vector instruction operands!");
1513 if (CE->getOpcode() == Instruction::UserOp1)
1532 /// getShuffleMask - Return the full mask for this instruction, where each
1575 : Instruction(IVI.getType(), InsertValue,
1605 // with an extractvalue instruction with the specified parameters.
1641 Instruction *InsertBefore)
1642 : Instruction(Ty, iType,
1655 : Instruction(Ty, iType,
1743 Instruction *InsertBefore) {
1758 Instruction *InsertBefore) {
1760 return new BinaryOperator(Instruction::Sub,
1768 return new BinaryOperator(Instruction::Sub,
1774 Instruction *InsertBefore) {
1786 Instruction *InsertBefore) {
1798 Instruction *InsertBefore) {
1800 return new BinaryOperator(Instruction::FSub, zero, Op,
1807 return new BinaryOperator(Instruction::FSub, zero, Op,
1812 Instruction *InsertBefore) {
1814 return new BinaryOperator(Instruction::Xor, Op, C,
1821 return new BinaryOperator(Instruction::Xor, Op, AllOnes,
1835 if (Bop->getOpcode() == Instruction::Sub)
1843 if (Bop->getOpcode() == Instruction::FSub)
1846 IgnoreZeroSign = cast<Instruction>(V)->hasNoSignedZeros();
1854 return (Bop->getOpcode() == Instruction::Xor &&
1877 assert(isNot(BinOp) && "getNotArgument on non-'not' instruction!");
1892 // swapOperands - Exchange the two operands to this instruction. This
1893 // instruction is safe to use on any binary instruction and does not
1894 // modify the semantics of the instruction. If the instruction is
1970 cast<Instruction>(this)->getMetadata(LLVMContext::MD_fpmath);
1988 case Instruction::ZExt:
1989 case Instruction::SExt:
1990 case Instruction::Trunc:
1992 case Instruction::BitCast:
2000 if (getOpcode() != Instruction::BitCast)
2023 bool CastInst::isNoopCast(Instruction::CastOps Opcode,
2029 case Instruction::Trunc:
2030 case Instruction::ZExt:
2031 case Instruction::SExt:
2032 case Instruction::FPTrunc:
2033 case Instruction::FPExt:
2034 case Instruction::UIToFP:
2035 case Instruction::SIToFP:
2036 case Instruction::FPToUI:
2037 case Instruction::FPToSI:
2038 case Instruction::AddrSpaceCast:
2041 case Instruction::BitCast:
2043 case Instruction::PtrToInt:
2046 case Instruction::IntToPtr:
2059 if (getOpcode() == Instruction::PtrToInt)
2061 else if (getOpcode() == Instruction::IntToPtr)
2079 Instruction::CastOps firstOp, Instruction::CastOps secondOp,
2113 Instruction::CastOpsEnd - Instruction::CastOpsBegin;
2137 bool isFirstBitcast = (firstOp == Instruction::BitCast);
2138 bool isSecondBitcast = (secondOp == Instruction::BitCast);
2147 int ElimCase = CastResults[firstOp-Instruction::CastOpsBegin]
2148 [secondOp-Instruction::CastOpsBegin];
2195 return Instruction::BitCast;
2202 return Instruction::BitCast;
2212 return Instruction::BitCast;
2219 return Instruction::ZExt;
2224 return Instruction::BitCast;
2234 return Instruction::BitCast;
2241 return Instruction::AddrSpaceCast;
2242 return Instruction::BitCast;
2261 return Instruction::AddrSpaceCast;
2297 CastInst *CastInst::Create(Instruction::CastOps op, Value *S, Type *Ty,
2298 const Twine &Name, Instruction *InsertBefore) {
2319 CastInst *CastInst::Create(Instruction::CastOps op, Value *S, Type *Ty,
2343 Instruction *InsertBefore) {
2345 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
2346 return Create(Instruction::ZExt, S, Ty, Name, InsertBefore);
2353 return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
2354 return Create(Instruction::ZExt, S, Ty, Name, InsertAtEnd);
2359 Instruction *InsertBefore) {
2361 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
2362 return Create(Instruction::SExt, S, Ty, Name, InsertBefore);
2369 return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
2370 return Create(Instruction::SExt, S, Ty, Name, InsertAtEnd);
2375 Instruction *InsertBefore) {
2377 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
2378 return Create(Instruction::Trunc, S, Ty, Name, InsertBefore);
2385 return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
2386 return Create(Instruction::Trunc, S, Ty, Name, InsertAtEnd);
2401 return Create(Instruction::PtrToInt, S, Ty, Name, InsertAtEnd);
2406 /// @brief Create a BitCast or a PtrToInt cast instruction
2409 Instruction *InsertBefore) {
2419 return Create(Instruction::PtrToInt, S, Ty, Name, InsertBefore);
2432 return Create(Instruction::AddrSpaceCast, S, Ty, Name, InsertAtEnd);
2434 return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
2440 Instruction *InsertBefore) {
2445 return Create(Instruction::AddrSpaceCast, S, Ty, Name, InsertBefore);
2447 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
2452 Instruction *InsertBefore) {
2454 return Create(Instruction::PtrToInt, S, Ty, Name, InsertBefore);
2456 return Create(Instruction::IntToPtr, S, Ty, Name, InsertBefore);
2458 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
2463 Instruction *InsertBefore) {
2468 Instruction::CastOps opcode =
2469 (SrcBits == DstBits ? Instruction::BitCast :
2470 (SrcBits > DstBits ? Instruction::Trunc :
2471 (isSigned ? Instruction::SExt : Instruction::ZExt)));
2482 Instruction::CastOps opcode =
2483 (SrcBits == DstBits ? Instruction::BitCast :
2484 (SrcBits > DstBits ? Instruction::Trunc :
2485 (isSigned ? Instruction::SExt : Instruction::ZExt)));
2491 Instruction *InsertBefore) {
2496 Instruction::CastOps opcode =
2497 (SrcBits == DstBits ? Instruction::BitCast :
2498 (SrcBits > DstBits ? Instruction::FPTrunc : Instruction::FPExt));
2509 Instruction::CastOps opcode =
2510 (SrcBits == DstBits ? Instruction::BitCast :
2511 (SrcBits > DstBits ? Instruction::FPTrunc : Instruction::FPExt));
2631 Instruction::CastOps
2735 CastInst::castIsValid(Instruction::CastOps op, Value *S, Type *DstTy) {
2759 case Instruction::Trunc:
2762 case Instruction::ZExt:
2765 case Instruction::SExt:
2768 case Instruction::FPTrunc:
2771 case Instruction::FPExt:
2774 case Instruction::UIToFP:
2775 case Instruction::SIToFP:
2778 case Instruction::FPToUI:
2779 case Instruction::FPToSI:
2782 case Instruction::PtrToInt:
2790 case Instruction::IntToPtr:
2798 case Instruction::BitCast: {
2826 case Instruction::AddrSpaceCast: {
2851 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2863 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2874 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2886 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2898 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2910 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2922 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2934 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2946 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2958 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2970 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2982 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2994 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
3013 Instruction *InsertBefore)
3014 : Instruction(ty, op,
3027 : Instruction(ty, op,
3040 const Twine &Name, Instruction *InsertBefore) {
3041 if (Op == Instruction::ICmp) {
3061 if (Op == Instruction::ICmp) {
3306 /// SwitchInst ctor - Create a new switch instruction, specifying a value to
3309 /// constructor can also autoinsert before another instruction.
3311 Instruction *InsertBefore)
3312 : TerminatorInst(Type::getVoidTy(Value->getContext()), Instruction::Switch,
3317 /// SwitchInst ctor - Create a new switch instruction, specifying a value to
3323 : TerminatorInst(Type::getVoidTy(Value->getContext()), Instruction::Switch,
3329 : TerminatorInst(SI.getType(), Instruction::Switch, nullptr, 0) {
3345 /// addCase - Add an entry to the switch instruction...
3361 /// from the switch instruction.
3442 Instruction *InsertBefore)
3443 : TerminatorInst(Type::getVoidTy(Address->getContext()),Instruction::IndirectBr,
3450 : TerminatorInst(Type::getVoidTy(Address->getContext()),Instruction::IndirectBr,
3456 : TerminatorInst(Type::getVoidTy(IBI.getContext()), Instruction::IndirectBr,
3482 /// indirectbr instruction.