LLVM  8.0.1
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
llvm::VPInstruction Class Reference

This is a concrete Recipe that models a single VPlan-level instruction. More...

#include "Transforms/Vectorize/VPlan.h"

Inheritance diagram for llvm::VPInstruction:
Inheritance graph
[legend]
Collaboration diagram for llvm::VPInstruction:
Collaboration graph
[legend]

Public Types

enum  { Not = Instruction::OtherOpsEnd + 1, ICmpULE, SLPLoad, SLPStore }
 VPlan opcodes, extending LLVM IR with idiomatics instructions. More...
 
- Public Types inherited from llvm::VPUser
typedef SmallVectorImpl< VPValue * >::iterator operand_iterator
 
typedef SmallVectorImpl< VPValue * >::const_iterator const_operand_iterator
 
typedef iterator_range< operand_iteratoroperand_range
 
typedef iterator_range< const_operand_iteratorconst_operand_range
 
- Public Types inherited from llvm::VPValue
enum  { VPValueSC, VPUserSC, VPInstructionSC }
 An enumeration for keeping track of the concrete subclass of VPValue that are actually instantiated. More...
 
typedef SmallVectorImpl< VPUser * >::iterator user_iterator
 
typedef SmallVectorImpl< VPUser * >::const_iterator const_user_iterator
 
typedef iterator_range< user_iteratoruser_range
 
typedef iterator_range< const_user_iteratorconst_user_range
 
- Public Types inherited from llvm::VPRecipeBase
using VPRecipeTy = enum { VPBlendSC, VPBranchOnMaskSC, VPInstructionSC, VPInterleaveSC, VPPredInstPHISC, VPReplicateSC, VPWidenIntOrFpInductionSC, VPWidenMemoryInstructionSC, VPWidenPHISC, VPWidenSC, }
 An enumeration for keeping track of the concrete subclass of VPRecipeBase that is actually instantiated. More...
 

Public Member Functions

 VPInstruction (unsigned Opcode, ArrayRef< VPValue *> Operands)
 
 VPInstruction (unsigned Opcode, std::initializer_list< VPValue *> Operands)
 
VPInstructionclone () const
 
unsigned getOpcode () const
 
void execute (VPTransformState &State) override
 Generate the instruction. More...
 
void print (raw_ostream &O, const Twine &Indent) const override
 Print the Recipe. More...
 
void print (raw_ostream &O) const
 Print the VPInstruction. More...
 
bool mayWriteToMemory () const
 Return true if this instruction may modify memory. More...
 
- Public Member Functions inherited from llvm::VPUser
 VPUser ()
 
 VPUser (ArrayRef< VPValue *> Operands)
 
 VPUser (std::initializer_list< VPValue *> Operands)
 
 VPUser (const VPUser &)=delete
 
VPUseroperator= (const VPUser &)=delete
 
void addOperand (VPValue *Operand)
 
unsigned getNumOperands () const
 
VPValuegetOperand (unsigned N) const
 
void setOperand (unsigned I, VPValue *New)
 
operand_iterator op_begin ()
 
const_operand_iterator op_begin () const
 
operand_iterator op_end ()
 
const_operand_iterator op_end () const
 
operand_range operands ()
 
const_operand_range operands () const
 
- Public Member Functions inherited from llvm::VPValue
 VPValue (Value *UV=nullptr)
 
 VPValue (const VPValue &)=delete
 
VPValueoperator= (const VPValue &)=delete
 
unsigned getVPValueID () const
 
void printAsOperand (raw_ostream &OS) const
 
unsigned getNumUsers () const
 
void addUser (VPUser &User)
 
user_iterator user_begin ()
 
const_user_iterator user_begin () const
 
user_iterator user_end ()
 
const_user_iterator user_end () const
 
user_range users ()
 
const_user_range users () const
 
bool hasMoreThanOneUniqueUser ()
 Returns true if the value has more than one unique user. More...
 
void replaceAllUsesWith (VPValue *New)
 
- Public Member Functions inherited from llvm::VPRecipeBase
 VPRecipeBase (const unsigned char SC)
 
virtual ~VPRecipeBase ()=default
 
unsigned getVPRecipeID () const
 
VPBasicBlockgetParent ()
 
const VPBasicBlockgetParent () const
 
void insertBefore (VPRecipeBase *InsertPos)
 Insert an unlinked recipe into a basic block immediately before the specified recipe. More...
 
iplist< VPRecipeBase >::iterator eraseFromParent ()
 This method unlinks 'this' from the containing basic block and deletes it. More...
 
- Public Member Functions inherited from llvm::ilist_node_with_parent< VPRecipeBase, VPBasicBlock >
VPRecipeBasegetPrevNode ()
 
const VPRecipeBasegetPrevNode () const
 Get the previous node, or nullptr for the list head. More...
 
VPRecipeBasegetNextNode ()
 Get the next node, or nullptr for the list tail. More...
 
const VPRecipeBasegetNextNode () const
 Get the next node, or nullptr for the list tail. More...
 
- Public Member Functions inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< VPRecipeBase, Options... >::type >
self_iterator getIterator ()
 
const_self_iterator getIterator () const
 
reverse_self_iterator getReverseIterator ()
 
const_reverse_self_iterator getReverseIterator () const
 
bool isSentinel () const
 Check whether this is the sentinel node. More...
 

Static Public Member Functions

static bool classof (const VPValue *V)
 Method to support type inquiry through isa, cast, and dyn_cast. More...
 
static bool classof (const VPRecipeBase *R)
 Method to support type inquiry through isa, cast, and dyn_cast. More...
 
- Static Public Member Functions inherited from llvm::VPUser
static bool classof (const VPValue *V)
 Method to support type inquiry through isa, cast, and dyn_cast. More...
 

Protected Member Functions

InstructiongetUnderlyingInstr ()
 
void setUnderlyingInstr (Instruction *I)
 
- Protected Member Functions inherited from llvm::VPUser
 VPUser (const unsigned char SC)
 
 VPUser (const unsigned char SC, ArrayRef< VPValue *> Operands)
 
- Protected Member Functions inherited from llvm::VPValue
 VPValue (const unsigned char SC, Value *UV=nullptr)
 
ValuegetUnderlyingValue ()
 Return the underlying Value attached to this VPValue. More...
 
void setUnderlyingValue (Value *Val)
 
- Protected Member Functions inherited from llvm::ilist_node_with_parent< VPRecipeBase, VPBasicBlock >
 ilist_node_with_parent ()=default
 
- Protected Member Functions inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< VPRecipeBase, Options... >::type >
 ilist_node_impl ()=default
 

Friends

class VPlanHCFGTransforms
 
class VPlanSlp
 

Additional Inherited Members

- Protected Types inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< VPRecipeBase, Options... >::type >
using self_iterator = ilist_iterator< ilist_detail::compute_node_options< VPRecipeBase, Options... >::type, false, false >
 
using const_self_iterator = ilist_iterator< ilist_detail::compute_node_options< VPRecipeBase, Options... >::type, false, true >
 
using reverse_self_iterator = ilist_iterator< ilist_detail::compute_node_options< VPRecipeBase, Options... >::type, true, false >
 
using const_reverse_self_iterator = ilist_iterator< ilist_detail::compute_node_options< VPRecipeBase, Options... >::type, true, true >
 
- Protected Attributes inherited from llvm::VPValue
ValueUnderlyingVal
 

Detailed Description

This is a concrete Recipe that models a single VPlan-level instruction.

While as any Recipe it may generate a sequence of IR instructions when executed, these instructions would always form a single-def expression as the VPInstruction is also a single def-use vertex.

Definition at line 611 of file VPlan.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

VPlan opcodes, extending LLVM IR with idiomatics instructions.

Enumerator
Not 
ICmpULE 
SLPLoad 
SLPStore 

Definition at line 617 of file VPlan.h.

Constructor & Destructor Documentation

◆ VPInstruction() [1/2]

llvm::VPInstruction::VPInstruction ( unsigned  Opcode,
ArrayRef< VPValue *>  Operands 
)
inline

Definition at line 640 of file VPlan.h.

◆ VPInstruction() [2/2]

llvm::VPInstruction::VPInstruction ( unsigned  Opcode,
std::initializer_list< VPValue *>  Operands 
)
inline

Definition at line 644 of file VPlan.h.

Member Function Documentation

◆ classof() [1/2]

static bool llvm::VPInstruction::classof ( const VPValue V)
inlinestatic

Method to support type inquiry through isa, cast, and dyn_cast.

Definition at line 648 of file VPlan.h.

References llvm::VPValue::getVPValueID(), and llvm::VPValue::VPInstructionSC.

◆ classof() [2/2]

static bool llvm::VPInstruction::classof ( const VPRecipeBase R)
inlinestatic

Method to support type inquiry through isa, cast, and dyn_cast.

Definition at line 658 of file VPlan.h.

References llvm::VPRecipeBase::getVPRecipeID().

◆ clone()

VPInstruction* llvm::VPInstruction::clone ( ) const
inline

Definition at line 652 of file VPlan.h.

◆ execute()

void VPInstruction::execute ( VPTransformState State)
overridevirtual

Generate the instruction.

TODO: We currently execute only per-part unless a specific instance is provided.

Implements llvm::VPRecipeBase.

Definition at line 318 of file VPlan.cpp.

References assert(), llvm::VPTransformState::Instance, and llvm::VPTransformState::UF.

◆ getOpcode()

unsigned llvm::VPInstruction::getOpcode ( ) const
inline

Definition at line 662 of file VPlan.h.

References Indent, llvm::RISCVFenceField::O, and print().

Referenced by areConsecutiveOrMatch().

◆ getUnderlyingInstr()

Instruction* llvm::VPInstruction::getUnderlyingInstr ( )
inlineprotected

Definition at line 633 of file VPlan.h.

◆ mayWriteToMemory()

bool llvm::VPInstruction::mayWriteToMemory ( ) const
inline

Return true if this instruction may modify memory.

Definition at line 676 of file VPlan.h.

References llvm::MCID::Call, and llvm::SPII::Store.

◆ print() [1/2]

void VPInstruction::print ( raw_ostream O,
const Twine Indent 
) const
overridevirtual

Print the Recipe.

Implements llvm::VPRecipeBase.

Definition at line 324 of file VPlan.cpp.

References llvm::VPBlockBase::print().

◆ print() [2/2]

void VPInstruction::print ( raw_ostream O) const

◆ setUnderlyingInstr()

void llvm::VPInstruction::setUnderlyingInstr ( Instruction I)
inlineprotected

Definition at line 637 of file VPlan.h.

Friends And Related Function Documentation

◆ VPlanHCFGTransforms

friend class VPlanHCFGTransforms
friend

Definition at line 612 of file VPlan.h.

◆ VPlanSlp

friend class VPlanSlp
friend

Definition at line 613 of file VPlan.h.


The documentation for this class was generated from the following files: