9#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUREGBANKLEGALIZERULES_H
10#define LLVM_LIB_TARGET_AMDGPU_AMDGPUREGBANKLEGALIZERULES_H
18class MachineRegisterInfo;
22template <
typename T>
class GenericUniformityInfo;
23template <
typename T>
class GenericSSAContext;
186 std::initializer_list<RegBankLLTMappingApplyID> DstOpMappingList,
187 std::initializer_list<RegBankLLTMappingApplyID> SrcOpMappingList,
195 std::initializer_list<UniformityLLTOpPredicateID> OpList,
217#define InvMapping RegBankLLTMapping({InvalidMapping}, {InvalidMapping})
225 const RegBankLLTMapping &
229 void addRule(RegBankLegalizeRule Rule);
232 RegBankLLTMapping RuleApplyIDs);
234 RegBankLLTMapping RuleApplyIDs);
253 class RuleSetInitializer {
259 template <
class AliasMap,
class RulesMap>
260 RuleSetInitializer(std::initializer_list<unsigned> OpcList,
261 AliasMap &RulesAlias, RulesMap &Rules,
263 unsigned KeyOpcode = *OpcList.begin();
264 for (
unsigned Opc : OpcList) {
265 [[maybe_unused]]
auto [
_, NewInput] =
266 RulesAlias.try_emplace(Opc, KeyOpcode);
267 assert(NewInput &&
"Can't redefine existing Rules");
270 auto [DenseMapIter, NewInput] = Rules.try_emplace(KeyOpcode, FastTypes);
271 assert(NewInput &&
"Can't redefine existing Rules");
273 RuleSet = &DenseMapIter->second;
276 RuleSetInitializer(
const RuleSetInitializer &) =
delete;
277 RuleSetInitializer &operator=(
const RuleSetInitializer &) =
delete;
278 RuleSetInitializer(RuleSetInitializer &&) =
delete;
279 RuleSetInitializer &operator=(RuleSetInitializer &&) =
delete;
280 ~RuleSetInitializer() =
default;
284 bool STPred =
true) {
292 bool STPred =
true) {
305 RuleSetInitializer addRulesForGOpcs(std::initializer_list<unsigned> OpcList,
308 RuleSetInitializer addRulesForIOpcs(std::initializer_list<unsigned> OpcList,
unsigned const MachineRegisterInfo * MRI
This file defines the DenseMap class.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallVector class.
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.
UniformityLLTOpPredicateID
This is an optimization pass for GlobalISel generic memory operations.
GenericSSAContext< MachineFunction > MachineSSAContext
GenericUniformityInfo< MachineSSAContext > MachineUniformityInfo
SmallVector< UniformityLLTOpPredicateID, 4 > OpUniformityAndTypes
bool match(const MachineInstr &MI, const MachineUniformityInfo &MUI, const MachineRegisterInfo &MRI) const
std::function< bool(const MachineInstr &)> TestFunc
LoweringMethodID LoweringMethod
SmallVector< RegBankLLTMappingApplyID, 2 > DstOpMapping
SmallVector< RegBankLLTMappingApplyID, 4 > SrcOpMapping
PredicateMapping Predicate
RegBankLLTMapping OperandMapping