R600/SI: Implement SIInstrInfo::isTriviallyRematerializable()

llvm-svn: 205188
This commit is contained in:
Tom Stellard 2014-03-31 14:01:56 +00:00
parent 7ea3d6d420
commit 30f59417cf
2 changed files with 15 additions and 0 deletions

View File

@ -308,6 +308,18 @@ SIInstrInfo::isSafeToMoveRegClassDefs(const TargetRegisterClass *RC) const {
return RC != &AMDGPU::EXECRegRegClass;
}
bool
SIInstrInfo::isTriviallyReMaterializable(const MachineInstr *MI,
AliasAnalysis *AA) const {
switch(MI->getOpcode()) {
default: return AMDGPUInstrInfo::isTriviallyReMaterializable(MI, AA);
case AMDGPU::S_MOV_B32:
case AMDGPU::S_MOV_B64:
case AMDGPU::V_MOV_B32_e32:
return MI->getOperand(1).isImm();
}
}
namespace llvm {
namespace AMDGPU {
// Helper function generated by tablegen. We are wrapping this with

View File

@ -77,6 +77,9 @@ public:
virtual MachineInstr *commuteInstruction(MachineInstr *MI,
bool NewMI=false) const;
bool isTriviallyReMaterializable(const MachineInstr *MI,
AliasAnalysis *AA = 0) const;
virtual unsigned getIEQOpcode() const {
llvm_unreachable("Unimplemented");
}