34#define DEBUG_TYPE "fasttileconfig"
53 return "Fast Tile Register Configure";
66 MachineFunctionProperties::Property::NoPHIs);
74char X86FastTileConfig::ID = 0;
77 "Fast Tile Register Configure",
false,
false)
86 if (
MI.isDebugInstr() ||
MI.isCopy() ||
MI.getNumOperands() < 3 ||
95 if (Reg.isVirtual()) {
96 if (
MRI->getRegClass(Reg)->getID() == X86::TILERegClassID)
98 if (
MRI->getRegClass(Reg)->getID() == X86::TILEPAIRRegClassID)
101 if (Reg >= X86::TMM0 && Reg <= X86::TMM7)
103 if (Reg >= X86::TMM0_TMM1 && Reg <= X86::TMM6_TMM7)
111 if (Reg >= X86::TMM0 && Reg <= X86::TMM7)
112 return Reg - X86::TMM0;
113 if (Reg >= X86::TMM0_TMM1 && Reg <= X86::TMM6_TMM7)
114 return (Reg - X86::TMM0_TMM1) * 2;
125 if (DefNum == 0 &&
MI.getOpcode() != X86::PLDTILECFGV)
128 if (
MI.getOpcode() != X86::PLDTILECFGV) {
131 for (
unsigned I = 0;
I < DefNum;
I++) {
138 int SS =
MI.getOperand(0).getIndex();
139 for (
auto &ShapeInfo : ShapeInfos) {
141 unsigned TMMIdx = ShapeInfo.first;
142 Register RowReg = ShapeInfo.second.getRow()->getReg();
143 Register ColReg = ShapeInfo.second.getCol()->getReg();
160 int RowOffset = 48 + TMMIdx;
161 int ColOffset = 16 + TMMIdx * 2;
163 Register SubRowReg =
TRI->getSubReg(RowReg, X86::sub_8bit);
184 if (X86FI->getAMXProgModel() != AMXProgModelEnum::ManagedRA)
190 TRI =
ST->getRegisterInfo();
196 Change |= configBasicBlock(
MBB);
202 return new X86FastTileConfig();
unsigned const MachineRegisterInfo * MRI
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
const HexagonInstrInfo * TII
unsigned const TargetRegisterInfo * TRI
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Fast Tile Register static false unsigned getNumDefTiles(MachineRegisterInfo *MRI, MachineInstr &MI)
static unsigned getTMMIndex(Register Reg)
Fast Tile Register Configure
Represent the analysis usage information of a pass.
void setPreservesAll()
Set by analyses that do not transform their input at all.
FunctionPass class - This class is used to implement most global optimizations.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
virtual bool runOnMachineFunction(MachineFunction &MF)=0
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
virtual MachineFunctionProperties getRequiredProperties() const
Properties which a MachineFunction may have at a given point in time.
MachineFunctionProperties & set(Property P)
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
Representation of each machine instruction.
MachineOperand class - Representation of each machine instruction operand.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
Register getReg() const
getReg - Returns the register number.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
virtual StringRef getPassName() const
getPassName - Return a nice clean name for a pass.
Wrapper class representing virtual and physical registers.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
TargetInstrInfo - Interface to description of machine instruction set.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
TargetSubtargetInfo - Generic base class for all target subtargets.
virtual const TargetInstrInfo * getInstrInfo() const
X86MachineFunctionInfo - This class is derived from MachineFunction and contains private X86 target-s...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ Fast
Attempts to make calls as fast as possible (e.g.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
static const MachineInstrBuilder & addFrameReference(const MachineInstrBuilder &MIB, int FI, int Offset=0, bool mem=true)
addFrameReference - This function is used to add a reference to the base of an abstract object on the...
auto reverse(ContainerTy &&C)
FunctionPass * createX86FastTileConfigPass()
Return a pass that config the tile registers after fast reg allocation.