LLVM 24.0.0git
llvm::slpvectorizer::BinOpSameOpcodeHelper Class Reference

Helper class that determines VL can use the same opcode. More...

#include "Transforms/Vectorize/SLPVectorizer/SLPCompatibilityAnalysis.h"

Public Member Functions

 BinOpSameOpcodeHelper (const Instruction *MainOp, const Instruction *AltOp=nullptr)
bool add (const Instruction *I)
unsigned getMainOpcode () const
bool hasDefinedMainOpcode () const
bool hasCandidateOpcode (unsigned Opcode) const
 Checks if the list of potential opcodes includes Opcode.
bool hasAltOp () const
unsigned getAltOpcode () const
bool hasDefinedAltOpcode () const
SmallVector< Value * > getOperand (const Instruction *I) const

Detailed Description

Helper class that determines VL can use the same opcode.

Alternate instruction is supported. In addition, it supports interchangeable instruction. An interchangeable instruction is an instruction that can be converted to another instruction with same semantics. For example, x << 1 is equal to x * 2. x * 1 is equal to x | 0.

Definition at line 46 of file SLPCompatibilityAnalysis.h.

Constructor & Destructor Documentation

◆ BinOpSameOpcodeHelper()

llvm::slpvectorizer::BinOpSameOpcodeHelper::BinOpSameOpcodeHelper ( const Instruction * MainOp,
const Instruction * AltOp = nullptr )
inline

Definition at line 107 of file SLPCompatibilityAnalysis.h.

Member Function Documentation

◆ add()

◆ getAltOpcode()

unsigned llvm::slpvectorizer::BinOpSameOpcodeHelper::getAltOpcode ( ) const
inline

Definition at line 118 of file SLPCompatibilityAnalysis.h.

References getMainOpcode(), and hasAltOp().

Referenced by getSameOpcode().

◆ getMainOpcode()

unsigned llvm::slpvectorizer::BinOpSameOpcodeHelper::getMainOpcode ( ) const
inline

Definition at line 111 of file SLPCompatibilityAnalysis.h.

Referenced by getAltOpcode(), and getSameOpcode().

◆ getOperand()

SmallVector< Value * > llvm::slpvectorizer::BinOpSameOpcodeHelper::getOperand ( const Instruction * I) const
inline

Definition at line 124 of file SLPCompatibilityAnalysis.h.

References I.

◆ hasAltOp()

bool llvm::slpvectorizer::BinOpSameOpcodeHelper::hasAltOp ( ) const
inline

Definition at line 117 of file SLPCompatibilityAnalysis.h.

Referenced by getAltOpcode(), and hasDefinedAltOpcode().

◆ hasCandidateOpcode()

bool llvm::slpvectorizer::BinOpSameOpcodeHelper::hasCandidateOpcode ( unsigned Opcode) const
inline

Checks if the list of potential opcodes includes Opcode.

Definition at line 114 of file SLPCompatibilityAnalysis.h.

◆ hasDefinedAltOpcode()

bool llvm::slpvectorizer::BinOpSameOpcodeHelper::hasDefinedAltOpcode ( ) const
inline

Definition at line 121 of file SLPCompatibilityAnalysis.h.

References hasAltOp().

Referenced by getSameOpcode().

◆ hasDefinedMainOpcode()

bool llvm::slpvectorizer::BinOpSameOpcodeHelper::hasDefinedMainOpcode ( ) const
inline

Definition at line 112 of file SLPCompatibilityAnalysis.h.

Referenced by getSameOpcode().


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