mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-03-03 08:02:41 +00:00
R600/SI: Implement SIInstrInfo::isTriviallyRematerializable()
llvm-svn: 205188
This commit is contained in:
parent
7ea3d6d420
commit
30f59417cf
@ -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
|
||||
|
@ -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");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user