|
LLVM 24.0.0git
|
#include "llvm/CodeGen/GlobalISel/LegalizerInfo.h"
Public Member Functions | |
| virtual | ~LegalizerInfo ()=default |
| unsigned | getOpcodeIdxForOpcode (unsigned Opcode) const |
| unsigned | getActionDefinitionsIdx (unsigned Opcode) const |
| void | verify (const MCInstrInfo &MII) const |
| Perform simple self-diagnostic and assert if there is anything obviously wrong with the actions set up. | |
| const LegalizeRuleSet & | getActionDefinitions (unsigned Opcode) const |
| Get the action definitions for the given opcode. | |
| LegalizeRuleSet & | getActionDefinitionsBuilder (unsigned Opcode) |
| Get the action definition builder for the given opcode. | |
| LegalizeRuleSet & | getActionDefinitionsBuilder (std::initializer_list< unsigned > Opcodes) |
| Get the action definition builder for the given set of opcodes. | |
| void | aliasActionDefinitions (unsigned OpcodeTo, unsigned OpcodeFrom) |
| LegalizeActionStep | getAction (const LegalityQuery &Query) const |
| Determine what action should be taken to legalize the described instruction. | |
| LegalizeActionStep | getAction (const MachineInstr &MI, const MachineRegisterInfo &MRI) const |
| Determine what action should be taken to legalize the given generic instruction. | |
| bool | isLegal (const LegalityQuery &Query) const |
| bool | isLegalOrCustom (const LegalityQuery &Query) const |
| bool | isLegal (const MachineInstr &MI, const MachineRegisterInfo &MRI) const |
| bool | isLegalOrCustom (const MachineInstr &MI, const MachineRegisterInfo &MRI) const |
| virtual bool | legalizeCustom (LegalizerHelper &Helper, MachineInstr &MI, LostDebugLocObserver &LocObserver) const |
| Called for instructions with the Custom LegalizationAction. | |
| virtual bool | legalizeIntrinsic (LegalizerHelper &Helper, MachineInstr &MI) const |
| virtual unsigned | getExtOpcodeForWideningConstant (LLT SmallTy) const |
| Return the opcode (SEXT/ZEXT/ANYEXT) that should be performed while widening a constant of type SmallTy which targets can override. | |
Definition at line 1338 of file LegalizerInfo.h.
|
virtualdefault |
Definition at line 333 of file LegalizerInfo.cpp.
References assert(), and getOpcodeIdxForOpcode().
Referenced by getActionDefinitionsBuilder(), and ~LegalizerInfo().
| LegalizeActionStep LegalizerInfo::getAction | ( | const LegalityQuery & | Query | ) | const |
Determine what action should be taken to legalize the described instruction.
Requires computeTables to have been called.
Definition at line 342 of file LegalizerInfo.cpp.
References llvm::LegalizeRuleSet::apply(), getActionDefinitions(), and llvm::LegalityQuery::Opcode.
Referenced by getAction(), isLegal(), isLegal(), isLegalOrCustom(), isLegalOrCustom(), and ~LegalizerInfo().
| LegalizeActionStep LegalizerInfo::getAction | ( | const MachineInstr & | MI, |
| const MachineRegisterInfo & | MRI ) const |
Determine what action should be taken to legalize the given generic instruction.
Definition at line 347 of file LegalizerInfo.cpp.
References getAction(), getTypeFromTypeIdx(), MI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::SmallBitVector::set().
| const LegalizeRuleSet & LegalizerInfo::getActionDefinitions | ( | unsigned | Opcode | ) | const |
Get the action definitions for the given opcode.
Use this to run a LegalityQuery through the definitions.
Definition at line 306 of file LegalizerInfo.cpp.
References getActionDefinitionsIdx().
Referenced by getAction(), verify(), and ~LegalizerInfo().
| LegalizeRuleSet & LegalizerInfo::getActionDefinitionsBuilder | ( | std::initializer_list< unsigned > | Opcodes | ) |
Get the action definition builder for the given set of opcodes.
Use this to define the action definitions for multiple opcodes at once. The first opcode given will be considered the representative opcode and will hold the definitions whereas the other opcodes will be configured to refer to the representative opcode. This lowers memory requirements and very slightly improves performance.
It would be very easy to introduce unexpected side-effects as a result of this aliasing if it were permitted to request different but intersecting sets of opcodes but that is difficult to keep track of. It is therefore an error to request the same opcode twice using this API, to request an opcode that already has definitions, or to use the single-opcode API on an opcode that has already been requested by this API.
Definition at line 318 of file LegalizerInfo.cpp.
References aliasActionDefinitions(), assert(), llvm::drop_begin(), and getActionDefinitionsBuilder().
| LegalizeRuleSet & LegalizerInfo::getActionDefinitionsBuilder | ( | unsigned | Opcode | ) |
Get the action definition builder for the given opcode.
Use this to define the action definitions.
It is an error to request an opcode that has already been requested by the multiple-opcode variant.
Definition at line 311 of file LegalizerInfo.cpp.
References assert(), and getActionDefinitionsIdx().
Referenced by llvm::AArch64LegalizerInfo::AArch64LegalizerInfo(), llvm::AMDGPULegalizerInfo::AMDGPULegalizerInfo(), llvm::ARMLegalizerInfo::ARMLegalizerInfo(), getActionDefinitionsBuilder(), llvm::M68kLegalizerInfo::M68kLegalizerInfo(), llvm::MipsLegalizerInfo::MipsLegalizerInfo(), llvm::PPCLegalizerInfo::PPCLegalizerInfo(), llvm::RISCVLegalizerInfo::RISCVLegalizerInfo(), llvm::SPIRVLegalizerInfo::SPIRVLegalizerInfo(), llvm::WebAssemblyLegalizerInfo::WebAssemblyLegalizerInfo(), llvm::X86LegalizerInfo::X86LegalizerInfo(), and ~LegalizerInfo().
Definition at line 291 of file LegalizerInfo.cpp.
References assert(), llvm::dbgs(), getOpcodeIdxForOpcode(), LLVM_DEBUG, and VerboseVerifyLegalizerInfo.
Referenced by getActionDefinitions(), getActionDefinitionsBuilder(), and ~LegalizerInfo().
Return the opcode (SEXT/ZEXT/ANYEXT) that should be performed while widening a constant of type SmallTy which targets can override.
For eg, the DAG does (SmallTy.isByteSized() ? G_SEXT : G_ZEXT) which will be the default.
Definition at line 391 of file LegalizerInfo.cpp.
References llvm::LLT::isByteSized().
Definition at line 286 of file LegalizerInfo.cpp.
References assert().
Referenced by aliasActionDefinitions(), getActionDefinitionsIdx(), and ~LegalizerInfo().
|
inline |
Definition at line 1390 of file LegalizerInfo.h.
References getAction().
| bool LegalizerInfo::isLegal | ( | const MachineInstr & | MI, |
| const MachineRegisterInfo & | MRI ) const |
Definition at line 378 of file LegalizerInfo.cpp.
References llvm::LegalizeActionStep::Action, getAction(), llvm::LegalizeActions::Legal, and MI.
|
inline |
Definition at line 1394 of file LegalizerInfo.h.
References getAction().
| bool LegalizerInfo::isLegalOrCustom | ( | const MachineInstr & | MI, |
| const MachineRegisterInfo & | MRI ) const |
Definition at line 383 of file LegalizerInfo.cpp.
References llvm::LegalizeActionStep::Action, llvm::Custom, getAction(), llvm::LegalizeActions::Legal, and MI.
|
inlinevirtual |
Called for instructions with the Custom LegalizationAction.
Reimplemented in llvm::AArch64LegalizerInfo, llvm::AMDGPULegalizerInfo, llvm::ARMLegalizerInfo, llvm::MipsLegalizerInfo, llvm::RISCVLegalizerInfo, llvm::SPIRVLegalizerInfo, llvm::WebAssemblyLegalizerInfo, and llvm::X86LegalizerInfo.
Definition at line 1404 of file LegalizerInfo.h.
References llvm_unreachable, and MI.
|
inlinevirtual |
Reimplemented in llvm::AArch64LegalizerInfo, llvm::AMDGPULegalizerInfo, llvm::MipsLegalizerInfo, llvm::RISCVLegalizerInfo, llvm::SPIRVLegalizerInfo, and llvm::X86LegalizerInfo.
Definition at line 1413 of file LegalizerInfo.h.
References MI.
| void LegalizerInfo::verify | ( | const MCInstrInfo & | MII | ) | const |
Perform simple self-diagnostic and assert if there is anything obviously wrong with the actions set up.
Definition at line 396 of file LegalizerInfo.cpp.
References llvm::dbgs(), llvm::errs(), llvm::MCInstrInfo::get(), getActionDefinitions(), llvm::MCInstrInfo::getName(), LLVM_DEBUG, llvm::report_fatal_error(), VerboseVerifyLegalizerInfo, llvm::LegalizeRuleSet::verifyImmIdxsCoverage(), and llvm::LegalizeRuleSet::verifyTypeIdxsCoverage().