|
LLVM
3.7.0
|
#include <Instruction.h>
Public Types | |
| enum | OperationEquivalenceFlags { CompareIgnoringAlignment = 1<<0, CompareUsingScalarTypes = 1<<1 } |
| When checking for operation equivalence (using isSameOperationAs) it is sometimes useful to ignore certain attributes. More... | |
| enum | TermOps |
| enum | BinaryOps |
| enum | MemoryOps |
| enum | CastOps |
| enum | OtherOps |
Public Types inherited from llvm::User | |
| typedef Use * | op_iterator |
| typedef const Use * | const_op_iterator |
| typedef iterator_range < op_iterator > | op_range |
| typedef iterator_range < const_op_iterator > | const_op_range |
Public Types inherited from llvm::Value | |
| enum | ValueTy |
| Concrete subclass of this. More... | |
| typedef use_iterator_impl< Use > | use_iterator |
| typedef use_iterator_impl < const Use > | const_use_iterator |
| typedef user_iterator_impl< User > | user_iterator |
| typedef user_iterator_impl < const User > | const_user_iterator |
Public Member Functions | |
| ~Instruction () override | |
| Instruction * | user_back () |
| user_back - Specialize the methods defined in Value, as we know that an instruction can only be used by other instructions. More... | |
| const Instruction * | user_back () const |
| const BasicBlock * | getParent () const |
| BasicBlock * | getParent () |
| const Module * | getModule () const |
| Return the module owning the function this instruction belongs to or nullptr it the function does not have a module. More... | |
| Module * | getModule () |
| void | removeFromParent () |
| removeFromParent - This method unlinks 'this' from the containing basic block, but does not delete it. More... | |
| iplist< Instruction >::iterator | eraseFromParent () |
| eraseFromParent - This method unlinks 'this' from the containing basic block and deletes it. More... | |
| void | insertBefore (Instruction *InsertPos) |
| Insert an unlinked instruction into a basic block immediately before the specified instruction. More... | |
| void | insertAfter (Instruction *InsertPos) |
| Insert an unlinked instruction into a basic block immediately after the specified instruction. More... | |
| void | 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. More... | |
| unsigned | getOpcode () const |
| getOpcode() returns a member of one of the enums like Instruction::Add. More... | |
| const char * | getOpcodeName () const |
| bool | isTerminator () const |
| bool | isBinaryOp () const |
| bool | isShift () |
| bool | isCast () const |
| bool | isLogicalShift () const |
| isLogicalShift - Return true if this is a logical shift left or a logical shift right. More... | |
| bool | isArithmeticShift () const |
| isArithmeticShift - Return true if this is an arithmetic shift right. More... | |
| bool | hasMetadata () const |
| hasMetadata() - Return true if this instruction has any metadata attached to it. More... | |
| bool | hasMetadataOtherThanDebugLoc () const |
| hasMetadataOtherThanDebugLoc - Return true if this instruction has metadata attached to it other than a debug location. More... | |
| MDNode * | getMetadata (unsigned KindID) const |
| getMetadata - Get the metadata of given kind attached to this Instruction. More... | |
| MDNode * | getMetadata (StringRef Kind) const |
| getMetadata - Get the metadata of given kind attached to this Instruction. More... | |
| void | getAllMetadata (SmallVectorImpl< std::pair< unsigned, MDNode * >> &MDs) const |
| getAllMetadata - Get all metadata attached to this Instruction. More... | |
| void | getAllMetadataOtherThanDebugLoc (SmallVectorImpl< std::pair< unsigned, MDNode * >> &MDs) const |
| getAllMetadataOtherThanDebugLoc - This does the same thing as getAllMetadata, except that it filters out the debug location. More... | |
| void | getAAMetadata (AAMDNodes &N, bool Merge=false) const |
| getAAMetadata - Fills the AAMDNodes structure with AA metadata from this instruction. More... | |
| void | setMetadata (unsigned KindID, MDNode *Node) |
| setMetadata - Set the metadata of the specified kind to the specified node. More... | |
| void | setMetadata (StringRef Kind, MDNode *Node) |
| void | dropUnknownMetadata (ArrayRef< unsigned > KnownIDs) |
| Drop unknown metadata. More... | |
| void | dropUnknownMetadata () |
| void | dropUnknownMetadata (unsigned ID1) |
| void | dropUnknownMetadata (unsigned ID1, unsigned ID2) |
| void | setAAMetadata (const AAMDNodes &N) |
| setAAMetadata - Sets the metadata on this instruction from the AAMDNodes structure. More... | |
| void | setDebugLoc (DebugLoc Loc) |
| setDebugLoc - Set the debug location information for this instruction. More... | |
| const DebugLoc & | getDebugLoc () const |
| getDebugLoc - Return the debug location for this node as a DebugLoc. More... | |
| void | setHasUnsafeAlgebra (bool B) |
| Set or clear the unsafe-algebra flag on this instruction, which must be an operator which supports this flag. More... | |
| void | setHasNoNaNs (bool B) |
| Set or clear the no-nans flag on this instruction, which must be an operator which supports this flag. More... | |
| void | setHasNoInfs (bool B) |
| Set or clear the no-infs flag on this instruction, which must be an operator which supports this flag. More... | |
| void | setHasNoSignedZeros (bool B) |
| Set or clear the no-signed-zeros flag on this instruction, which must be an operator which supports this flag. More... | |
| void | setHasAllowReciprocal (bool B) |
| Set or clear the allow-reciprocal flag on this instruction, which must be an operator which supports this flag. More... | |
| void | setFastMathFlags (FastMathFlags FMF) |
| Convenience function for setting multiple fast-math flags on this instruction, which must be an operator which supports these flags. More... | |
| void | copyFastMathFlags (FastMathFlags FMF) |
| Convenience function for transferring all fast-math flag values to this instruction, which must be an operator which supports these flags. More... | |
| bool | hasUnsafeAlgebra () const |
| Determine whether the unsafe-algebra flag is set. More... | |
| bool | hasNoNaNs () const |
| Determine whether the no-NaNs flag is set. More... | |
| bool | hasNoInfs () const |
| Determine whether the no-infs flag is set. More... | |
| bool | hasNoSignedZeros () const |
| Determine whether the no-signed-zeros flag is set. More... | |
| bool | hasAllowReciprocal () const |
| Determine whether the allow-reciprocal flag is set. More... | |
| FastMathFlags | getFastMathFlags () const |
| Convenience function for getting all the fast-math flags, which must be an operator which supports these flags. More... | |
| void | copyFastMathFlags (const Instruction *I) |
| Copy I's fast-math flags. More... | |
| bool | isAssociative () const |
| isAssociative - Return true if the instruction is associative: More... | |
| bool | isCommutative () const |
| isCommutative - Return true if the instruction is commutative: More... | |
| bool | isIdempotent () const |
| isIdempotent - Return true if the instruction is idempotent: More... | |
| bool | isNilpotent () const |
| isNilpotent - Return true if the instruction is nilpotent: More... | |
| bool | mayWriteToMemory () const |
| mayWriteToMemory - Return true if this instruction may modify memory. More... | |
| bool | mayReadFromMemory () const |
| mayReadFromMemory - Return true if this instruction may read memory. More... | |
| bool | mayReadOrWriteMemory () const |
| mayReadOrWriteMemory - Return true if this instruction may read or write memory. More... | |
| bool | isAtomic () const |
| isAtomic - Return true if this instruction has an AtomicOrdering of unordered or higher. More... | |
| bool | mayThrow () const |
| mayThrow - Return true if this instruction may throw an exception. More... | |
| bool | mayReturn () const |
| mayReturn - Return true if this is a function that may return. More... | |
| bool | mayHaveSideEffects () const |
| mayHaveSideEffects - Return true if the instruction may have side effects. More... | |
| Instruction * | clone () const |
| clone() - Create a copy of 'this' instruction that is identical in all ways except the following: More... | |
| bool | isIdenticalTo (const Instruction *I) const |
| isIdenticalTo - Return true if the specified instruction is exactly identical to the current one. More... | |
| bool | isIdenticalToWhenDefined (const Instruction *I) const |
| isIdenticalToWhenDefined - This is like isIdenticalTo, except that it ignores the SubclassOptionalData flags, which specify conditions under which the instruction's result is undefined. More... | |
| bool | isSameOperationAs (const Instruction *I, unsigned flags=0) const |
| This function determines if the specified instruction executes the same operation as the current one. More... | |
| bool | isUsedOutsideOfBlock (const BasicBlock *BB) const |
| isUsedOutsideOfBlock - Return true if there are any uses of this instruction in blocks other than the specified block. More... | |
Public Member Functions inherited from llvm::User | |
| ~User () override | |
| void | operator delete (void *Usr) |
| Free memory allocated for User and Use objects. More... | |
| void | operator delete (void *, unsigned) |
| Placement delete - required by std, but never called. More... | |
| void | operator delete (void *, unsigned, bool) |
| Placement delete - required by std, but never called. More... | |
| Use * | getOperandList () |
| const Use * | getOperandList () const |
| Value * | getOperand (unsigned i) const |
| void | setOperand (unsigned i, Value *Val) |
| const Use & | getOperandUse (unsigned i) const |
| Use & | getOperandUse (unsigned i) |
| unsigned | getNumOperands () const |
| void | setGlobalVariableNumOperands (unsigned NumOps) |
| Set the number of operands on a GlobalVariable. More... | |
| void | setFunctionNumOperands (unsigned NumOps) |
| Set the number of operands on a Function. More... | |
| void | setNumHungOffUseOperands (unsigned NumOps) |
| Subclasses with hung off uses need to manage the operand count themselves. More... | |
| op_iterator | op_begin () |
| const_op_iterator | op_begin () const |
| op_iterator | op_end () |
| const_op_iterator | op_end () const |
| op_range | operands () |
| const_op_range | operands () const |
| value_op_iterator | value_op_begin () |
| value_op_iterator | value_op_end () |
| iterator_range< value_op_iterator > | operand_values () |
| void | dropAllReferences () |
| Drop all references to operands. More... | |
| void | replaceUsesOfWith (Value *From, Value *To) |
| Replace uses of one Value with another. More... | |
Public Member Functions inherited from llvm::Value | |
| virtual | ~Value () |
| void | dump () const |
| Support for debugging, callable in GDB: V->dump() More... | |
| Type * | getType () const |
| All values are typed, get the type of this value. More... | |
| LLVMContext & | getContext () const |
| All values hold a context through their type. More... | |
| bool | hasName () const |
| ValueName * | getValueName () const |
| void | setValueName (ValueName *VN) |
| StringRef | getName () const |
| Return a constant reference to the value's name. More... | |
| void | setName (const Twine &Name) |
| Change the name of the value. More... | |
| void | takeName (Value *V) |
| Transfer the name from V to this value. More... | |
| void | replaceAllUsesWith (Value *V) |
| Change all uses of this to point to a new Value. More... | |
| void | replaceUsesOutsideBlock (Value *V, BasicBlock *BB) |
| replaceUsesOutsideBlock - Go through the uses list for this definition and make each use point to "V" instead of "this" when the use is outside the block. More... | |
| bool | use_empty () const |
| use_iterator | use_begin () |
| const_use_iterator | use_begin () const |
| use_iterator | use_end () |
| const_use_iterator | use_end () const |
| iterator_range< use_iterator > | uses () |
| iterator_range < const_use_iterator > | uses () const |
| bool | user_empty () const |
| user_iterator | user_begin () |
| const_user_iterator | user_begin () const |
| user_iterator | user_end () |
| const_user_iterator | user_end () const |
| User * | user_back () |
| const User * | user_back () const |
| iterator_range< user_iterator > | users () |
| iterator_range < const_user_iterator > | users () const |
| bool | hasOneUse () const |
| Return true if there is exactly one user of this value. More... | |
| bool | hasNUses (unsigned N) const |
| Return true if this Value has exactly N users. More... | |
| bool | hasNUsesOrMore (unsigned N) const |
| Return true if this value has N users or more. More... | |
| bool | isUsedInBasicBlock (const BasicBlock *BB) const |
| Check if this value is used in the specified basic block. More... | |
| unsigned | getNumUses () const |
| This method computes the number of uses of this Value. More... | |
| void | addUse (Use &U) |
| This method should only be used by the Use class. More... | |
| unsigned | getValueID () const |
| Return an ID for the concrete type of this object. More... | |
| unsigned | getRawSubclassOptionalData () const |
| Return the raw optional flags value contained in this value. More... | |
| void | clearSubclassOptionalData () |
| Clear the optional flags contained in this value. More... | |
| bool | hasSameSubclassOptionalData (const Value *V) const |
| Check the optional flags for equality. More... | |
| void | intersectOptionalDataWith (const Value *V) |
| Clear any optional flags not set in the given Value. More... | |
| bool | hasValueHandle () const |
| Return true if there is a value handle associated with this value. More... | |
| bool | isUsedByMetadata () const |
| Return true if there is metadata referencing this value. More... | |
| Value * | stripPointerCasts () |
| Strip off pointer casts, all-zero GEPs, and aliases. More... | |
| const Value * | stripPointerCasts () const |
| Value * | stripPointerCastsNoFollowAliases () |
| Strip off pointer casts and all-zero GEPs. More... | |
| const Value * | stripPointerCastsNoFollowAliases () const |
| Value * | stripInBoundsConstantOffsets () |
| Strip off pointer casts and all-constant inbounds GEPs. More... | |
| const Value * | stripInBoundsConstantOffsets () const |
| Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) |
| Accumulate offsets from stripInBoundsConstantOffsets(). More... | |
| const Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) const |
| Value * | stripInBoundsOffsets () |
| Strip off pointer casts and inbounds GEPs. More... | |
| const Value * | stripInBoundsOffsets () const |
| Value * | DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) |
| Translate PHI node to its predecessor from the given basic block. More... | |
| const Value * | DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) const |
| void | mutateType (Type *Ty) |
| Mutate the type of this Value to be of the specified type. More... | |
| template<class Compare > | |
| void | sortUseList (Compare Cmp) |
| Sort the use-list. More... | |
| void | reverseUseList () |
| Reverse the use-list. More... | |
| void | print (raw_ostream &O) const |
| Implement operator<< on Value. More... | |
| void | print (raw_ostream &O, ModuleSlotTracker &MST) const |
| void | printAsOperand (raw_ostream &O, bool PrintType=true, const Module *M=nullptr) const |
| Print the name of this Value out to the specified raw_ostream. More... | |
| void | printAsOperand (raw_ostream &O, bool PrintType, ModuleSlotTracker &MST) const |
Public Member Functions inherited from llvm::ilist_node< Instruction > | |
| Instruction * | getPrevNode () |
| Get the previous node, or 0 for the list head. More... | |
| const Instruction * | getPrevNode () const |
| Get the previous node, or 0 for the list head. More... | |
| Instruction * | getNextNode () |
| Get the next node, or 0 for the list tail. More... | |
| const Instruction * | getNextNode () const |
| Get the next node, or 0 for the list tail. More... | |
Static Public Member Functions | |
| static const char * | getOpcodeName (unsigned OpCode) |
| static bool | isTerminator (unsigned OpCode) |
| static bool | isBinaryOp (unsigned Opcode) |
| static bool | isShift (unsigned Opcode) |
| Determine if the Opcode is one of the shift instructions. More... | |
| static bool | isCast (unsigned OpCode) |
| Determine if the OpCode is one of the CastInst instructions. More... | |
| static bool | isAssociative (unsigned op) |
| isAssociative - Return true if the instruction is associative: More... | |
| static bool | isCommutative (unsigned op) |
| isCommutative - Return true if the instruction is commutative: More... | |
| static bool | isIdempotent (unsigned op) |
| isIdempotent - Return true if the instruction is idempotent: More... | |
| static bool | isNilpotent (unsigned op) |
| isNilpotent - Return true if the instruction is nilpotent: More... | |
| static bool | classof (const Value *V) |
| Methods for support type inquiry through isa, cast, and dyn_cast: More... | |
Static Public Member Functions inherited from llvm::User | |
| static bool | classof (const Value *V) |
Protected Member Functions | |
| void | setInstructionSubclassData (unsigned short D) |
| unsigned | getSubclassDataFromInstruction () const |
| Instruction (Type *Ty, unsigned iType, Use *Ops, unsigned NumOps, Instruction *InsertBefore=nullptr) | |
| Instruction (Type *Ty, unsigned iType, Use *Ops, unsigned NumOps, BasicBlock *InsertAtEnd) | |
Protected Member Functions inherited from llvm::User | |
| void * | operator new (size_t Size) |
| Allocate a User with an operand pointer co-allocated. More... | |
| void * | operator new (size_t Size, unsigned Us) |
| Allocate a User with the operands co-allocated. More... | |
| User (Type *ty, unsigned vty, Use *OpList, unsigned NumOps) | |
| void | allocHungoffUses (unsigned N, bool IsPhi=false) |
| Allocate the array of Uses, followed by a pointer (with bottom bit set) to the User. More... | |
| void | growHungoffUses (unsigned N, bool IsPhi=false) |
| Grow the number of hung off uses. More... | |
| template<int Idx> | |
| Use & | Op () |
| template<int Idx> | |
| const Use & | Op () const |
Protected Member Functions inherited from llvm::Value | |
| Value (Type *Ty, unsigned scid) | |
| unsigned short | getSubclassDataFromValue () const |
| void | setValueSubclassData (unsigned short D) |
Protected Member Functions inherited from llvm::ilist_node< Instruction > | |
| ilist_node () | |
Friends | |
| class | SymbolTableListTraits< Instruction, BasicBlock > |
Additional Inherited Members | |
Static Public Attributes inherited from llvm::Value | |
| static const unsigned | MaxAlignmentExponent = 29 |
| The maximum alignment for instructions. More... | |
| static const unsigned | MaximumAlignment = 1u << MaxAlignmentExponent |
Protected Types inherited from llvm::Value | |
| enum | : unsigned { NumUserOperandsBits = 29 } |
| The number of operands in the subclass. More... | |
Static Protected Member Functions inherited from llvm::User | |
| template<int Idx, typename U > | |
| static Use & | OpFrom (const U *that) |
Protected Attributes inherited from llvm::Value | |
| unsigned char | SubclassOptionalData: 7 |
| Hold subclass data that can be dropped. More... | |
| unsigned | NumUserOperands: NumUserOperandsBits |
| bool | IsUsedByMD: 1 |
| bool | HasName: 1 |
| bool | HasHungOffUses: 1 |
Definition at line 51 of file Instruction.h.
Definition at line 450 of file Instruction.h.
Definition at line 464 of file Instruction.h.
Definition at line 457 of file Instruction.h.
When checking for operation equivalence (using isSameOperationAs) it is sometimes useful to ignore certain attributes.
| Enumerator | |
|---|---|
| CompareIgnoringAlignment |
Check for equivalence ignoring load/store alignment. |
| CompareUsingScalarTypes |
Check for equivalence treating a type and a vector of that type as equivalent. |
Definition at line 410 of file Instruction.h.
Definition at line 471 of file Instruction.h.
Definition at line 443 of file Instruction.h.
|
override |
Definition at line 46 of file Instruction.cpp.
|
protected |
Definition at line 23 of file Instruction.cpp.
References llvm::BasicBlock::getInstList(), getParent(), and llvm::iplist< NodeTy, Traits >::insert().
|
protected |
Definition at line 35 of file Instruction.cpp.
References llvm::BasicBlock::getInstList(), and llvm::iplist< NodeTy, Traits >::push_back().
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition at line 436 of file Instruction.h.
References llvm::Value::getValueID().
| Instruction * Instruction::clone | ( | ) | const |
clone() - Create a copy of 'this' instruction that is identical in all ways except the following:
Definition at line 541 of file Instruction.cpp.
References getAllMetadataOtherThanDebugLoc(), getDebugLoc(), getOpcode(), hasMetadata(), llvm_unreachable, setDebugLoc(), setMetadata(), and llvm::Value::SubclassOptionalData.
Referenced by llvm::CloneBasicBlock(), CloneInstructionInExitBlock(), llvm::FoldBranchToCommonDest(), llvm::FoldReturnIntoUncondBranch(), HoistThenElseCodeToIf(), rematerializeLiveValues(), replaceGEPIdxWithZero(), llvm::SplitLandingPadPredecessors(), and llvm::InstCombiner::visitGetElementPtrInst().
| void Instruction::copyFastMathFlags | ( | FastMathFlags | FMF | ) |
Convenience function for transferring all fast-math flag values to this instruction, which must be an operator which supports these flags.
See LangRef.html for the meaning of these flags.
Definition at line 140 of file Instruction.cpp.
Referenced by llvm::BinaryOperator::andIRFlags(), copyFastMathFlags(), llvm::BinaryOperator::copyIRFlags(), FoldOperationIntoSelectOperand(), llvm::InstCombiner::visitFAdd(), llvm::InstCombiner::visitFMul(), llvm::InstCombiner::visitFPTrunc(), and llvm::InstCombiner::visitFSub().
| void Instruction::copyFastMathFlags | ( | const Instruction * | I | ) |
Copy I's fast-math flags.
Definition at line 184 of file Instruction.cpp.
References copyFastMathFlags(), and getFastMathFlags().
Drop unknown metadata.
Passes are required to drop metadata they don't understand. This is a convenience method for passes to do so.
Definition at line 1048 of file Metadata.cpp.
References llvm::ArrayRef< T >::begin(), llvm::SmallSet< T, N, C >::count(), llvm::SmallSet< T, N, C >::empty(), llvm::ArrayRef< T >::end(), llvm::SmallSet< T, N, C >::erase(), llvm::Value::getContext(), I, llvm::SmallSet< T, N, C >::insert(), llvm::LLVMContextImpl::InstructionMetadata, llvm::LLVMContext::MD_dbg, and llvm::LLVMContext::pImpl.
Referenced by llvm::combineMetadata(), and llvm::FoldBranchToCommonDest().
|
inline |
Definition at line 211 of file Instruction.h.
References llvm::None.
Referenced by dropUnknownMetadata().
|
inline |
Definition at line 214 of file Instruction.h.
References dropUnknownMetadata(), and llvm::makeArrayRef().
Definition at line 217 of file Instruction.h.
References dropUnknownMetadata().
| iplist< Instruction >::iterator Instruction::eraseFromParent | ( | ) |
eraseFromParent - This method unlinks 'this' from the containing basic block and deletes it.
Definition at line 70 of file Instruction.cpp.
References llvm::iplist< NodeTy, Traits >::erase(), llvm::BasicBlock::getInstList(), and getParent().
Referenced by AddReachableCodeToWorklist(), BuildSubAggregate(), changeToCall(), checkCSEInPredecessor(), CleanupPointerRootUsers(), llvm::CloneAndPruneIntoFromInst(), CombineUAddWithOverflow(), ConnectProlog(), llvm::ConstantFoldTerminator(), cse(), DeleteDeadInstruction(), deleteDeadInstruction(), DeleteTriviallyDeadInstructions(), llvm::DemotePHIToStack(), llvm::DemoteRegToStack(), llvm::EliminateDuplicatePHINodes(), llvm::InstCombiner::EraseInstFromFunction(), llvm::objcarc::EraseInstruction(), EraseTerminatorInstAndDCECond(), llvm::expandDivision(), llvm::expandDivisionUpTo32Bits(), llvm::expandDivisionUpTo64Bits(), llvm::expandRemainder(), llvm::expandRemainderUpTo32Bits(), llvm::expandRemainderUpTo64Bits(), findPHIToPartitionLoops(), llvm::FoldReturnIntoUncondBranch(), FoldTwoEntryPHINode(), generateUnsignedDivisionCode(), getAdjustedPtr(), llvm::SSAUpdater::GetValueInMiddleOfBlock(), llvm::hoistRegion(), INITIALIZE_PASS(), InlineCallIfPossible(), llvm::InlineFunction(), insertFastDiv(), LowerAtomicCmpXchgInst(), LowerAtomicRMWInst(), llvm::LowerDbgDeclare(), lowerExpectIntrinsic(), LowerFenceInst(), llvm::IntrinsicLowering::LowerIntrinsicCall(), llvm::IntrinsicLowering::LowerToByteSwap(), makeStatepointExplicit(), markAliveBlocks(), llvm::MergeBasicBlockIntoOnlyPred(), mergeEmptyReturnBlocks(), llvm::LibCallSimplifier::optimizeCall(), OptimizeExtractBits(), OptimizeGlobalAddressOfMalloc(), PerformHeapAllocSRoA(), llvm::PHITransAddr::PHITranslateWithInsertion(), prepareICWorklistFromFunction(), llvm::promoteLoopAccessesToScalars(), promoteSingleBlockAlloca(), llvm::RecursivelyDeleteTriviallyDeadInstructions(), llvm::PHINode::removeIncomingValue(), removeLifetimeIntrinsicUsers(), llvm::BasicBlock::removePredecessor(), RemoveSwitchAfterSelectConversion(), removeUndefIntroducingPredecessor(), replaceAndRecursivelySimplifyImpl(), llvm::replaceDbgDeclareForAlloca(), ReplaceUsesOfMallocWithGlobal(), ReplaceUsesOfWith(), reuseOrInsertFastDiv(), rewriteSingleStoreAlloca(), RewriteUsesOfLoadForHeapSRoA(), llvm::Inliner::runOnSCC(), ScalarizeMaskedLoad(), ScalarizeMaskedStore(), SimplifyBranchOnICmpChain(), simplifyOneLoop(), sink(), SinkCast(), SinkCmpExpression(), llvm::sinkRegion(), SinkThenElseCodeToEnd(), speculatePHINodeLoads(), speculateSelectInstLoads(), llvm::SplitLandingPadPredecessors(), llvm::StripDebugInfo(), SwitchToLookupTable(), tryPromoteAllocaToVector(), tryToMakeAllocaBePromotable(), TryToMergeLandingPad(), TryToOptimizeStoreOfMallocToGlobal(), TryToShrinkGlobalToBoolean(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), TryToSimplifyUncondBranchWithICmpInIt(), TurnSwitchRangeIntoICmp(), llvm::UnrollLoop(), llvm::UnrollRuntimeLoopProlog(), llvm::UpgradeIntrinsicCall(), llvm::LoopVersioning::versionLoop(), and llvm::ObjectSizeOffsetEvaluator::visitPHINode().
getAAMetadata - Fills the AAMDNodes structure with AA metadata from this instruction.
When Merge is true, the existing AA metadata is merged with that from this instruction providing the most-general result.
Definition at line 627 of file TypeBasedAliasAnalysis.cpp.
References getMetadata(), llvm::MDNode::getMostGenericAliasScope(), llvm::MDNode::getMostGenericTBAA(), llvm::MDNode::intersect(), llvm::LLVMContext::MD_alias_scope, llvm::LLVMContext::MD_noalias, llvm::LLVMContext::MD_tbaa, llvm::AAMDNodes::NoAlias, llvm::AAMDNodes::Scope, and llvm::AAMDNodes::TBAA.
Referenced by llvm::AliasSetTracker::add(), llvm::FastISel::createMachineMemOperandFor(), llvm::MemoryLocation::get(), llvm::MemoryLocation::getForDest(), llvm::MemoryLocation::getForSource(), llvm::promoteLoopAccessesToScalars(), llvm::AliasSetTracker::remove(), speculatePHINodeLoads(), speculateSelectInstLoads(), and tryToMakeAllocaBePromotable().
|
inline |
getAllMetadata - Get all metadata attached to this Instruction.
The first element of each pair returned is the KindID, the second element is the metadata value. This list is returned sorted by the KindID.
Definition at line 183 of file Instruction.h.
References hasMetadata().
Referenced by combineLoadToNewType(), combineStoreToNewValue(), copyMetadata(), and llvm::RemapInstruction().
|
inline |
getAllMetadataOtherThanDebugLoc - This does the same thing as getAllMetadata, except that it filters out the debug location.
Definition at line 190 of file Instruction.h.
References hasMetadataOtherThanDebugLoc().
Referenced by clone(), llvm::combineMetadata(), and llvm::TypeFinder::run().
getDebugLoc - Return the debug location for this node as a DebugLoc.
Definition at line 230 of file Instruction.h.
Referenced by changeToCall(), changeToUnreachable(), clone(), llvm::ConvertDebugDeclareToDebugValue(), ConvertShiftToMul(), createAndInstr(), emitAnalysis(), fixupLineNumbers(), llvm::SelectionDAGBuilder::getCurDebugLoc(), llvm::SDLoc::getDebugLoc(), GetLoadValueForLoad(), llvm::Loop::getStartLoc(), HandleCallsInBlockInlinedThroughInvoke(), llvm::InlineFunction(), llvm::InstCombiner::InsertNewInstWith(), llvm::LowerDbgDeclare(), makeStatepointExplicitImpl(), llvm::SCEVExpander::replaceCongruentIVs(), llvm::replaceDbgDeclareForAlloca(), llvm::ReplaceInstWithInst(), ReplaceWithStatepoint(), llvm::InstCombiner::run(), llvm::Inliner::runOnSCC(), ScalarizeMaskedLoad(), ScalarizeMaskedStore(), llvm::FastISel::selectInstruction(), llvm::FastISel::selectOperator(), llvm::FunctionLoweringInfo::set(), llvm::IRBuilderBase::SetInsertPoint(), SimplifyTerminatorOnSelect(), llvm::SplitBlockAndInsertIfThen(), llvm::SplitBlockAndInsertIfThenElse(), llvm::SplitBlockPredecessors(), llvm::SplitCriticalEdge(), llvm::SplitLandingPadPredecessors(), TryToSimplifyUncondBranchWithICmpInIt(), llvm::InstCombiner::visitFDiv(), and llvm::InstCombiner::visitXor().
| FastMathFlags Instruction::getFastMathFlags | ( | ) | const |
Convenience function for getting all the fast-math flags, which must be an operator which supports these flags.
See LangRef.html for the meaning of these flags.
Definition at line 178 of file Instruction.cpp.
Referenced by llvm::BinaryOperator::andIRFlags(), ClearSubclassDataAfterReassociation(), copyFastMathFlags(), llvm::SimplifyInstruction(), llvm::InstCombiner::visitFAdd(), llvm::InstCombiner::visitFCmpInst(), llvm::InstCombiner::visitFDiv(), llvm::InstCombiner::visitFMul(), llvm::InstCombiner::visitFRem(), and llvm::InstCombiner::visitFSub().
getMetadata - Get the metadata of given kind attached to this Instruction.
If the metadata is not found then return null.
Definition at line 167 of file Instruction.h.
References hasMetadata().
Referenced by AddAliasScopeMetadata(), CloneAliasScopeMetadata(), llvm::combineMetadata(), llvm::FastISel::createMachineMemOperandFor(), llvm::DiagnosticInfoInlineAsm::DiagnosticInfoInlineAsm(), ExtractBranchMetadata(), getAAMetadata(), llvm::getAlign(), GetBranchWeights(), llvm::Loop::getLoopID(), llvm::MemoryDependenceAnalysis::getPointerDependencyFrom(), GetRangeFromMetadata(), llvm::DbgDeclareInst::getRawExpression(), llvm::DbgValueInst::getRawExpression(), llvm::DbgDeclareInst::getRawVariable(), llvm::DbgValueInst::getRawVariable(), HasBranchWeights(), llvm::objcarc::BottomUpPtrState::InitBottomUp(), isVtableAccess(), llvm::objcarc::TopDownPtrState::MatchWithRelease(), llvm::BranchInst::swapSuccessors(), and llvm::UpgradeInstWithTBAATag().
getMetadata - Get the metadata of given kind attached to this Instruction.
If the metadata is not found then return null.
Definition at line 174 of file Instruction.h.
References hasMetadata().
Return the module owning the function this instruction belongs to or nullptr it the function does not have a module.
Note: this is undefined behavior if the instruction does not have a parent, or the parent basic block does not have a parent function.
Definition at line 57 of file Instruction.cpp.
References llvm::BasicBlock::getModule(), and getParent().
Referenced by llvm::IVUsers::AddUsersImpl(), AnalyzeLoadFromClobberingStore(), llvm::objcarc::CanAlterRefCount(), llvm::objcarc::CanUse(), llvm::MemoryLocation::get(), llvm::getGEPInductionOperand(), llvm::MemoryDependenceAnalysis::getLoadLoadClobberFullWidthSize(), GetLoadValueForLoad(), llvm::LazyValueInfo::getPredicateAt(), llvm::AArch64TargetLowering::getTgtMemIntrinsic(), llvm::NVPTXTargetLowering::getTgtMemIntrinsic(), llvm::hoistRegion(), InsertSafepointPoll(), llvm::isInductionPHI(), isLoadLoadClobberIfExtendedToFullWidth(), llvm::AArch64TargetLowering::isProfitableToHoist(), isSafePHIToSpeculate(), isSafeSelectToSpeculate(), llvm::isSafeToLoadUnconditionally(), llvm::isSafeToSpeculativelyExecute(), llvm::AArch64TargetLowering::lowerInterleavedLoad(), llvm::ARMTargetLowering::lowerInterleavedLoad(), llvm::AArch64TargetLowering::lowerInterleavedStore(), llvm::ARMTargetLowering::lowerInterleavedStore(), replaceAndRecursivelySimplifyImpl(), and visitIVCast().
| Module * Instruction::getModule | ( | ) |
Definition at line 61 of file Instruction.cpp.
References llvm::BasicBlock::getModule(), and getParent().
|
inline |
getOpcode() returns a member of one of the enums like Instruction::Add.
Definition at line 112 of file Instruction.h.
References llvm::Value::getValueID().
Referenced by BuildNew(), CanEvaluateSExtd(), CanEvaluateShifted(), CanEvaluateShuffled(), CanEvaluateTruncated(), CanEvaluateZExtd(), CanPHITrans(), canVectorizeInst(), CheapToScalarize(), llvm::OverflowingBinaryOperator::classof(), llvm::UnaryInstruction::classof(), llvm::PossiblyExactOperator::classof(), llvm::AllocaInst::classof(), llvm::LoadInst::classof(), llvm::FPMathOperator::classof(), llvm::ConcreteOperator< Operator, Instruction::PtrToInt >::classof(), llvm::StoreInst::classof(), llvm::FenceInst::classof(), llvm::AtomicCmpXchgInst::classof(), llvm::AtomicRMWInst::classof(), llvm::CmpInst::classof(), llvm::GetElementPtrInst::classof(), llvm::ICmpInst::classof(), llvm::FCmpInst::classof(), llvm::CallInst::classof(), llvm::SelectInst::classof(), llvm::VAArgInst::classof(), llvm::ExtractElementInst::classof(), llvm::InsertElementInst::classof(), llvm::ShuffleVectorInst::classof(), llvm::ExtractValueInst::classof(), llvm::InsertValueInst::classof(), llvm::PHINode::classof(), llvm::LandingPadInst::classof(), llvm::ReturnInst::classof(), llvm::BranchInst::classof(), llvm::SwitchInst::classof(), llvm::IndirectBrInst::classof(), llvm::InvokeInst::classof(), llvm::ResumeInst::classof(), llvm::UnreachableInst::classof(), llvm::TruncInst::classof(), llvm::ZExtInst::classof(), llvm::SExtInst::classof(), llvm::FPTruncInst::classof(), llvm::FPExtInst::classof(), llvm::UIToFPInst::classof(), llvm::SIToFPInst::classof(), llvm::FPToUIInst::classof(), llvm::FPToSIInst::classof(), llvm::IntToPtrInst::classof(), llvm::PtrToIntInst::classof(), llvm::BitCastInst::classof(), llvm::AddrSpaceCastInst::classof(), clone(), CollectBSwapParts(), collectFailStats(), CollectInsertionElements(), collectUsesWithPtrTypes(), ConstantFold(), llvm::ConstantFoldInstruction(), detectLog2OfHalf(), determinePointerReadAttrs(), EvaluateExpression(), llvm::SelectionDAGBuilder::FindMergedConditions(), llvm::InstCombiner::foldFMulConst(), FoldOperationIntoSelectOperand(), llvm::InstCombiner::FoldSelectOpOp(), llvm::SCEVExpander::getIVIncOperand(), getLoopPhiForCounter(), llvm::AliasAnalysis::getModRefInfo(), llvm::BinaryOperator::getOpcode(), llvm::CastInst::getOpcode(), llvm::CmpInst::getOpcode(), llvm::SelectInst::getOpcode(), getOpcodeName(), GetSelectFoldableConstant(), GetSelectFoldableOperands(), GetShiftedValue(), llvm::FastISel::hasTrivialKill(), haveSameSpecialState(), llvm::InlineFunction(), isAllocSiteRemovable(), isArithmeticShift(), isAssociative(), isAtomic(), isBinaryOp(), isCast(), isCommutative(), llvm::TargetLoweringBase::isExtFree(), isExtractBitsCandidateUse(), isFMulOrFDivWithConstant(), isHighCostExpansion(), isIdempotent(), isIdenticalToWhenDefined(), isLogicalShift(), isNilpotent(), isPotentiallyNaryReassociable(), llvm::AArch64TargetLowering::isProfitableToHoist(), llvm::RecurrenceDescriptor::isRecurrenceInstr(), isSameOperationAs(), isShift(), isSimpleArithmeticOp(), isTerminator(), isUnmovableInstruction(), LookThroughFPExtensions(), mayReadFromMemory(), mayWriteToMemory(), needsFP(), llvm::PointerMayBeCaptured(), PrintOps(), llvm::FastISel::selectInstruction(), SimplifyBranchOnICmpChain(), llvm::SimplifyInstruction(), SinkShiftAndTruncate(), llvm::InstCombiner::SliceUpIllegalIntegerPHI(), ThreadBinOpOverSelect(), tryPromoteAllocaToVector(), llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >::visit(), llvm::SelectionDAGBuilder::visit(), llvm::Interpreter::visitAllocaInst(), llvm::InstCombiner::visitFMul(), llvm::InstCombiner::visitICmpInstWithInstAndIntCst(), llvm::InstCombiner::visitSwitchInst(), and WriteInstruction().
|
inline |
Definition at line 114 of file Instruction.h.
References getOpcode(), and getOpcodeName().
Referenced by getOpcodeName(), llvm::ConstantExpr::getOpcodeName(), and PrintOps().
Definition at line 189 of file Instruction.cpp.
References llvm::APIntOps::And(), llvm::Call, ExtractElement(), llvm::SPII::Load, llvm::APIntOps::Or(), llvm::TargetOpcode::PHI, llvm::MipsISD::Ret, llvm::MCID::Select, llvm::SPII::Store, and llvm::APIntOps::Xor().
|
inline |
Definition at line 72 of file Instruction.h.
Referenced by AddAlignmentAssumptions(), llvm::AddLandingPadInfo(), llvm::RecurrenceDescriptor::AddReductionVar(), llvm::IVUsers::AddUsersImpl(), BlockIsSimpleEnoughToThreadThrough(), canConstantEvolve(), llvm::AliasAnalysis::canInstructionRangeModRef(), changeToCall(), changeToUnreachable(), llvm::CloneAndPruneIntoFromInst(), llvm::CodeMetrics::collectEphemeralValues(), CombineUAddWithOverflow(), computeKnownBitsFromAssume(), computeKnownBitsFromDominatingCondition(), ConstructSSAForLoadSet(), convertMemSetToLoop(), convertTransferToLoop(), copyMetadata(), createFree(), CreateGCRelocates(), createMalloc(), llvm::DemotePHIToStack(), llvm::DemoteRegToStack(), llvm::DependenceAnalysis::depends(), llvm::DominatorTree::dominates(), llvm::InstCombiner::dominatesAllUses(), DominatesMergePoint(), llvm::Value::DoPHITranslation(), EliminateDeadSwitchCases(), eraseFromParent(), llvm::SCEVExpander::expandCodeFor(), findBasePointer(), FindInitTrampolineFromBB(), findLiveSetAtInst(), llvm::SelectionDAGBuilder::FindMergedConditions(), FindPhiPredForUseInBlock(), findRetainForStoreStrongContraction(), findSafeStoreForStoreStrongContraction(), llvm::FoldBranchToCommonDest(), FoldCondBranchOnPHI(), FoldTwoEntryPHINode(), GetCaseResults(), getCommonReturnValue(), llvm::MemoryDependenceAnalysis::getDependency(), getFirstInst(), getInsertPointForUses(), llvm::MemoryDependenceAnalysis::getLoadLoadClobberFullWidthSize(), GetLoadValueForLoad(), getLoopPhiForCounter(), getModule(), llvm::MemoryDependenceAnalysis::getNonLocalCallDependency(), llvm::MemoryDependenceAnalysis::getNonLocalPointerDependency(), llvm::LazyValueInfo::getPredicateAt(), llvm::DependenceAnalysis::getSplitIteration(), HandleByValArgument(), HandleInlinedInvoke(), HasSafePathToPredecessorCall(), llvm::FastISel::hasTrivialKill(), llvm::SCEVExpander::hoistIVInc(), HoistThenElseCodeToIf(), InBlock(), InlineCallIfPossible(), llvm::InlineFunction(), insertAfter(), insertBefore(), llvm::InstCombiner::InsertNewInstBefore(), insertParsePoints(), InsertSafepointPoll(), insertUseHolderAfter(), Instruction(), isChainSelectCmpBranch(), isDynamicConstant(), isGuaranteedToExecute(), llvm::isInTailCallPosition(), isInteresting(), isKnownNonNullFromDominatingCondition(), llvm::Loop::isLCSSAForm(), isLoopInvariant(), IsNonLocalValue(), llvm::isPotentiallyReachable(), isProfitableToFoldUnconditional(), llvm::DominatorTree::isReachableFromEntry(), isSafeAndProfitableToSinkLoad(), isSafePHIToSpeculate(), llvm::isSafeToLoadUnconditionally(), llvm::isSafeToSpeculativelyExecute(), isSameUnderlyingObjectInLoop(), llvm::AllocaInst::isStaticAlloca(), llvm::Value::isUsedInBasicBlock(), isUsedOutsideOfBlock(), isUsedOutsideOfDefiningBlock(), isValidAssumeForContext(), IVUseShouldUsePostIncValue(), LdStHasDebugValue(), LLVMGetNextInstruction(), LLVMGetPreviousInstruction(), LLVMPositionBuilderBefore(), LowerAtomicCmpXchgInst(), LowerAtomicRMWInst(), LowerBSWAP(), LowerCTLZ(), LowerCTPOP(), llvm::IntrinsicLowering::LowerIntrinsicCall(), llvm::IntrinsicLowering::LowerToByteSwap(), makeStatepointExplicitImpl(), llvm::HexagonTargetLowering::mayBeEmittedAsTailCall(), moveBBContents(), moveBefore(), NegateValue(), OptimizeExtractBits(), parentFunctionOfValue(), passingValueIsAlwaysUndefined(), PerformHeapAllocSRoA(), llvm::PHITransAddr::PHITranslateValue(), llvm::Value::print(), PrintOps(), processInstruction(), ProcessUGT_ADDCST_ADD(), ProcessUMulZExtIdiom(), promoteSingleBlockAlloca(), llvm::AssumptionCache::registerAssumption(), removeFromParent(), RemoveSwitchAfterSelectConversion(), replaceAndRecursivelySimplifyImpl(), ReplaceCallWith(), llvm::SCEVExpander::replaceCongruentIVs(), llvm::replaceDbgDeclareForAlloca(), llvm::InstCombiner::replacedSelectWithOperand(), llvm::ReplaceInstWithInst(), llvm::LoopInfo::replacementPreservesLCSSAForm(), ReplaceWithStatepoint(), reuseTableCompare(), rewriteSingleStoreAlloca(), llvm::SSAUpdater::RewriteUse(), llvm::SSAUpdater::RewriteUseAfterInsertions(), RewriteUsesOfClonedInstructions(), llvm::InstCombiner::run(), safeCxtI(), SafeToMergeTerminators(), ScalarizeMaskedLoad(), ScalarizeMaskedStore(), scanInlinedCode(), scanOneBB(), llvm::FastISel::selectInstruction(), llvm::IRBuilderBase::SetInsertPoint(), SimplifyBranchOnICmpChain(), SimplifyCondBranchToCondBranch(), SimplifyCondBranchToTwoReturns(), llvm::InstCombiner::SimplifyDivRemOfSelect(), simplifyOneLoop(), SimplifyTerminatorOnSelect(), llvm::simplifyUsersOfIV(), sink(), SinkCast(), SinkCmpExpression(), SinkShiftAndTruncate(), SinkThenElseCodeToEnd(), llvm::InstCombiner::SliceUpIllegalIntegerPHI(), llvm::SparseSolver::Solve(), SpeculativelyExecuteBB(), llvm::SplitBlockAndInsertIfThen(), llvm::SplitBlockAndInsertIfThenElse(), llvm::SplitCriticalEdge(), splitVectorValues(), SwitchToLookupTable(), llvm::FastISel::tryToFoldLoad(), tryToMoveFreeBeforeNullTest(), TryToSimplifyUncondBranchWithICmpInIt(), TryToSinkInstruction(), TurnSwitchRangeIntoICmp(), UpdateCallGraphAfterInlining(), llvm::UpgradeIntrinsicCall(), ValueDominatesPHI(), llvm::SelectionDAGBuilder::visit(), llvm::InstCombiner::visitAllocaInst(), llvm::InstCombiner::visitCallInst(), llvm::Interpreter::visitCallSite(), llvm::InstCombiner::visitFCmpInst(), llvm::InstCombiner::visitFPTrunc(), llvm::InstCombiner::visitGetElementPtrInst(), llvm::InstCombiner::visitICmpInst(), llvm::InstCombiner::visitLandingPadInst(), llvm::InstCombiner::visitLoadInst(), llvm::InstCombiner::visitPHINode(), and llvm::InstCombiner::visitStoreInst().
|
inline |
Definition at line 73 of file Instruction.h.
|
inlineprotected |
Definition at line 504 of file Instruction.h.
Referenced by llvm::AllocaInst::getAlignment(), llvm::LoadInst::getAlignment(), llvm::StoreInst::getAlignment(), llvm::CallInst::getCallingConv(), llvm::AtomicCmpXchgInst::getFailureOrdering(), llvm::LoadInst::getOrdering(), llvm::StoreInst::getOrdering(), llvm::CmpInst::getPredicate(), llvm::AtomicCmpXchgInst::getSuccessOrdering(), llvm::LoadInst::getSynchScope(), llvm::StoreInst::getSynchScope(), llvm::AtomicCmpXchgInst::getSynchScope(), llvm::CallInst::getTailCallKind(), llvm::CallInst::isMustTailCall(), llvm::CallInst::isTailCall(), llvm::AllocaInst::isUsedWithInAlloca(), llvm::LoadInst::isVolatile(), llvm::StoreInst::isVolatile(), llvm::AtomicCmpXchgInst::isVolatile(), llvm::AtomicCmpXchgInst::isWeak(), llvm::AllocaInst::setAlignment(), llvm::LoadInst::setAlignment(), llvm::StoreInst::setAlignment(), llvm::CallInst::setCallingConv(), llvm::AtomicCmpXchgInst::setFailureOrdering(), llvm::LoadInst::setOrdering(), llvm::StoreInst::setOrdering(), llvm::AtomicCmpXchgInst::setSuccessOrdering(), llvm::LoadInst::setSynchScope(), llvm::StoreInst::setSynchScope(), llvm::AtomicCmpXchgInst::setSynchScope(), llvm::CallInst::setTailCall(), llvm::CallInst::setTailCallKind(), llvm::AllocaInst::setUsedWithInAlloca(), llvm::LoadInst::setVolatile(), llvm::StoreInst::setVolatile(), llvm::AtomicCmpXchgInst::setVolatile(), and llvm::AtomicCmpXchgInst::setWeak().
| bool Instruction::hasAllowReciprocal | ( | ) | const |
Determine whether the allow-reciprocal flag is set.
Definition at line 170 of file Instruction.cpp.
Referenced by llvm::InstCombiner::visitFDiv().
|
inline |
hasMetadata() - Return true if this instruction has any metadata attached to it.
Definition at line 157 of file Instruction.h.
Referenced by clone(), copyMetadata(), getAllMetadata(), getMetadata(), and setMetadata().
|
inline |
hasMetadataOtherThanDebugLoc - Return true if this instruction has metadata attached to it other than a debug location.
Definition at line 161 of file Instruction.h.
Referenced by getAllMetadataOtherThanDebugLoc().
| bool Instruction::hasNoInfs | ( | ) | const |
Determine whether the no-infs flag is set.
Definition at line 158 of file Instruction.cpp.
Referenced by SimplifyFAddInst().
| bool Instruction::hasNoNaNs | ( | ) | const |
Determine whether the no-NaNs flag is set.
Definition at line 152 of file Instruction.cpp.
Referenced by SimplifyFAddInst().
| bool Instruction::hasNoSignedZeros | ( | ) | const |
Determine whether the no-signed-zeros flag is set.
Definition at line 164 of file Instruction.cpp.
Referenced by llvm::BinaryOperator::isFNeg(), llvm::InstCombiner::visitFAdd(), and llvm::InstCombiner::visitFMul().
| bool Instruction::hasUnsafeAlgebra | ( | ) | const |
Determine whether the unsafe-algebra flag is set.
Definition at line 146 of file Instruction.cpp.
Referenced by detectLog2OfHalf(), isAssociative(), llvm::RecurrenceDescriptor::isRecurrenceInstr(), llvm::InstCombiner::visitFAdd(), llvm::InstCombiner::visitFDiv(), llvm::InstCombiner::visitFMul(), and llvm::InstCombiner::visitFSub().
| void Instruction::insertAfter | ( | Instruction * | InsertPos | ) |
Insert an unlinked instruction into a basic block immediately after the specified instruction.
insertAfter - Insert an unlinked instructions into a basic block immediately after the specified instruction.
Definition at line 82 of file Instruction.cpp.
References llvm::BasicBlock::getInstList(), getParent(), and llvm::iplist< NodeTy, Traits >::insertAfter().
Referenced by insertRelocationStores(), insertRematerializationStores(), InsertRootInitializers(), relocationViaAlloca(), and splitVectorValues().
| void Instruction::insertBefore | ( | Instruction * | InsertPos | ) |
Insert an unlinked instruction into a basic block immediately before the specified instruction.
insertBefore - Insert an unlinked instructions into a basic block immediately before the specified instruction.
Definition at line 76 of file Instruction.cpp.
References llvm::BasicBlock::getInstList(), getParent(), and llvm::iplist< NodeTy, Traits >::insert().
Referenced by llvm::FoldBranchToCommonDest(), INITIALIZE_PASS(), relocationViaAlloca(), rematerializeLiveValues(), replaceGEPIdxWithZero(), and llvm::InstCombiner::visitUDiv().
|
inline |
isArithmeticShift - Return true if this is an arithmetic shift right.
Definition at line 142 of file Instruction.h.
References getOpcode().
Referenced by llvm::InstCombiner::visitICmpInstWithInstAndIntCst().
| bool Instruction::isAssociative | ( | ) | const |
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.
Definition at line 478 of file Instruction.cpp.
References getOpcode(), and hasUnsafeAlgebra().
Referenced by llvm::ConstantFoldBinaryInstruction(), LinearizeExprTree(), SimplifyAssociativeBinOp(), and SimplifyBinOp().
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.
Definition at line 473 of file Instruction.cpp.
References llvm::APIntOps::And(), llvm::APIntOps::Or(), and llvm::APIntOps::Xor().
| bool Instruction::isAtomic | ( | ) | const |
isAtomic - Return true if this instruction has an AtomicOrdering of unordered or higher.
Definition at line 440 of file Instruction.cpp.
References getOpcode(), llvm::SPII::Load, llvm::NotAtomic, and llvm::SPII::Store.
Referenced by llvm::LoadInst::isSimple(), and llvm::StoreInst::isSimple().
|
inline |
Definition at line 116 of file Instruction.h.
References getOpcode(), and isBinaryOp().
Referenced by llvm::BinaryOperator::classof(), llvm::ConstantFoldInstOperands(), and isBinaryOp().
Definition at line 126 of file Instruction.h.
|
inline |
Definition at line 118 of file Instruction.h.
References getOpcode(), and isCast().
Referenced by llvm::CastInst::classof(), llvm::ConstantExprKeyType::create(), foldConstantCastPair(), llvm::InstCombiner::FoldSelectOpOp(), llvm::ConstantExpr::getCast(), isCast(), llvm::ConstantExpr::isCast(), WriteConstants(), and WriteInstruction().
Determine if the OpCode is one of the CastInst instructions.
Definition at line 147 of file Instruction.h.
|
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 327 of file Instruction.h.
References getOpcode(), and isCommutative().
Referenced by llvm::RecurrenceDescriptor::AddReductionVar(), llvm::ConstantFoldBinaryInstruction(), ExpandBinOp(), llvm::InstCombiner::FoldSelectOpOp(), isCommutative(), LinearizeExprTree(), RightDistributesOverLeft(), SimplifyAssociativeBinOp(), llvm::BinaryOperator::swapOperands(), ThreadBinOpOverSelect(), and tryFactorization().
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 499 of file Instruction.cpp.
References llvm::APIntOps::And(), llvm::APIntOps::Or(), and llvm::APIntOps::Xor().
|
inline |
isIdempotent - Return true if the instruction is idempotent:
Idempotent operators satisfy: x op x === x
In LLVM, the And and Or operators are idempotent.
Definition at line 336 of file Instruction.h.
References getOpcode(), and isIdempotent().
Referenced by IncorporateWeight(), and isIdempotent().
isIdempotent - Return true if the instruction is idempotent:
Idempotent operators satisfy: x op x === x
In LLVM, the And and Or operators are idempotent.
Definition at line 520 of file Instruction.cpp.
References llvm::APIntOps::And(), and llvm::APIntOps::Or().
| bool Instruction::isIdenticalTo | ( | const 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 320 of file Instruction.cpp.
References isIdenticalToWhenDefined(), and llvm::Value::SubclassOptionalData.
Referenced by checkCSEInPredecessor(), llvm::EliminateDuplicatePHINodes(), and TryToMergeLandingPad().
| bool Instruction::isIdenticalToWhenDefined | ( | const Instruction * | I | ) | const |
isIdenticalToWhenDefined - This is like isIdenticalTo, except that it ignores the SubclassOptionalData flags, which specify conditions under which the instruction's result is undefined.
Definition at line 328 of file Instruction.cpp.
References llvm::PHINode::block_begin(), llvm::lltok::equal, llvm::User::getNumOperands(), getOpcode(), llvm::Value::getType(), haveSameSpecialState(), I, llvm::User::op_begin(), and llvm::User::op_end().
Referenced by HoistThenElseCodeToIf(), and isIdenticalTo().
|
inline |
isLogicalShift - Return true if this is a logical shift left or a logical shift right.
Definition at line 137 of file Instruction.h.
References getOpcode().
Referenced by CollectBSwapParts(), and llvm::InstCombiner::FoldShiftByConstant().
|
inline |
isNilpotent - Return true if the instruction is nilpotent:
Nilpotent operators satisfy: x op x === Id,
where Id is the identity for the operator, i.e. a constant such that x op Id === x and Id op x === x for all x.
In LLVM, the Xor operator is nilpotent.
Definition at line 348 of file Instruction.h.
References getOpcode(), and isNilpotent().
Referenced by IncorporateWeight(), and isNilpotent().
isNilpotent - Return true if the instruction is nilpotent:
Nilpotent operators satisfy: x op x === Id,
where Id is the identity for the operator, i.e. a constant such that x op Id === x and Id op x === x for all x.
In LLVM, the Xor operator is nilpotent.
Definition at line 533 of file Instruction.cpp.
References llvm::APIntOps::Xor().
| bool Instruction::isSameOperationAs | ( | const Instruction * | I, |
| unsigned | flags = 0 |
||
| ) | const |
This function determines if the specified instruction executes the same operation as the current one.
This means that the opcodes, type, operand types and any other factors affecting the operation must be the same. This is similar to isIdenticalTo except the operands themselves don't have to be identical.
Definition at line 355 of file Instruction.cpp.
References CompareIgnoringAlignment, CompareUsingScalarTypes, llvm::User::getNumOperands(), getOpcode(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::Value::getType(), and haveSameSpecialState().
Referenced by SinkThenElseCodeToEnd().
|
inline |
Definition at line 117 of file Instruction.h.
References getOpcode(), and isShift().
Referenced by llvm::InstCombiner::FoldShiftByConstant(), isShift(), and llvm::InstCombiner::visitICmpInstWithInstAndIntCst().
Determine if the Opcode is one of the shift instructions.
Definition at line 131 of file Instruction.h.
|
inline |
Definition at line 115 of file Instruction.h.
References getOpcode(), and isTerminator().
Referenced by llvm::TerminatorInst::classof(), findLocationForEntrySafepoint(), isTerminator(), llvm::MemoryDependenceAnalysis::removeInstruction(), and SimplifyCondBranchToTwoReturns().
Definition at line 122 of file Instruction.h.
| bool Instruction::isUsedOutsideOfBlock | ( | const BasicBlock * | BB | ) | const |
isUsedOutsideOfBlock - Return true if there are any uses of this instruction in blocks other than the specified block.
isUsedOutsideOfBlock - Return true if there are any uses of I outside of the specified block.
Note that PHI nodes are considered to evaluate their operands in the corresponding predecessor block.
Definition at line 382 of file Instruction.cpp.
References llvm::dyn_cast(), getParent(), I, and llvm::Value::uses().
|
inline |
mayHaveSideEffects - Return true if the instruction may have side effects.
Note that this does not consider malloc and alloca to have side effects because the newly allocated memory is completely invisible to instructions which don't use the returned value. For cases where this matters, isSafeToSpeculativelyExecute may be more appropriate.
Definition at line 387 of file Instruction.h.
References mayReturn(), mayThrow(), and mayWriteToMemory().
Referenced by InstructionWillNotHaveChain(), llvm::isInstructionTriviallyDead(), llvm::isInTailCallPosition(), IsSafeComputationToRemove(), isSafePHIToSpeculate(), isSafeToSpeculateStore(), SinkThenElseCodeToEnd(), SpeculativelyExecuteBB(), and TryToSinkInstruction().
| bool Instruction::mayReadFromMemory | ( | ) | const |
mayReadFromMemory - Return true if this instruction may read memory.
Definition at line 402 of file Instruction.cpp.
References llvm::Call, getOpcode(), llvm::SPII::Load, and llvm::SPII::Store.
Referenced by llvm::DependenceAnalysis::depends(), GetLocation(), llvm::DependenceAnalysis::getSplitIteration(), hasConcreteDefImpl(), InstructionWillNotHaveChain(), llvm::Dependence::isAnti(), llvm::Dependence::isFlow(), llvm::Dependence::isInput(), llvm::isInTailCallPosition(), llvm::Loop::makeLoopInvariant(), mayReadOrWriteMemory(), and TryToSinkInstruction().
|
inline |
mayReadOrWriteMemory - Return true if this instruction may read or write memory.
Definition at line 362 of file Instruction.h.
References mayReadFromMemory(), and mayWriteToMemory().
Referenced by llvm::AliasSetTracker::addUnknown(), llvm::AliasSet::aliasesUnknownInst(), CloneAliasScopeMetadata(), llvm::AliasSetTracker::deleteValue(), llvm::MemoryDependenceAnalysis::getPointerDependencyFrom(), llvm::AliasSetTracker::removeUnknown(), and SinkThenElseCodeToEnd().
| bool Instruction::mayReturn | ( | ) | const |
mayReturn - Return true if this is a function that may return.
this is true for all normal instructions. The only exception is functions that are marked with the 'noreturn' attribute.
Definition at line 461 of file Instruction.cpp.
Referenced by mayHaveSideEffects().
| bool Instruction::mayThrow | ( | ) | const |
mayThrow - Return true if this instruction may throw an exception.
Definition at line 455 of file Instruction.cpp.
Referenced by mayHaveSideEffects().
| bool Instruction::mayWriteToMemory | ( | ) | const |
mayWriteToMemory - Return true if this instruction may modify memory.
Definition at line 422 of file Instruction.cpp.
References llvm::Call, getOpcode(), llvm::SPII::Load, and llvm::SPII::Store.
Referenced by llvm::DependenceAnalysis::depends(), llvm::FindAvailableLoadedValue(), FindInitTrampolineFromBB(), GetLocation(), llvm::DependenceAnalysis::getSplitIteration(), llvm::Dependence::isAnti(), llvm::Dependence::isFlow(), isFoldedOrDeadInstruction(), llvm::Dependence::isOutput(), isSafeToMove(), mayHaveSideEffects(), and mayReadOrWriteMemory().
| 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 89 of file Instruction.cpp.
References llvm::BasicBlock::getInstList(), getParent(), and llvm::iplist< NodeTy, Traits >::splice().
Referenced by hoist(), hoistBeforePos(), llvm::SCEVExpander::hoistIVInc(), llvm::Loop::makeLoopInvariant(), NegateValue(), tryToMoveFreeBeforeNullTest(), TryToSinkInstruction(), and llvm::InstCombiner::visitAllocaInst().
| void Instruction::removeFromParent | ( | ) |
removeFromParent - This method unlinks 'this' from the containing basic block, but does not delete it.
Definition at line 66 of file Instruction.cpp.
References llvm::BasicBlock::getInstList(), getParent(), and llvm::iplist< NodeTy, Traits >::remove().
setAAMetadata - Sets the metadata on this instruction from the AAMDNodes structure.
Definition at line 1122 of file Metadata.cpp.
References llvm::LLVMContext::MD_alias_scope, llvm::LLVMContext::MD_noalias, llvm::LLVMContext::MD_tbaa, llvm::AAMDNodes::NoAlias, llvm::AAMDNodes::Scope, setMetadata(), and llvm::AAMDNodes::TBAA.
Referenced by llvm::promoteLoopAccessesToScalars(), speculatePHINodeLoads(), speculateSelectInstLoads(), and tryToMakeAllocaBePromotable().
|
inline |
setDebugLoc - Set the debug location information for this instruction.
Definition at line 227 of file Instruction.h.
Referenced by clone(), ConvertShiftToMul(), createAndInstr(), llvm::SSAUpdater::GetValueInMiddleOfBlock(), llvm::InlineFunction(), llvm::InstCombiner::InsertNewInstWith(), LowerNegateToMultiply(), llvm::promoteLoopAccessesToScalars(), llvm::ReplaceInstWithInst(), llvm::IRBuilderBase::SetInstDebugLocation(), llvm::BasicBlock::splitBasicBlock(), llvm::SplitLandingPadPredecessors(), and withDebugLoc().
| void Instruction::setFastMathFlags | ( | FastMathFlags | FMF | ) |
Convenience function for setting multiple fast-math flags on this instruction, which must be an operator which supports these flags.
Convenience function for setting all the fast-math flags on this instruction, which must be an operator which supports these flags.
See LangRef.html for the meaning of these flags.
See LangRef.html for the meaning of these flats.
Definition at line 135 of file Instruction.cpp.
Referenced by ClearSubclassDataAfterReassociation(), CreateAdd(), CreateMul(), CreateNeg(), and llvm::InstCombiner::visitFDiv().
| void Instruction::setHasAllowReciprocal | ( | bool | B | ) |
Set or clear the allow-reciprocal flag on this instruction, which must be an operator which supports this flag.
See LangRef.html for the meaning of this flag.
Definition at line 127 of file Instruction.cpp.
| void Instruction::setHasNoInfs | ( | bool | B | ) |
Set or clear the no-infs flag on this instruction, which must be an operator which supports this flag.
See LangRef.html for the meaning of this flag.
Definition at line 111 of file Instruction.cpp.
| void Instruction::setHasNoNaNs | ( | bool | B | ) |
Set or clear the no-nans flag on this instruction, which must be an operator which supports this flag.
Set or clear the NoNaNs flag on this instruction, which must be an operator which supports this flag.
See LangRef.html for the meaning of this flag.
Definition at line 104 of file Instruction.cpp.
| void Instruction::setHasNoSignedZeros | ( | bool | B | ) |
Set or clear the no-signed-zeros flag on this instruction, which must be an operator which supports this flag.
See LangRef.html for the meaning of this flag.
Definition at line 119 of file Instruction.cpp.
| void Instruction::setHasUnsafeAlgebra | ( | bool | B | ) |
Set or clear the unsafe-algebra flag on this instruction, which must be an operator which supports this flag.
See LangRef.html for the meaning of this flag.
Definition at line 97 of file Instruction.cpp.
|
inlineprotected |
Definition at line 499 of file Instruction.h.
Referenced by llvm::CmpInst::setPredicate().
setMetadata - Set the metadata of the specified kind to the specified node.
setMetadata - Set the metadata of of the specified kind to the specified node.
This updates/replaces metadata if already present, or removes it if Node is null.
Definition at line 1083 of file Metadata.cpp.
References llvm::Value::getContext(), hasMetadata(), llvm::LLVMContextImpl::InstructionMetadata, llvm::LLVMContext::MD_dbg, and llvm::LLVMContext::pImpl.
Referenced by AddAliasScopeMetadata(), clone(), CloneAliasScopeMetadata(), combineLoadToNewType(), llvm::combineMetadata(), combineStoreToNewValue(), llvm::ConstantFoldTerminator(), copyMetadata(), llvm::IRBuilderBase::CreateMemCpy(), llvm::IRBuilderBase::CreateMemMove(), llvm::IRBuilderBase::CreateMemSet(), EliminateDeadSwitchCases(), findBasePointer(), llvm::FoldBranchToCommonDest(), handleBranchExpect(), handleSwitchExpect(), llvm::RemapInstruction(), setAAMetadata(), llvm::Loop::setLoopID(), setMetadata(), SimplifyCondBranchToCondBranch(), SimplifyTerminatorOnSelect(), llvm::SplitBlockAndInsertIfThen(), llvm::SplitBlockAndInsertIfThenElse(), llvm::BranchInst::swapSuccessors(), TryToSimplifyUncondBranchWithICmpInIt(), TurnSwitchRangeIntoICmp(), llvm::UpgradeInstWithTBAATag(), llvm::UpgradeIntrinsicCall(), and llvm::InstCombiner::visitCallInst().
Definition at line 1038 of file Metadata.cpp.
References llvm::Value::getContext(), hasMetadata(), and setMetadata().
|
inline |
user_back - Specialize the methods defined in Value, as we know that an instruction can only be used by other instructions.
Definition at line 69 of file Instruction.h.
References llvm::Value::user_begin().
Referenced by combineLoadToOperationType(), DeadPHICycle(), llvm::DemoteRegToStack(), llvm::AArch64TargetLowering::isProfitableToHoist(), OptimizeGlobalAddressOfMalloc(), promoteSingleBlockAlloca(), ShouldBreakUpSubtract(), llvm::InstCombiner::SliceUpIllegalIntegerPHI(), speculatePHINodeLoads(), speculateSelectInstLoads(), SwitchToLookupTable(), llvm::FastISel::tryToFoldLoad(), tryToMakeAllocaBePromotable(), TryToSimplifyUncondBranchWithICmpInIt(), llvm::InstCombiner::visitInsertElementInst(), llvm::InstCombiner::visitPHINode(), llvm::InstCombiner::visitSExt(), and llvm::InstCombiner::visitZExt().
|
inline |
Definition at line 70 of file Instruction.h.
References llvm::Value::user_begin().
|
friend |
Definition at line 492 of file Instruction.h.
1.8.6