LLVM API Documentation
#include <Instruction.h>
Inheritance diagram for llvm::Instruction:
Definition at line 29 of file Instruction.h.
Definition at line 338 of file Instruction.h.
Definition at line 505 of file Instruction.h.
Definition at line 672 of file Instruction.h.
Definition at line 171 of file Instruction.h.
Instruction::Instruction | ( | const Type * | Ty, | |
unsigned | iType, | |||
Use * | Ops, | |||
unsigned | NumOps, | |||
const std::string & | Name = "" , |
|||
Instruction * | InsertBefore = 0 | |||
) | [protected] |
Definition at line 21 of file Instruction.cpp.
References llvm::LeakDetector::addGarbageObject(), and llvm::InsertBefore().
Instruction::Instruction | ( | const Type * | Ty, | |
unsigned | iType, | |||
Use * | Ops, | |||
unsigned | NumOps, | |||
const std::string & | Name, | |||
BasicBlock * | InsertAtEnd | |||
) | [protected] |
Definition at line 35 of file Instruction.cpp.
References llvm::LeakDetector::addGarbageObject(), and llvm::BasicBlock::getInstList().
llvm::Instruction::~Instruction | ( | ) | [inline] |
Definition at line 56 of file Instruction.h.
static bool llvm::Instruction::classof | ( | const Value * | V | ) | [inline, static] |
Reimplemented from llvm::User.
Reimplemented in llvm::TerminatorInst, llvm::BinaryOperator, llvm::AllocationInst, llvm::MallocInst, llvm::AllocaInst, llvm::FreeInst, llvm::LoadInst, llvm::StoreInst, llvm::GetElementPtrInst, llvm::SetCondInst, llvm::CastInst, llvm::CallInst, llvm::ShiftInst, llvm::SelectInst, llvm::VAArgInst, llvm::ExtractElementInst, llvm::InsertElementInst, llvm::ShuffleVectorInst, llvm::PHINode, llvm::ReturnInst, llvm::BranchInst, llvm::SwitchInst, llvm::InvokeInst, llvm::UnwindInst, llvm::UnreachableInst, llvm::IntrinsicInst, llvm::DbgInfoIntrinsic, llvm::DbgStopPointInst, llvm::DbgFuncStartInst, llvm::DbgRegionStartInst, llvm::DbgRegionEndInst, llvm::DbgDeclareInst, llvm::MemIntrinsic, llvm::MemCpyInst, llvm::MemMoveInst, llvm::MemSetInst, llvm::TmpInstruction, and llvm::ValueHandle.
Definition at line 164 of file Instruction.h.
References llvm::Value::InstructionVal, and V.
static bool llvm::Instruction::classof | ( | const Instruction * | ) | [inline, static] |
Methods for support type inquiry through isa, cast, and dyn_cast:.
Reimplemented in llvm::TerminatorInst, llvm::BinaryOperator, llvm::AllocationInst, llvm::MallocInst, llvm::AllocaInst, llvm::FreeInst, llvm::LoadInst, llvm::StoreInst, llvm::GetElementPtrInst, llvm::SetCondInst, llvm::CastInst, llvm::CallInst, llvm::ShiftInst, llvm::SelectInst, llvm::VAArgInst, llvm::ExtractElementInst, llvm::InsertElementInst, llvm::ShuffleVectorInst, llvm::PHINode, llvm::ReturnInst, llvm::BranchInst, llvm::SwitchInst, llvm::InvokeInst, llvm::UnwindInst, llvm::UnreachableInst, llvm::TmpInstruction, and llvm::ValueHandle.
Definition at line 163 of file Instruction.h.
virtual Instruction* llvm::Instruction::clone | ( | ) | const [pure virtual] |
clone() - Create a copy of 'this' instruction that is identical in all ways except the following: The instruction has no parent The instruction has no name
Implemented in llvm::TerminatorInst, llvm::BinaryOperator, llvm::AllocationInst, llvm::MallocInst, llvm::AllocaInst, llvm::FreeInst, llvm::LoadInst, llvm::StoreInst, llvm::GetElementPtrInst, llvm::CastInst, llvm::CallInst, llvm::ShiftInst, llvm::SelectInst, llvm::VAArgInst, llvm::ExtractElementInst, llvm::InsertElementInst, llvm::ShuffleVectorInst, llvm::PHINode, llvm::ReturnInst, llvm::BranchInst, llvm::SwitchInst, llvm::InvokeInst, llvm::UnwindInst, llvm::UnreachableInst, llvm::TmpInstruction, and llvm::ValueHandle.
Referenced by HoistThenElseCodeToIf().
void Instruction::eraseFromParent | ( | ) |
eraseFromParent - This method unlinks 'this' from the containing basic block and deletes it.
Definition at line 64 of file Instruction.cpp.
References llvm::BasicBlock::getInstList(), and getParent().
Referenced by BreakUpSubtract(), ConvertShiftToMul(), FoldCondBranchOnPHI(), HoistThenElseCodeToIf(), llvm::DefaultIntrinsicLowering::LowerIntrinsicCall(), LowerNegateToMultiply(), OptimizeGEPExpression(), OptimizeGlobalAddressOfMalloc(), llvm::PHINode::removeIncomingValue(), llvm::BasicBlock::removePredecessor(), ReplaceUsesOfWith(), and llvm::UpgradeIntrinsicCall().
const Instruction* llvm::Instruction::getNext | ( | ) | const [inline] |
Instruction* llvm::Instruction::getNext | ( | ) | [inline] |
Definition at line 84 of file Instruction.h.
References Next.
Referenced by llvm::DecomposeArrayRef().
unsigned llvm::Instruction::getOpcode | ( | ) | const [inline] |
Subclass classification... getOpcode() returns a member of one of the enums that is coming soon (down below)...
Reimplemented in llvm::BinaryOperator, llvm::ShiftInst, and llvm::SelectInst.
Definition at line 108 of file Instruction.h.
References llvm::Value::getValueType(), and llvm::Value::InstructionVal.
Referenced by llvm::CallSite::arg_begin(), AssociativeOpt(), CheapToScalarize(), llvm::ChooseInstructionsForDelaySlots(), llvm::ValueHandle::classof(), llvm::TmpInstruction::classof(), llvm::UnreachableInst::classof(), llvm::UnwindInst::classof(), llvm::InvokeInst::classof(), llvm::SwitchInst::classof(), llvm::BranchInst::classof(), llvm::ReturnInst::classof(), llvm::PHINode::classof(), llvm::ShuffleVectorInst::classof(), llvm::InsertElementInst::classof(), llvm::ExtractElementInst::classof(), llvm::VAArgInst::classof(), llvm::SelectInst::classof(), llvm::ShiftInst::classof(), llvm::CallInst::classof(), llvm::CastInst::classof(), llvm::SetCondInst::classof(), llvm::GetElementPtrInst::classof(), llvm::StoreInst::classof(), llvm::LoadInst::classof(), llvm::FreeInst::classof(), llvm::AllocaInst::classof(), llvm::MallocInst::classof(), llvm::AllocationInst::classof(), llvm::TerminatorInst::classof(), ComputeMaskedBits(), llvm::ConvertExpressionToType(), ConvertOperandToType(), DominatesMergePoint(), llvm::ExpressionConvertibleToType(), GatherConstantSetEQs(), GatherConstantSetNEs(), GatherValueComparisons(), llvm::CallSite::get(), llvm::AliasAnalysis::getModRefInfo(), llvm::SelectInst::getOpcode(), llvm::ShiftInst::getOpcode(), getOpcodeName(), GetSelectFoldableConstant(), GetSelectFoldableOperands(), HoistThenElseCodeToIf(), IdenticalComplexInst(), llvm::InlineFunction(), llvm::InstructionNode::InstructionNode(), isAssociative(), isBinaryOp(), isCommutative(), isIdenticalBinaryInst(), isIdenticalTo(), isRelational(), isTerminator(), isTrapping(), isTrueWhenEqual(), isUnmovableInstruction(), OperandConvertibleToType(), PrintOps(), llvm::RemoveSuccessor(), ShouldTraceValue(), llvm::SimplifyCFG(), llvm::SelectionDAGLowering::visit(), and llvm::Interpreter::visitAllocationInst().
const char * Instruction::getOpcodeName | ( | unsigned | OpCode | ) | [static] |
Definition at line 77 of file Instruction.cpp.
References Alloca, Call, Cast, ExtractElement, InsertElement, Load, Malloc, PHI, Select, Shl, ShuffleVector, Store, and VAArg.
virtual const char* llvm::Instruction::getOpcodeName | ( | ) | const [inline, virtual] |
Reimplemented in llvm::TmpInstruction, and llvm::ValueHandle.
Definition at line 109 of file Instruction.h.
References getOpcode().
Referenced by llvm::InstructionNode::dumpNode(), and llvm::ConstantExpr::getOpcodeName().
BasicBlock* llvm::Instruction::getParent | ( | ) | [inline] |
Definition at line 80 of file Instruction.h.
const BasicBlock* llvm::Instruction::getParent | ( | ) | const [inline] |
Definition at line 79 of file Instruction.h.
Referenced by AssociativeOpt(), llvm::AliasAnalysis::canInstructionRangeModify(), llvm::ConvertExpressionToType(), ConvertOperandToType(), llvm::DecomposeArrayRef(), llvm::DemoteRegToStack(), llvm::MachineCodeForInstruction::destroy(), DominatesMergePoint(), eraseFromParent(), ErasePossiblyDeadInstructionTree(), FoldCondBranchOnPHI(), FoldTwoEntryPHINode(), FoldValueComparisonIntoPredecessors(), llvm::MachineCodeForInstruction::get(), llvm::DSCallSite::getCaller(), llvm::CallSite::getCaller(), getCommonReturnValue(), getConstantEvolvingPHI(), HoistThenElseCodeToIf(), IdenticalComplexInst(), InlineCallIfPossible(), llvm::InlineFunction(), InsertGEPComputeCode(), isDynamicConstant(), isIdenticalBinaryInst(), isIdenticalSelectInst(), isSafeToLoadUnconditionally(), IVUseShouldUsePostIncValue(), LiveAtBBExit(), moveBefore(), llvm::MSchedGraphSB::MSchedGraphSB(), OptimizeGEPExpression(), print(), PrintOps(), RecursiveDelete(), removeFromParent(), llvm::RemoveSuccessor(), ReplaceCallWith(), llvm::ReplaceInstWithInst(), llvm::Inliner::runOnSCC(), SafeToMergeTerminators(), SimplifyEqualityComparisonWithOnlyPredecessor(), llvm::SplitCriticalEdge(), llvm::SCEVExpander::visitAddRecExpr(), and llvm::Interpreter::visitCallSite().
const Instruction* llvm::Instruction::getPrev | ( | ) | const [inline] |
Instruction* llvm::Instruction::getPrev | ( | ) | [inline] |
Definition at line 86 of file Instruction.h.
References Prev.
Referenced by llvm::Interpreter::visitCallSite().
bool Instruction::isAssociative | ( | unsigned | Opcode, | |
const Type * | Ty | |||
) | [static] |
isAssociative - Return true if the instruction is associative:
Associative operators satisfy: x op (y op z) === (x op y) op z)
In LLVM, the Add, Mul, And, Or, and Xor operators are associative, when not applied to floating point types.
Definition at line 166 of file Instruction.cpp.
References llvm::Type::isFloatingPoint().
bool llvm::Instruction::isAssociative | ( | ) | const [inline] |
isAssociative - Return true if the instruction is associative:
Associative operators satisfy: x op (y op z) === (x op y) op z
In LLVM, the Add, Mul, And, Or, and Xor operators are associative, when not applied to floating point types.
Definition at line 133 of file Instruction.h.
References getOpcode(), and llvm::Value::getType().
bool llvm::Instruction::isBinaryOp | ( | ) | const [inline] |
bool Instruction::isCommutative | ( | unsigned | op | ) | [static] |
isCommutative - Return true if the instruction is commutative:
Commutative operators satisfy: (x op y) === (y op x)
In LLVM, these are the associative operators, plus SetEQ and SetNE, when applied to any type.
Definition at line 182 of file Instruction.cpp.
bool llvm::Instruction::isCommutative | ( | ) | const [inline] |
isCommutative - Return true if the instruction is commutative:
Commutative operators satisfy: (x op y) === (y op x)
In LLVM, these are the associative operators, plus SetEQ and SetNE, when applied to any type.
Definition at line 143 of file Instruction.h.
References getOpcode().
Referenced by isIdenticalBinaryInst(), and llvm::BinaryOperator::swapOperands().
bool Instruction::isIdenticalTo | ( | Instruction * | I | ) | const |
isIdenticalTo - Return true if the specified instruction is exactly identical to the current one. This means that all operands match and any extra information (e.g. load is volatile) agree.
Definition at line 136 of file Instruction.cpp.
References llvm::User::getNumOperands(), getOpcode(), llvm::User::getOperand(), llvm::Value::getType(), and LI.
Referenced by HoistThenElseCodeToIf().
bool Instruction::isRelational | ( | unsigned | op | ) | [static] |
isRelational - Return true if the instruction is a Set* instruction:
Definition at line 199 of file Instruction.cpp.
bool llvm::Instruction::isRelational | ( | ) | const [inline] |
isRelational - Return true if the instruction is a Set* instruction:
Definition at line 148 of file Instruction.h.
References getOpcode().
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::ConstantExpr::get(), and llvm::ConstantExpr::getTy().
bool llvm::Instruction::isTerminator | ( | ) | const [inline] |
static bool llvm::Instruction::isTerminator | ( | unsigned | OpCode | ) | [inline, static] |
Definition at line 114 of file Instruction.h.
bool Instruction::isTrapping | ( | unsigned | op | ) | [static] |
isTrappingInstruction - Return true if the instruction may trap.
Definition at line 216 of file Instruction.cpp.
bool llvm::Instruction::isTrapping | ( | ) | const [inline] |
isTrappingInstruction - Return true if the instruction may trap.
Definition at line 154 of file Instruction.h.
References getOpcode().
virtual bool llvm::Instruction::mayWriteToMemory | ( | ) | const [inline, virtual] |
mayWriteToMemory - Return true if this instruction may modify memory.
Reimplemented in llvm::FreeInst, llvm::LoadInst, llvm::StoreInst, llvm::CallInst, llvm::VAArgInst, llvm::ExtractElementInst, llvm::InsertElementInst, llvm::ShuffleVectorInst, and llvm::InvokeInst.
Definition at line 62 of file Instruction.h.
Referenced by llvm::isInstructionTriviallyDead().
void Instruction::moveBefore | ( | Instruction * | MovePos | ) |
moveBefore - Unlink this instruction from its current basic block and insert it into the basic block that MovePos lives in, right before MovePos.
Definition at line 71 of file Instruction.cpp.
References llvm::BasicBlock::getInstList(), and getParent().
Referenced by NegateValue(), and llvm::UpgradeIntrinsicCall().
void Instruction::print | ( | std::ostream & | OS, | |
AssemblyAnnotationWriter * | AAW | |||
) | const |
Definition at line 1303 of file AsmWriter.cpp.
References F, llvm::BasicBlock::getParent(), and getParent().
virtual void llvm::Instruction::print | ( | std::ostream & | OS | ) | const [inline, virtual] |
print - Implement operator<< on Value...
Implements llvm::Value.
Definition at line 159 of file Instruction.h.
void Instruction::removeFromParent | ( | ) |
removeFromParent - This method unlinks 'this' from the containing basic block, but does not delete it.
Definition at line 60 of file Instruction.cpp.
References llvm::BasicBlock::getInstList(), and getParent().
friend class BinaryOperator [friend] |
Definition at line 47 of file Instruction.h.
friend class SymbolTableListTraits< Instruction, BasicBlock, Function,ilist_traits< Instruction > > [friend] |
Definition at line 40 of file Instruction.h.