#include "X86.h"
#include "X86InstrBuilder.h"
#include "X86MachineFunctionInfo.h"
#include "X86RegisterInfo.h"
#include "X86Subtarget.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/Debug.h"
usingnamespacellvm;
#define DEBUG_TYPE …
STATISTIC(NumStores, "Number of stores added");
STATISTIC(NumLoads, "Number of loads added");
namespace {
class X86FastPreTileConfig : public MachineFunctionPass { … };
}
char X86FastPreTileConfig::ID = …;
INITIALIZE_PASS_BEGIN(X86FastPreTileConfig, DEBUG_TYPE,
"Fast Tile Register Preconfigure", false, false)
INITIALIZE_PASS_END(X86FastPreTileConfig, DEBUG_TYPE,
"Fast Tile Register Preconfigure", false, false)
static bool dominates(MachineBasicBlock &MBB,
MachineBasicBlock::const_iterator A,
MachineBasicBlock::const_iterator B) { … }
int X86FastPreTileConfig::getStackSpaceFor(Register VirtReg) { … }
bool X86FastPreTileConfig::mayLiveOut(Register VirtReg, MachineInstr *CfgMI) { … }
void X86FastPreTileConfig::InitializeTileConfigStackSpace() { … }
void X86FastPreTileConfig::spill(MachineBasicBlock::iterator Before,
Register VirtReg, bool Kill) { … }
void X86FastPreTileConfig::reload(MachineBasicBlock::iterator UseMI,
Register OrigReg, MachineOperand *RowMO,
MachineOperand *ColMO) { … }
static bool isTileDef(MachineRegisterInfo *MRI, MachineInstr &MI) { … }
static ShapeT getShape(MachineRegisterInfo *MRI, Register TileReg) { … }
void X86FastPreTileConfig::convertPHI(MachineBasicBlock *MBB,
MachineInstr &PHI) { … }
static bool isTileRegDef(MachineRegisterInfo *MRI, MachineInstr &MI) { … }
void X86FastPreTileConfig::canonicalizePHIs(MachineBasicBlock &MBB) { … }
void X86FastPreTileConfig::convertPHIs(MachineBasicBlock &MBB) { … }
bool X86FastPreTileConfig::configBasicBlock(MachineBasicBlock &MBB) { … }
bool X86FastPreTileConfig::runOnMachineFunction(MachineFunction &MFunc) { … }
FunctionPass *llvm::createX86FastPreTileConfigPass() { … }