R600/SI: Rough first implementation of shouldClusterLoads

llvm-svn: 217968
This commit is contained in:
Matt Arsenault 2014-09-17 17:48:30 +00:00
parent cce5701cdb
commit 0e75a06451
2 changed files with 26 additions and 0 deletions

View File

@ -260,6 +260,28 @@ bool SIInstrInfo::getLdStBaseRegImmOfs(MachineInstr *LdSt,
return false; return false;
} }
bool SIInstrInfo::shouldClusterLoads(MachineInstr *FirstLdSt,
MachineInstr *SecondLdSt,
unsigned NumLoads) const {
unsigned Opc0 = FirstLdSt->getOpcode();
unsigned Opc1 = SecondLdSt->getOpcode();
// TODO: This needs finer tuning
if (NumLoads > 4)
return false;
if (isDS(Opc0) && isDS(Opc1))
return true;
if (isSMRD(Opc0) && isSMRD(Opc1))
return true;
if ((isMUBUF(Opc0) || isMTBUF(Opc0)) && (isMUBUF(Opc1) || isMTBUF(Opc1)))
return true;
return false;
}
void void
SIInstrInfo::copyPhysReg(MachineBasicBlock &MBB, SIInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI, DebugLoc DL, MachineBasicBlock::iterator MI, DebugLoc DL,

View File

@ -70,6 +70,10 @@ public:
unsigned &BaseReg, unsigned &Offset, unsigned &BaseReg, unsigned &Offset,
const TargetRegisterInfo *TRI) const final; const TargetRegisterInfo *TRI) const final;
bool shouldClusterLoads(MachineInstr *FirstLdSt,
MachineInstr *SecondLdSt,
unsigned NumLoads) const final;
void copyPhysReg(MachineBasicBlock &MBB, void copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI, DebugLoc DL, MachineBasicBlock::iterator MI, DebugLoc DL,
unsigned DestReg, unsigned SrcReg, unsigned DestReg, unsigned SrcReg,