diff --git a/lib/Target/R600/R600ControlFlowFinalizer.cpp b/lib/Target/R600/R600ControlFlowFinalizer.cpp index ab71bc126cc..ac3d8f63d57 100644 --- a/lib/Target/R600/R600ControlFlowFinalizer.cpp +++ b/lib/Target/R600/R600ControlFlowFinalizer.cpp @@ -373,15 +373,6 @@ public: case AMDGPU::CF_ALU: I = MI; AluClauses.push_back(MakeALUClause(MBB, I)); - case AMDGPU::EG_ExportBuf: - case AMDGPU::EG_ExportSwz: - case AMDGPU::R600_ExportBuf: - case AMDGPU::R600_ExportSwz: - case AMDGPU::RAT_WRITE_CACHELESS_32_eg: - case AMDGPU::RAT_WRITE_CACHELESS_64_eg: - case AMDGPU::RAT_WRITE_CACHELESS_128_eg: - case AMDGPU::RAT_STORE_DWORD32: - case AMDGPU::RAT_STORE_DWORD64: DEBUG(dbgs() << CfCount << ":"; MI->dump();); CfCount++; break; @@ -491,6 +482,10 @@ public: EmitALUClause(I, AluClauses[i], CfCount); } default: + if (TII->isExport(MI->getOpcode())) { + DEBUG(dbgs() << CfCount << ":"; MI->dump();); + CfCount++; + } break; } } diff --git a/lib/Target/R600/R600Defines.h b/lib/Target/R600/R600Defines.h index 90fc29ce14d..8dc9ebb0cc2 100644 --- a/lib/Target/R600/R600Defines.h +++ b/lib/Target/R600/R600Defines.h @@ -44,7 +44,8 @@ namespace R600_InstFlag { TEX_INST = (1 << 13), ALU_INST = (1 << 14), LDS_1A = (1 << 15), - LDS_1A1D = (1 << 16) + LDS_1A1D = (1 << 16), + IS_EXPORT = (1 << 17) }; } diff --git a/lib/Target/R600/R600InstrFormats.td b/lib/Target/R600/R600InstrFormats.td index 2d72404702f..2ae33114112 100644 --- a/lib/Target/R600/R600InstrFormats.td +++ b/lib/Target/R600/R600InstrFormats.td @@ -29,6 +29,7 @@ class InstR600 pattern, bit VTXInst = 0; bit TEXInst = 0; bit ALUInst = 0; + bit IsExport = 0; let Namespace = "AMDGPU"; let OutOperandList = outs; @@ -53,6 +54,7 @@ class InstR600 pattern, let TSFlags{14} = ALUInst; let TSFlags{15} = LDS_1A; let TSFlags{16} = LDS_1A1D; + let TSFlags{17} = IsExport; } //===----------------------------------------------------------------------===// diff --git a/lib/Target/R600/R600InstrInfo.cpp b/lib/Target/R600/R600InstrInfo.cpp index 4e7eff96ae8..9548a34104c 100644 --- a/lib/Target/R600/R600InstrInfo.cpp +++ b/lib/Target/R600/R600InstrInfo.cpp @@ -160,6 +160,10 @@ bool R600InstrInfo::isTransOnly(const MachineInstr *MI) const { return isTransOnly(MI->getOpcode()); } +bool R600InstrInfo::isExport(unsigned Opcode) const { + return (get(Opcode).TSFlags & R600_InstFlag::IS_EXPORT); +} + bool R600InstrInfo::usesVertexCache(unsigned Opcode) const { return ST.hasVertexCache() && IS_VTX(get(Opcode)); } diff --git a/lib/Target/R600/R600InstrInfo.h b/lib/Target/R600/R600InstrInfo.h index cdaa2fbefc8..e28d7718a37 100644 --- a/lib/Target/R600/R600InstrInfo.h +++ b/lib/Target/R600/R600InstrInfo.h @@ -68,6 +68,7 @@ namespace llvm { bool isTransOnly(unsigned Opcode) const; bool isTransOnly(const MachineInstr *MI) const; + bool isExport(unsigned Opcode) const; bool usesVertexCache(unsigned Opcode) const; bool usesVertexCache(const MachineInstr *MI) const; diff --git a/lib/Target/R600/R600Instructions.td b/lib/Target/R600/R600Instructions.td index a67276ce6ee..bacedfc0a61 100644 --- a/lib/Target/R600/R600Instructions.td +++ b/lib/Target/R600/R600Instructions.td @@ -278,6 +278,7 @@ class EG_CF_RAT cfinst, bits <6> ratinst, bits<4> ratid, bits<4> mask, let Inst{31-0} = Word0; let Inst{63-32} = Word1; + let IsExport = 1; } @@ -551,6 +552,7 @@ class ExportSwzInst : InstR600ISA<( let elem_size = 3; let Inst{31-0} = Word0; let Inst{63-32} = Word1; + let IsExport = 1; } } // End usesCustomInserter = 1 @@ -564,6 +566,7 @@ class ExportBufInst : InstR600ISA<( let elem_size = 0; let Inst{31-0} = Word0; let Inst{63-32} = Word1; + let IsExport = 1; } //===----------------------------------------------------------------------===//