|
LLVM 24.0.0git
|
Main data required for vectorization of instructions. More...
#include "Transforms/Vectorize/SLPVectorizer/SLPCompatibilityAnalysis.h"
Public Member Functions | |
| Instruction * | getMainOp () const |
| Instruction * | getAltOp () const |
| unsigned | getOpcode () const |
| The main/alternate opcodes for the list of instructions. | |
| unsigned | getAltOpcode () const |
| bool | isAltShuffle () const |
| Some of the instructions in the list have alternate opcodes. | |
| Instruction * | getMatchingMainOpOrAltOp (Instruction *I) const |
| Checks if the instruction matches either the main or alternate opcode. | |
| bool | isShiftOp () const |
| Checks if main/alt instructions are shift operations. | |
| bool | isBitwiseLogicOp () const |
| Checks if main/alt instructions are bitwise logic operations. | |
| bool | isMulDivLikeOp () const |
| Checks if main/alt instructions are mul/div/rem/fmul/fdiv/frem operations. | |
| bool | isAddSubLikeOp () const |
| Checks if main/alt instructions are add/sub/fadd/fsub operations. | |
| bool | isCmpOp () const |
| Checks if main/alt instructions are cmp operations. | |
| bool | valid () const |
| Checks if the current state is valid, i.e. has non-null MainOp. | |
| operator bool () const | |
| InstructionsState ()=delete | |
| InstructionsState (Instruction *MainOp, Instruction *AltOp, bool HasCopyables=false) | |
| bool | isCopyableElement (Value *V) const |
| Checks if the value is a copyable element. | |
| bool | isExpandedBinOp (Value *V) const |
Checks if the value V is a transformed instruction, compatible either with main or alternate ops. | |
| bool | isExpandedOperand (Instruction *I, unsigned Idx) const |
Checks if the operand at index Idx of instruction I is an expanded operand. | |
| bool | isNonSchedulable (Value *V) const |
| Checks if the value is non-schedulable. | |
| bool | areInstructionsWithCopyableElements () const |
| Checks if the state represents copyable instructions. | |
| unsigned | getCopyableOpIdx () const |
| Returns the index of the operand the copyable value is modeled in. | |
| void | setCopyableOpIdx (unsigned Idx) |
| Sets the index of the operand the copyable value is modeled in. | |
Static Public Member Functions | |
| static bool | isSameOperation (const Instruction *I, const Instruction *Op) |
Checks if I is the same operation as Op, distinguishing calls by intrinsic ID (all calls share the Call opcode, so e.g. | |
| static InstructionsState | invalid () |
Main data required for vectorization of instructions.
Definition at line 131 of file SLPCompatibilityAnalysis.h.
|
delete |
Referenced by invalid().
|
inline |
Definition at line 223 of file SLPCompatibilityAnalysis.h.
|
inline |
Checks if the state represents copyable instructions.
Definition at line 246 of file SLPCompatibilityAnalysis.h.
References assert(), and valid().
Referenced by scanAssociativeOperands(), and tryToFindDuplicates().
|
inline |
Definition at line 168 of file SLPCompatibilityAnalysis.h.
References assert(), and valid().
Referenced by slpvectorizer::BoUpSLP::canBuildSplitNode(), canConvertToFMA(), getAltOpcode(), isAltShuffle(), isBitwiseLogicOp(), and isShiftOp().
|
inline |
Definition at line 176 of file SLPCompatibilityAnalysis.h.
References getAltOp(), and llvm::Instruction::getOpcode().
Referenced by slpvectorizer::BoUpSLP::canBuildSplitNode(), and isCmpOp().
|
inline |
Returns the index of the operand the copyable value is modeled in.
Definition at line 252 of file SLPCompatibilityAnalysis.h.
|
inline |
Definition at line 163 of file SLPCompatibilityAnalysis.h.
References assert(), and valid().
Referenced by slpvectorizer::BoUpSLP::canBuildSplitNode(), canConvertToFMA(), checkEVsForVecCalls(), getOpcode(), slpvectorizer::BoUpSLP::LookAheadHeuristics::getShallowScore(), slpvectorizer::BoUpSLP::hasSameNode(), isAltShuffle(), isBitwiseLogicOp(), isNonSchedulable(), isShiftOp(), slpvectorizer::BoUpSLP::transformNodes(), and tryToFindDuplicates().
| Instruction * llvm::slpvectorizer::InstructionsState::getMatchingMainOpOrAltOp | ( | Instruction * | I | ) | const |
Checks if the instruction matches either the main or alternate opcode.
| I | matches MainOp's opcode directly or can be converted to it
|
| I | matches AltOp's opcode directly or can be converted to it
|
| I | cannot be matched or converted to either opcode |
Definition at line 335 of file SLPCompatibilityAnalysis.cpp.
References llvm::slpvectorizer::BinOpSameOpcodeHelper::add(), assert(), Converter, llvm::slpvectorizer::BinOpSameOpcodeHelper::hasCandidateOpcode(), I, isAltShuffle(), and isSameOperation().
Referenced by canConvertToFMA(), getSameOpcode(), isAlternateInstruction(), isExpandedBinOp(), and isMainInstruction().
|
inline |
The main/alternate opcodes for the list of instructions.
Definition at line 174 of file SLPCompatibilityAnalysis.h.
References getMainOp(), and llvm::Instruction::getOpcode().
Referenced by slpvectorizer::BoUpSLP::canBuildSplitNode(), canConvertToFMA(), checkEVsForVecCalls(), isAddSubLikeOp(), isCmpOp(), isCopyableElement(), isMulDivLikeOp(), scanAssociativeOperands(), and tryToFindDuplicates().
|
inlinestatic |
Definition at line 229 of file SLPCompatibilityAnalysis.h.
References InstructionsState().
Referenced by getSameOpcode(), and scanAssociativeOperands().
| bool llvm::slpvectorizer::InstructionsState::isAddSubLikeOp | ( | ) | const |
Checks if main/alt instructions are add/sub/fadd/fsub operations.
Definition at line 372 of file SLPCompatibilityAnalysis.cpp.
References llvm::slpvectorizer::BinOpSameOpcodeHelper::getAltOpcode(), getOpcode(), and llvm::is_contained().
Referenced by slpvectorizer::BoUpSLP::canBuildSplitNode(), and canConvertToFMA().
|
inline |
Some of the instructions in the list have alternate opcodes.
Definition at line 179 of file SLPCompatibilityAnalysis.h.
References getAltOp(), and getMainOp().
Referenced by canConvertToFMA(), checkEVsForVecCalls(), compareCmp(), getMatchingMainOpOrAltOp(), slpvectorizer::BoUpSLP::LookAheadHeuristics::getShallowScore(), isCopyableElement(), slpvectorizer::BoUpSLP::VLOperands::reorder(), scanAssociativeOperands(), and tryToFindDuplicates().
|
inline |
Checks if main/alt instructions are bitwise logic operations.
Definition at line 200 of file SLPCompatibilityAnalysis.h.
References getAltOp(), getMainOp(), and llvm::Instruction::isBitwiseLogicOp().
Referenced by slpvectorizer::BoUpSLP::canBuildSplitNode().
|
inline |
Checks if main/alt instructions are cmp operations.
Definition at line 211 of file SLPCompatibilityAnalysis.h.
References getAltOpcode(), and getOpcode().
Referenced by slpvectorizer::BoUpSLP::canBuildSplitNode().
Checks if the value is a copyable element.
Definition at line 379 of file SLPCompatibilityAnalysis.cpp.
References assert(), Converter, llvm::dyn_cast(), getOpcode(), I, llvm::isa(), isAltShuffle(), isSameOperation(), llvm::slpvectorizer::isVectorLikeInstWithConstOps(), and valid().
Referenced by canConvertToFMA(), isExpandedBinOp(), isNonSchedulable(), and scanAssociativeOperands().
Checks if the value V is a transformed instruction, compatible either with main or alternate ops.
Definition at line 402 of file SLPCompatibilityAnalysis.cpp.
References assert(), llvm::dyn_cast(), getMatchingMainOpOrAltOp(), llvm::Instruction::getOpcode(), isCopyableElement(), llvm::PatternMatch::m_One(), llvm::PatternMatch::m_Shl(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), and valid().
Referenced by isExpandedOperand().
| bool llvm::slpvectorizer::InstructionsState::isExpandedOperand | ( | Instruction * | I, |
| unsigned | Idx ) const |
Checks if the operand at index Idx of instruction I is an expanded operand.
Definition at line 434 of file SLPCompatibilityAnalysis.cpp.
References assert(), I, isExpandedBinOp(), llvm_unreachable, llvm::PatternMatch::m_One(), llvm::PatternMatch::m_Shl(), llvm::PatternMatch::m_Value(), and llvm::PatternMatch::match().
| bool llvm::slpvectorizer::InstructionsState::isMulDivLikeOp | ( | ) | const |
Checks if main/alt instructions are mul/div/rem/fmul/fdiv/frem operations.
Definition at line 363 of file SLPCompatibilityAnalysis.cpp.
References llvm::slpvectorizer::BinOpSameOpcodeHelper::getAltOpcode(), getOpcode(), and llvm::is_contained().
Referenced by slpvectorizer::BoUpSLP::canBuildSplitNode().
Checks if the value is non-schedulable.
Definition at line 445 of file SLPCompatibilityAnalysis.cpp.
References assert(), llvm::slpvectorizer::doesNotNeedToBeScheduled(), llvm::dyn_cast(), getMainOp(), I, llvm::isa(), isCopyableElement(), llvm::slpvectorizer::isVectorLikeInstWithConstOps(), and valid().
|
static |
Checks if I is the same operation as Op, distinguishing calls by intrinsic ID (all calls share the Call opcode, so e.g.
umax != smax).
Definition at line 321 of file SLPCompatibilityAnalysis.cpp.
References llvm::dyn_cast(), I, II, llvm::slpvectorizer::isEquivalentIntrinsicID(), and llvm::Intrinsic::not_intrinsic.
Referenced by getMatchingMainOpOrAltOp(), and isCopyableElement().
|
inline |
Checks if main/alt instructions are shift operations.
Definition at line 195 of file SLPCompatibilityAnalysis.h.
References getAltOp(), getMainOp(), and llvm::Instruction::isShift().
Referenced by slpvectorizer::BoUpSLP::canBuildSplitNode().
|
inlineexplicit |
Definition at line 220 of file SLPCompatibilityAnalysis.h.
References valid().
|
inline |
Sets the index of the operand the copyable value is modeled in.
Definition at line 258 of file SLPCompatibilityAnalysis.h.
References assert().
|
inline |
Checks if the current state is valid, i.e. has non-null MainOp.
Definition at line 218 of file SLPCompatibilityAnalysis.h.
Referenced by areInstructionsWithCopyableElements(), canConvertToFMA(), getAltOp(), getCopyableOpIdx(), getMainOp(), isCopyableElement(), isExpandedBinOp(), isNonSchedulable(), and operator bool().