|
LLVM
4.0.0
|
#include <LegalizerInfo.h>
Public Types | |
| enum | LegalizeAction : std::uint8_t { Legal, NarrowScalar, WidenScalar, FewerElements, MoreElements, Lower, Libcall, Custom, Unsupported, NotFound } |
Public Member Functions | |
| LegalizerInfo () | |
| void | computeTables () |
| Compute any ancillary tables needed to quickly decide how an operation should be handled. More... | |
| void | setAction (const InstrAspect &Aspect, LegalizeAction Action) |
| More friendly way to set an action for common types that have an LLT representation. More... | |
| void | setScalarInVectorAction (unsigned Opcode, LLT ScalarTy, LegalizeAction Action) |
| If an operation on a given vector type (say <M x="" in>="">) isn't explicitly specified, we proceed in 2 stages. More... | |
| std::pair< LegalizeAction, LLT > | getAction (const InstrAspect &Aspect) const |
| Determine what action should be taken to legalize the given generic instruction opcode, type-index and type. More... | |
| std::tuple< LegalizeAction, unsigned, LLT > | getAction (const MachineInstr &MI, const MachineRegisterInfo &MRI) const |
| Determine what action should be taken to legalize the given generic instruction. More... | |
| LLT | findLegalType (const InstrAspect &Aspect, std::function< LLT(LLT)> NextType) const |
| Iterate the given function (typically something like doubling the width) on Ty until we find a legal type for this operation. More... | |
| LLT | findLegalType (const InstrAspect &Aspect, LegalizeAction Action) const |
| Find what type it's actually OK to perform the given operation on, given the general approach we've decided to take. More... | |
| std::pair< LegalizeAction, LLT > | findLegalAction (const InstrAspect &Aspect, LegalizeAction Action) const |
| LegalizeAction | findInActions (const InstrAspect &Aspect) const |
Find the specified Aspect in the primary (explicitly set) Actions table. More... | |
| bool | isLegal (const MachineInstr &MI, const MachineRegisterInfo &MRI) const |
Definition at line 49 of file LegalizerInfo.h.
| enum llvm::LegalizerInfo::LegalizeAction : std::uint8_t |
Definition at line 51 of file LegalizerInfo.h.
| LegalizerInfo::LegalizerInfo | ( | ) |
Definition at line 30 of file LegalizerInfo.cpp.
References Legal, NarrowScalar, and WidenScalar.
| void LegalizerInfo::computeTables | ( | ) |
Compute any ancillary tables needed to quickly decide how an operation should be handled.
This must be called after all "set*Action"methods but before any query is made or incorrect results may be returned.
Definition at line 46 of file LegalizerInfo.cpp.
References llvm::LLT::getElementType(), llvm::LLT::getNumElements(), and llvm::LLT::isVector().
Referenced by llvm::AArch64LegalizerInfo::AArch64LegalizerInfo(), and llvm::ARMLegalizerInfo::ARMLegalizerInfo().
|
inline |
Find the specified Aspect in the primary (explicitly set) Actions table.
Returns either the action the target requested or NotFound if there was no setAction call.
Definition at line 174 of file LegalizerInfo.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::InstrAspect::Idx, NotFound, llvm::InstrAspect::Opcode, and llvm::InstrAspect::Type.
Referenced by getAction().
|
inline |
Definition at line 166 of file LegalizerInfo.h.
References findLegalType().
Referenced by getAction().
|
inline |
Iterate the given function (typically something like doubling the width) on Ty until we find a legal type for this operation.
Definition at line 146 of file LegalizerInfo.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::InstrAspect::Idx, Legal, llvm::InstrAspect::Opcode, and llvm::InstrAspect::Type.
Referenced by findLegalAction(), and findLegalType().
| LLT LegalizerInfo::findLegalType | ( | const InstrAspect & | Aspect, |
| LegalizeAction | Action | ||
| ) | const |
Find what type it's actually OK to perform the given operation on, given the general approach we've decided to take.
Definition at line 155 of file LegalizerInfo.cpp.
References llvm::LLT::doubleElements(), llvm::LLT::doubleScalarSize(), FewerElements, findLegalType(), llvm::LLT::getSizeInBits(), llvm::LLT::halfElements(), llvm::LLT::halfScalarSize(), Legal, Libcall, llvm_unreachable, Lower, MoreElements, NarrowScalar, llvm::LLT::scalar(), llvm::InstrAspect::Type, and WidenScalar.
| std::pair< LegalizerInfo::LegalizeAction, LLT > LegalizerInfo::getAction | ( | const InstrAspect & | Aspect | ) | const |
Determine what action should be taken to legalize the given generic instruction opcode, type-index and type.
Requires computeTables to have been called.
Definition at line 69 of file LegalizerInfo.cpp.
References assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), FewerElements, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), findInActions(), findLegalAction(), llvm::LLT::getElementType(), llvm::LLT::getNumElements(), llvm::LLT::getSizeInBits(), llvm::isPowerOf2_64(), llvm::LLT::isVector(), Legal, MoreElements, NarrowScalar, NotFound, llvm::InstrAspect::Opcode, llvm::InstrAspect::Type, and Unsupported.
Referenced by getAction(), isLegal(), and llvm::LegalizerHelper::legalizeInstrStep().
| std::tuple< LegalizerInfo::LegalizeAction, unsigned, LLT > LegalizerInfo::getAction | ( | const MachineInstr & | MI, |
| const MachineRegisterInfo & | MRI | ||
| ) | const |
Determine what action should be taken to legalize the given generic instruction.
Definition at line 126 of file LegalizerInfo.cpp.
References getAction(), llvm::MachineInstr::getDesc(), llvm::MCOperandInfo::getGenericTypeIndex(), llvm::MCInstrDesc::getNumOperands(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getType(), i, Legal, llvm::MCInstrDesc::OpInfo, and llvm::SmallBitVector::set().
| bool LegalizerInfo::isLegal | ( | const MachineInstr & | MI, |
| const MachineRegisterInfo & | MRI | ||
| ) | const |
Definition at line 150 of file LegalizerInfo.cpp.
References getAction(), and Legal.
|
inline |
More friendly way to set an action for common types that have an LLT representation.
Definition at line 107 of file LegalizerInfo.h.
References llvm::InstrAspect::Idx, llvm::InstrAspect::Opcode, and llvm::InstrAspect::Type.
Referenced by llvm::AArch64LegalizerInfo::AArch64LegalizerInfo(), and llvm::ARMLegalizerInfo::ARMLegalizerInfo().
|
inline |
If an operation on a given vector type (say <M x="" in>="">) isn't explicitly specified, we proceed in 2 stages.
First we legalize the underlying scalar (so that there's at least one legal vector with that scalar), then we adjust the number of elements in the vector so that it is legal. The desired action in the first step is controlled by this function.
Definition at line 120 of file LegalizerInfo.h.
References assert(), and llvm::LLT::isVector().
1.8.6