From 676c16d08856c10e366aa67c56c1c92be737f25a Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 16 Aug 2013 01:11:51 +0000 Subject: [PATCH] R600: Add IsExport bit to TableGen instruction definitions Tested-by: Aaron Watry llvm-svn: 188516 --- llvm/lib/Target/R600/R600ControlFlowFinalizer.cpp | 13 ++++--------- llvm/lib/Target/R600/R600Defines.h | 3 ++- llvm/lib/Target/R600/R600InstrFormats.td | 2 ++ llvm/lib/Target/R600/R600InstrInfo.cpp | 4 ++++ llvm/lib/Target/R600/R600InstrInfo.h | 1 + llvm/lib/Target/R600/R600Instructions.td | 3 +++ 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/llvm/lib/Target/R600/R600ControlFlowFinalizer.cpp b/llvm/lib/Target/R600/R600ControlFlowFinalizer.cpp index ab71bc126ccd..ac3d8f63d57f 100644 --- a/llvm/lib/Target/R600/R600ControlFlowFinalizer.cpp +++ b/llvm/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/llvm/lib/Target/R600/R600Defines.h b/llvm/lib/Target/R600/R600Defines.h index 90fc29ce14d9..8dc9ebb0cc25 100644 --- a/llvm/lib/Target/R600/R600Defines.h +++ b/llvm/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/llvm/lib/Target/R600/R600InstrFormats.td b/llvm/lib/Target/R600/R600InstrFormats.td index 2d72404702f5..2ae33114112c 100644 --- a/llvm/lib/Target/R600/R600InstrFormats.td +++ b/llvm/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/llvm/lib/Target/R600/R600InstrInfo.cpp b/llvm/lib/Target/R600/R600InstrInfo.cpp index 4e7eff96ae8a..9548a34104c8 100644 --- a/llvm/lib/Target/R600/R600InstrInfo.cpp +++ b/llvm/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/llvm/lib/Target/R600/R600InstrInfo.h b/llvm/lib/Target/R600/R600InstrInfo.h index cdaa2fbefc89..e28d7718a376 100644 --- a/llvm/lib/Target/R600/R600InstrInfo.h +++ b/llvm/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/llvm/lib/Target/R600/R600Instructions.td b/llvm/lib/Target/R600/R600Instructions.td index a67276ce6ee9..bacedfc0a61e 100644 --- a/llvm/lib/Target/R600/R600Instructions.td +++ b/llvm/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; } //===----------------------------------------------------------------------===// -- 2.34.1