9#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUREGBANKLEGALIZERULES_H
10#define LLVM_LIB_TARGET_AMDGPU_AMDGPUREGBANKLEGALIZERULES_H
31bool isAnyPtr(LLT Ty,
unsigned Width);
240 std::initializer_list<RegBankLLTMappingApplyID> DstOpMappingList,
241 std::initializer_list<RegBankLLTMappingApplyID> SrcOpMappingList,
249 std::initializer_list<UniformityLLTOpPredicateID> OpList,
271#define InvMapping RegBankLLTMapping({InvalidMapping}, {InvalidMapping})
279 const RegBankLLTMapping &
283 void addRule(RegBankLegalizeRule Rule);
286 RegBankLLTMapping RuleApplyIDs);
288 RegBankLLTMapping RuleApplyIDs);
307 class RuleSetInitializer {
313 template <
class AliasMap,
class RulesMap>
314 RuleSetInitializer(std::initializer_list<unsigned> OpcList,
315 AliasMap &RulesAlias, RulesMap &Rules,
317 unsigned KeyOpcode = *OpcList.begin();
318 for (
unsigned Opc : OpcList) {
319 [[maybe_unused]]
auto [
_, NewInput] =
320 RulesAlias.try_emplace(
Opc, KeyOpcode);
321 assert(NewInput &&
"Can't redefine existing Rules");
324 auto [DenseMapIter, NewInput] = Rules.try_emplace(KeyOpcode, FastTypes);
325 assert(NewInput &&
"Can't redefine existing Rules");
327 RuleSet = &DenseMapIter->second;
330 RuleSetInitializer(
const RuleSetInitializer &) =
delete;
331 RuleSetInitializer &operator=(
const RuleSetInitializer &) =
delete;
332 RuleSetInitializer(RuleSetInitializer &&) =
delete;
333 RuleSetInitializer &operator=(RuleSetInitializer &&) =
delete;
334 ~RuleSetInitializer() =
default;
338 bool STPred =
true) {
346 bool STPred =
true) {
359 RuleSetInitializer addRulesForGOpcs(std::initializer_list<unsigned> OpcList,
362 RuleSetInitializer addRulesForIOpcs(std::initializer_list<unsigned> OpcList,
unsigned const MachineRegisterInfo * MRI
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the DenseMap class.
This file defines the SmallVector class.
RegBankLegalizeRules(const GCNSubtarget &ST, MachineRegisterInfo &MRI)
const SetOfRulesForOpcode & getRulesForOpc(MachineInstr &MI) const
void refreshRefs(const GCNSubtarget &_ST, MachineRegisterInfo &_MRI)
void addRule(RegBankLegalizeRule Rule)
const RegBankLLTMapping & findMappingForMI(const MachineInstr &MI, const MachineRegisterInfo &MRI, const MachineUniformityInfo &MUI) const
void addFastRuleDivergent(UniformityLLTOpPredicateID Ty, RegBankLLTMapping RuleApplyIDs)
void addFastRuleUniform(UniformityLLTOpPredicateID Ty, RegBankLLTMapping RuleApplyIDs)
Representation of each machine instruction.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
bool isAnyPtr(LLT Ty, unsigned Width)
UniformityLLTOpPredicateID
This is an optimization pass for GlobalISel generic memory operations.
GenericUniformityInfo< MachineSSAContext > MachineUniformityInfo
GenericSSAContext< MachineFunction > MachineSSAContext
SmallVector< UniformityLLTOpPredicateID, 4 > OpUniformityAndTypes
PredicateMapping(std::initializer_list< UniformityLLTOpPredicateID > OpList, std::function< bool(const MachineInstr &)> TestFunc=nullptr)
bool match(const MachineInstr &MI, const MachineUniformityInfo &MUI, const MachineRegisterInfo &MRI) const
std::function< bool(const MachineInstr &)> TestFunc
LoweringMethodID LoweringMethod
RegBankLLTMapping(std::initializer_list< RegBankLLTMappingApplyID > DstOpMappingList, std::initializer_list< RegBankLLTMappingApplyID > SrcOpMappingList, LoweringMethodID LoweringMethod=DoNotLower)
SmallVector< RegBankLLTMappingApplyID, 2 > DstOpMapping
SmallVector< RegBankLLTMappingApplyID, 4 > SrcOpMapping
PredicateMapping Predicate
RegBankLLTMapping OperandMapping