return true;
}
- static bool isPhimove(MachineInstr *instr) {
- switch (instr->getOpcode()) {
- ExpandCaseToAllTypes(AMDIL::MOVE);
- break;
- default:
- return false;
- }
- return true;
- }
-
static DebugLoc getLastDebugLocInBB(MachineBasicBlock *blk) {
//get DebugLoc from the first MachineBasicBlock instruction with debug info
DebugLoc DL;
// instruction. Such move instruction "belong to" the loop backward-edge.
//
static MachineInstr *getLoopendBlockBranchInstr(MachineBasicBlock *blk) {
+ const AMDILInstrInfo * TII = static_cast<const AMDILInstrInfo *>(
+ blk->getParent()->getTarget().getInstrInfo());
+
for (MachineBasicBlock::reverse_iterator iter = blk->rbegin(),
iterEnd = blk->rend(); iter != iterEnd; ++iter) {
// FIXME: Simplify
if (instr) {
if (isCondBranch(instr) || isUncondBranch(instr)) {
return instr;
- } else if (!isPhimove(instr)) {
+ } else if (!TII->isMov(instr->getOpcode())) {
break;
}
}
return MI;
}
+
+bool SIInstrInfo::isMov(unsigned Opcode) const
+{
+ switch(Opcode) {
+ default: return false;
+ case AMDIL::S_MOV_B32:
+ case AMDIL::S_MOV_B64:
+ case AMDIL::V_MOV_B32_e32:
+ case AMDIL::V_MOV_B32_e64:
+ case AMDIL::V_MOV_IMM_F32:
+ case AMDIL::V_MOV_IMM_I32:
+ case AMDIL::S_MOV_IMM_I32:
+ return true;
+ }
+}