diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2012-06-04 07:43:20 -0400 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2012-06-04 07:43:20 -0400 |
commit | 83fce25f0472d6dfccb4188d61d6c7b2fdf5e2e8 (patch) | |
tree | e86e78896078f683c8e4868af9593a384e9f1233 | |
parent | 3859d48b5de0d064426bbb9641908ab30c01443c (diff) |
radeon/llvm: Add isMOV to IntrInfoamdil-clean
-rw-r--r-- | src/gallium/drivers/radeon/AMDILCFGStructurizer.cpp | 5 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/AMDILInstrInfo.h | 2 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/R600InstrInfo.cpp | 11 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/R600InstrInfo.h | 1 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/SIInstrInfo.cpp | 14 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/SIInstrInfo.h | 1 |
6 files changed, 33 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeon/AMDILCFGStructurizer.cpp b/src/gallium/drivers/radeon/AMDILCFGStructurizer.cpp index 26559a0371d..f8323987d3a 100644 --- a/src/gallium/drivers/radeon/AMDILCFGStructurizer.cpp +++ b/src/gallium/drivers/radeon/AMDILCFGStructurizer.cpp @@ -2899,6 +2899,9 @@ struct CFGStructTraits<AMDILCFGStructurizer> // 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 @@ -2906,7 +2909,7 @@ struct CFGStructTraits<AMDILCFGStructurizer> if (instr) { if (isCondBranch(instr) || isUncondBranch(instr)) { return instr; - } else if (!isPhimove(instr)) { + } else if (!TII->isMov(instr->getOpcode())) { break; } } diff --git a/src/gallium/drivers/radeon/AMDILInstrInfo.h b/src/gallium/drivers/radeon/AMDILInstrInfo.h index 211c881e7b9..7ea88348a9a 100644 --- a/src/gallium/drivers/radeon/AMDILInstrInfo.h +++ b/src/gallium/drivers/radeon/AMDILInstrInfo.h @@ -152,6 +152,8 @@ public: int64_t Imm) const = 0; virtual unsigned getIEQOpcode() const = 0; + + virtual bool isMov(unsigned Opcode) const = 0; }; } diff --git a/src/gallium/drivers/radeon/R600InstrInfo.cpp b/src/gallium/drivers/radeon/R600InstrInfo.cpp index 89a3c93bb7e..5e29406161a 100644 --- a/src/gallium/drivers/radeon/R600InstrInfo.cpp +++ b/src/gallium/drivers/radeon/R600InstrInfo.cpp @@ -76,3 +76,14 @@ unsigned R600InstrInfo::getIEQOpcode() const { return AMDIL::SETE_INT; } + +bool R600InstrInfo::isMov(unsigned Opcode) const +{ + switch(Opcode) { + default: return false; + case AMDIL::MOV: + case AMDIL::MOV_IMM_F32: + case AMDIL::MOV_IMM_I32: + return true; + } +} diff --git a/src/gallium/drivers/radeon/R600InstrInfo.h b/src/gallium/drivers/radeon/R600InstrInfo.h index be522ca3380..3f17bf932dd 100644 --- a/src/gallium/drivers/radeon/R600InstrInfo.h +++ b/src/gallium/drivers/radeon/R600InstrInfo.h @@ -47,6 +47,7 @@ namespace llvm { int64_t Imm) const; virtual unsigned getIEQOpcode() const; + virtual bool isMov(unsigned Opcode) const; }; } // End llvm namespace diff --git a/src/gallium/drivers/radeon/SIInstrInfo.cpp b/src/gallium/drivers/radeon/SIInstrInfo.cpp index de0419b3741..9a41a9b6b3e 100644 --- a/src/gallium/drivers/radeon/SIInstrInfo.cpp +++ b/src/gallium/drivers/radeon/SIInstrInfo.cpp @@ -87,3 +87,17 @@ MachineInstr * SIInstrInfo::getMovImmInstr(MachineFunction *MF, unsigned DstReg, 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: + case AMDIL::S_MOV_IMM_I32: + return true; + } +} diff --git a/src/gallium/drivers/radeon/SIInstrInfo.h b/src/gallium/drivers/radeon/SIInstrInfo.h index 63f789ddc12..234513c0ea9 100644 --- a/src/gallium/drivers/radeon/SIInstrInfo.h +++ b/src/gallium/drivers/radeon/SIInstrInfo.h @@ -46,6 +46,7 @@ public: int64_t Imm) const; virtual unsigned getIEQOpcode() const { assert(!"Implement"); return 0;} + virtual bool isMov(unsigned Opcode) const; }; |