LLVM  10.0.0svn
Public Member Functions | List of all members
llvm::AMDGPULegalizerInfo Class Reference

This class provides the information for the target register banks. More...

#include "Target/AMDGPU/AMDGPULegalizerInfo.h"

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

Public Member Functions

 AMDGPULegalizerInfo (const GCNSubtarget &ST, const GCNTargetMachine &TM)
 
bool legalizeCustom (MachineInstr &MI, MachineRegisterInfo &MRI, MachineIRBuilder &MIRBuilder, GISelChangeObserver &Observer) const override
 
Register getSegmentAperture (unsigned AddrSpace, MachineRegisterInfo &MRI, MachineIRBuilder &MIRBuilder) const
 
bool legalizeAddrSpaceCast (MachineInstr &MI, MachineRegisterInfo &MRI, MachineIRBuilder &MIRBuilder) const
 
bool legalizeFrint (MachineInstr &MI, MachineRegisterInfo &MRI, MachineIRBuilder &MIRBuilder) const
 
bool legalizeFceil (MachineInstr &MI, MachineRegisterInfo &MRI, MachineIRBuilder &MIRBuilder) const
 
bool legalizeIntrinsicTrunc (MachineInstr &MI, MachineRegisterInfo &MRI, MachineIRBuilder &MIRBuilder) const
 
bool legalizeITOFP (MachineInstr &MI, MachineRegisterInfo &MRI, MachineIRBuilder &MIRBuilder, bool Signed) const
 
bool legalizeMinNumMaxNum (MachineInstr &MI, MachineRegisterInfo &MRI, MachineIRBuilder &MIRBuilder) const
 
bool legalizeExtractVectorElt (MachineInstr &MI, MachineRegisterInfo &MRI, MachineIRBuilder &MIRBuilder) const
 
bool legalizeInsertVectorElt (MachineInstr &MI, MachineRegisterInfo &MRI, MachineIRBuilder &MIRBuilder) const
 
Register getLiveInRegister (MachineRegisterInfo &MRI, Register Reg, LLT Ty) const
 
bool loadInputValue (Register DstReg, MachineIRBuilder &B, const ArgDescriptor *Arg) const
 
bool legalizePreloadedArgIntrin (MachineInstr &MI, MachineRegisterInfo &MRI, MachineIRBuilder &B, AMDGPUFunctionArgInfo::PreloadedValue ArgType) const
 
bool legalizeImplicitArgPtr (MachineInstr &MI, MachineRegisterInfo &MRI, MachineIRBuilder &B) const
 
bool legalizeIntrinsic (MachineInstr &MI, MachineRegisterInfo &MRI, MachineIRBuilder &MIRBuilder) const override
 Return true if MI is either legal or has been legalized and false if not legal. More...
 
- Public Member Functions inherited from llvm::LegalizerInfo
 LegalizerInfo ()
 
virtual ~LegalizerInfo ()=default
 
unsigned getOpcodeIdxForOpcode (unsigned Opcode) const
 
unsigned getActionDefinitionsIdx (unsigned Opcode) const
 
void computeTables ()
 Compute any ancillary tables needed to quickly decide how an operation should be handled. More...
 
void verify (const MCInstrInfo &MII) const
 Perform simple self-diagnostic and assert if there is anything obviously wrong with the actions set up. 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 setLegalizeScalarToDifferentSizeStrategy (const unsigned Opcode, const unsigned TypeIdx, SizeChangeStrategy S)
 The setAction calls record the non-size-changing legalization actions to take on specificly-sized types. More...
 
void setLegalizeVectorElementToDifferentSizeStrategy (const unsigned Opcode, const unsigned TypeIdx, SizeChangeStrategy S)
 See also setLegalizeScalarToDifferentSizeStrategy. More...
 
const LegalizeRuleSetgetActionDefinitions (unsigned Opcode) const
 Get the action definitions for the given opcode. More...
 
LegalizeRuleSetgetActionDefinitionsBuilder (unsigned Opcode)
 Get the action definition builder for the given opcode. More...
 
LegalizeRuleSetgetActionDefinitionsBuilder (std::initializer_list< unsigned > Opcodes)
 Get the action definition builder for the given set of opcodes. More...
 
void aliasActionDefinitions (unsigned OpcodeTo, unsigned OpcodeFrom)
 
LegalizeActionStep getAction (const LegalityQuery &Query) const
 Determine what action should be taken to legalize the described instruction. More...
 
LegalizeActionStep getAction (const MachineInstr &MI, const MachineRegisterInfo &MRI) const
 Determine what action should be taken to legalize the given generic instruction. More...
 
bool isLegal (const LegalityQuery &Query) const
 
bool isLegal (const MachineInstr &MI, const MachineRegisterInfo &MRI) const
 
bool isLegalOrCustom (const MachineInstr &MI, const MachineRegisterInfo &MRI) const
 

Additional Inherited Members

- Public Types inherited from llvm::LegalizerInfo
using SizeAndAction = std::pair< uint16_t, LegalizeAction >
 
using SizeAndActionsVec = std::vector< SizeAndAction >
 
using SizeChangeStrategy = std::function< SizeAndActionsVec(const SizeAndActionsVec &v)>
 
- Static Public Member Functions inherited from llvm::LegalizerInfo
static bool needsLegalizingToDifferentSize (const LegalizeAction Action)
 
static SizeAndActionsVec unsupportedForDifferentSizes (const SizeAndActionsVec &v)
 A SizeChangeStrategy for the common case where legalization for a particular operation consists of only supporting a specific set of type sizes. More...
 
static SizeAndActionsVec widenToLargerTypesAndNarrowToLargest (const SizeAndActionsVec &v)
 A SizeChangeStrategy for the common case where legalization for a particular operation consists of widening the type to a large legal type, unless there is no such type and then instead it should be narrowed to the largest legal type. More...
 
static SizeAndActionsVec widenToLargerTypesUnsupportedOtherwise (const SizeAndActionsVec &v)
 
static SizeAndActionsVec narrowToSmallerAndUnsupportedIfTooSmall (const SizeAndActionsVec &v)
 
static SizeAndActionsVec narrowToSmallerAndWidenToSmallest (const SizeAndActionsVec &v)
 
static SizeAndActionsVec moreToWiderTypesAndLessToWidest (const SizeAndActionsVec &v)
 A SizeChangeStrategy for the common case where legalization for a particular vector operation consists of having more elements in the vector, to a type that is legal. More...
 
static SizeAndActionsVec increaseToLargerTypesAndDecreaseToLargest (const SizeAndActionsVec &v, LegalizeAction IncreaseAction, LegalizeAction DecreaseAction)
 Helper function to implement many typical SizeChangeStrategy functions. More...
 
static SizeAndActionsVec decreaseToSmallerTypesAndIncreaseToSmallest (const SizeAndActionsVec &v, LegalizeAction DecreaseAction, LegalizeAction IncreaseAction)
 Helper function to implement many typical SizeChangeStrategy functions. More...
 

Detailed Description

This class provides the information for the target register banks.

Definition at line 27 of file AMDGPULegalizerInfo.h.

Constructor & Destructor Documentation

◆ AMDGPULegalizerInfo()

AMDGPULegalizerInfo::AMDGPULegalizerInfo ( const GCNSubtarget ST,
const GCNTargetMachine TM 
)

Definition at line 101 of file AMDGPULegalizerInfo.cpp.

References llvm::LegalityPredicates::all(), llvm::LegalizeRuleSet::clampMaxNumElements(), llvm::LegalizeRuleSet::clampNumElements(), llvm::LegalizeRuleSet::clampScalar(), llvm::LegalizeRuleSet::clampScalarOrElt(), llvm::LegalizerInfo::computeTables(), AMDGPUAS::CONSTANT_ADDRESS, llvm::LegalizeRuleSet::custom(), llvm::LegalizeRuleSet::customFor(), llvm::LegalizeRuleSet::customIf(), llvm::LegalizeRuleSet::fewerElementsIf(), fewerEltsToSize64Vector(), AMDGPUAS::FLAT_ADDRESS, llvm::LegalizerInfo::getActionDefinitionsBuilder(), llvm::LLT::getElementType(), llvm::TargetMachine::getPointerSizeInBits(), llvm::LLT::getScalarSizeInBits(), llvm::LLT::getScalarType(), llvm::LLT::getSizeInBits(), AMDGPUAS::GLOBAL_ADDRESS, isMultiple32(), llvm::LegalityPredicates::isPointer(), llvm::isPowerOf2_32(), isRegisterType(), isSmallOddVector(), llvm::LLT::isVector(), llvm::LegalizeActions::Legal, llvm::LegalizeRuleSet::legalFor(), llvm::LegalizeRuleSet::legalForCartesianProduct(), llvm::LegalizeRuleSet::legalForTypesWithMemDesc(), llvm::LegalizeRuleSet::legalIf(), AMDGPUAS::LOCAL_ADDRESS, llvm::Log2_32_Ceil(), llvm::LegalizeRuleSet::lower(), llvm::LegalizeRuleSet::minScalarOrElt(), llvm::LegalizeRuleSet::minScalarSameAs(), llvm::LegalityQuery::MMODescrs, llvm::LegalizeRuleSet::moreElementsIf(), numElementsNotEven(), oneMoreElement(), llvm::LLT::pointer(), AMDGPUAS::PRIVATE_ADDRESS, llvm::LegalityPredicates::sameSize(), llvm::LLT::scalar(), llvm::LegalizeMutations::scalarize(), llvm::LegalizeRuleSet::scalarize(), llvm::AMDGPUSubtarget::SEA_ISLANDS, llvm::LegalizerInfo::setAction(), Size, llvm::SystemZISD::TM, llvm::LegalityPredicates::typeIs(), llvm::LegalityQuery::Types, llvm::LegalizeRuleSet::unsupportedIf(), llvm::LegalizeRuleSet::unsupportedIfMemSizeNotPow2(), llvm::LLT::vector(), vectorWiderThan(), llvm::LegalizerInfo::verify(), llvm::LegalizeRuleSet::widenScalarIf(), llvm::LegalizeMutations::widenScalarOrEltToNextPow2(), and llvm::LegalizeRuleSet::widenScalarToNextPow2().

Member Function Documentation

◆ getLiveInRegister()

Register AMDGPULegalizerInfo::getLiveInRegister ( MachineRegisterInfo MRI,
Register  Reg,
LLT  Ty 
) const

◆ getSegmentAperture()

Register AMDGPULegalizerInfo::getSegmentAperture ( unsigned  AddrSpace,
MachineRegisterInfo MRI,
MachineIRBuilder MIRBuilder 
) const

◆ legalizeAddrSpaceCast()

bool AMDGPULegalizerInfo::legalizeAddrSpaceCast ( MachineInstr MI,
MachineRegisterInfo MRI,
MachineIRBuilder MIRBuilder 
) const

◆ legalizeCustom()

bool AMDGPULegalizerInfo::legalizeCustom ( MachineInstr MI,
MachineRegisterInfo MRI,
MachineIRBuilder MIRBuilder,
GISelChangeObserver Observer 
) const
overridevirtual

◆ legalizeExtractVectorElt()

bool AMDGPULegalizerInfo::legalizeExtractVectorElt ( MachineInstr MI,
MachineRegisterInfo MRI,
MachineIRBuilder MIRBuilder 
) const

◆ legalizeFceil()

bool AMDGPULegalizerInfo::legalizeFceil ( MachineInstr MI,
MachineRegisterInfo MRI,
MachineIRBuilder MIRBuilder 
) const

◆ legalizeFrint()

bool AMDGPULegalizerInfo::legalizeFrint ( MachineInstr MI,
MachineRegisterInfo MRI,
MachineIRBuilder MIRBuilder 
) const

◆ legalizeImplicitArgPtr()

bool AMDGPULegalizerInfo::legalizeImplicitArgPtr ( MachineInstr MI,
MachineRegisterInfo MRI,
MachineIRBuilder B 
) const

◆ legalizeInsertVectorElt()

bool AMDGPULegalizerInfo::legalizeInsertVectorElt ( MachineInstr MI,
MachineRegisterInfo MRI,
MachineIRBuilder MIRBuilder 
) const

◆ legalizeIntrinsic()

bool AMDGPULegalizerInfo::legalizeIntrinsic ( MachineInstr MI,
MachineRegisterInfo MRI,
MachineIRBuilder MIRBuilder 
) const
overridevirtual

◆ legalizeIntrinsicTrunc()

bool AMDGPULegalizerInfo::legalizeIntrinsicTrunc ( MachineInstr MI,
MachineRegisterInfo MRI,
MachineIRBuilder MIRBuilder 
) const

◆ legalizeITOFP()

bool AMDGPULegalizerInfo::legalizeITOFP ( MachineInstr MI,
MachineRegisterInfo MRI,
MachineIRBuilder MIRBuilder,
bool  Signed 
) const

◆ legalizeMinNumMaxNum()

bool AMDGPULegalizerInfo::legalizeMinNumMaxNum ( MachineInstr MI,
MachineRegisterInfo MRI,
MachineIRBuilder MIRBuilder 
) const

◆ legalizePreloadedArgIntrin()

bool AMDGPULegalizerInfo::legalizePreloadedArgIntrin ( MachineInstr MI,
MachineRegisterInfo MRI,
MachineIRBuilder B,
AMDGPUFunctionArgInfo::PreloadedValue  ArgType 
) const

◆ loadInputValue()

bool AMDGPULegalizerInfo::loadInputValue ( Register  DstReg,
MachineIRBuilder B,
const ArgDescriptor Arg 
) const

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