39#define DEBUG_TYPE "tileconfig"
63 MachineFunctionProperties::Property::NoPHIs);
71char X86TileConfig::ID = 0;
89 LiveIntervals &LIS = getAnalysis<LiveIntervalsWrapperPass>().getLIS();
98 if (
MI.getOpcode() == X86::PLDTILECFGV) {
99 SS =
MI.getOperand(0).getIndex();
112 unsigned ConstPos = 0;
115 if (
MI.getOpcode() == X86::MOV8mi && SS ==
MI.getOperand(0).getIndex()) {
121 assert(ConstMI &&
"Cannot find an insertion point");
123 unsigned AMXRegNum =
TRI->getRegClass(X86::TILERegClassID)->getNumRegs();
125 for (
unsigned I = 0, E =
MRI.getNumVirtRegs();
I != E; ++
I) {
127 if (
MRI.reg_nodbg_empty(VirtReg))
129 if (
MRI.getRegClass(VirtReg)->getID() != X86::TILERegClassID)
134 if (!Phys2Virt[
Index])
135 Phys2Virt[
Index] = VirtReg;
139 for (
unsigned I = 0;
I < AMXRegNum; ++
I) {
164 int Offset = IsRow ? 48 +
I : 16 +
I * 2;
165 for (
auto &
DefMI :
MRI.def_instructions(R)) {
167 if (
DefMI.isMoveImmediate()) {
171 "Cannot initialize with different shapes");
174 Imm =
DefMI.getOperand(1).getImm();
177 TII->get(IsRow ? X86::MOV8mi : X86::MOV16mi)),
183 unsigned SubIdx = IsRow ? X86::sub_8bit : X86::sub_16bit;
184 unsigned RegSize =
TRI->getRegSizeInBits(*
MRI.getRegClass(R));
187 auto Iter =
DefMI.getIterator();
193 TII->get(IsRow ? X86::MOV8mr : X86::MOV16mr)),
unsigned const MachineRegisterInfo * MRI
MachineInstrBuilder MachineInstrBuilder & DefMI
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
const HexagonInstrInfo * TII
unsigned const TargetRegisterInfo * TRI
static unsigned getReg(const MCDisassembler *D, unsigned RC, unsigned RegNo)
#define INITIALIZE_PASS_DEPENDENCY(depName)
#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())
Represent the analysis usage information of a pass.
AnalysisUsage & addRequired()
void setPreservesAll()
Set by analyses that do not transform their input at all.
FunctionPass class - This class is used to implement most global optimizations.
SlotIndex InsertMachineInstrInMaps(MachineInstr &MI)
LiveInterval & getInterval(Register Reg)
void extendToIndices(LiveRange &LR, ArrayRef< SlotIndex > Indices, ArrayRef< SlotIndex > Undefs)
Extend the live range LR to reach all points in Indices.
instr_iterator instr_begin()
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 MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
Representation of each machine instruction.
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.
static Register index2VirtReg(unsigned Index)
Convert a 0-based index to a virtual register number.
MachineOperand * getRow() const
MachineOperand * getCol() const
SlotIndex - An opaque wrapper around machine indexes.
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...
ShapeT getShape(Register virtReg) const
MCRegister getPhys(Register virtReg) const
returns the physical register mapped to the specified virtual register
bool isShapeMapEmpty() const
X86MachineFunctionInfo - This class is derived from MachineFunction and contains private X86 target-s...
AMXProgModelEnum getAMXProgModel() const
self_iterator getIterator()
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...
FunctionPass * createX86TileConfigPass()
Return a pass that config the tile registers.