diff options
| author | Vincent Lejeune <vljn@ovi.com> | 2013-04-30 00:14:44 +0000 |
|---|---|---|
| committer | Vincent Lejeune <vljn@ovi.com> | 2013-04-30 00:14:44 +0000 |
| commit | 3a8d78a2c30910ff6d837e4c86d8764d5ebc9bc1 (patch) | |
| tree | b01831fccd94801d19d9186e514ab76097447062 /llvm | |
| parent | 3abdbf1cad7dc81450ba9cf7157fb5528922d23c (diff) | |
| download | bcm5719-llvm-3a8d78a2c30910ff6d837e4c86d8764d5ebc9bc1.tar.gz bcm5719-llvm-3a8d78a2c30910ff6d837e4c86d8764d5ebc9bc1.zip | |
R600: Always use texture cache for compute shaders
This will improve the performance of memory reads.
llvm-svn: 180762
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Target/R600/R600InstrInfo.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Target/R600/R600InstrInfo.cpp b/llvm/lib/Target/R600/R600InstrInfo.cpp index 371ffc12f1e..8fd838599f9 100644 --- a/llvm/lib/Target/R600/R600InstrInfo.cpp +++ b/llvm/lib/Target/R600/R600InstrInfo.cpp @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// #include "R600InstrInfo.h" +#include "AMDGPU.h" #include "AMDGPUSubtarget.h" #include "AMDGPUTargetMachine.h" #include "R600Defines.h" @@ -153,7 +154,8 @@ bool R600InstrInfo::usesVertexCache(unsigned Opcode) const { } bool R600InstrInfo::usesVertexCache(const MachineInstr *MI) const { - return usesVertexCache(MI->getOpcode()); + const R600MachineFunctionInfo *MFI = MI->getParent()->getParent()->getInfo<R600MachineFunctionInfo>(); + return MFI->ShaderType != ShaderType::COMPUTE && usesVertexCache(MI->getOpcode()); } bool R600InstrInfo::usesTextureCache(unsigned Opcode) const { @@ -162,7 +164,9 @@ bool R600InstrInfo::usesTextureCache(unsigned Opcode) const { } bool R600InstrInfo::usesTextureCache(const MachineInstr *MI) const { - return usesTextureCache(MI->getOpcode()); + const R600MachineFunctionInfo *MFI = MI->getParent()->getParent()->getInfo<R600MachineFunctionInfo>(); + return (MFI->ShaderType == ShaderType::COMPUTE && usesVertexCache(MI->getOpcode())) || + usesTextureCache(MI->getOpcode()); } bool |

