[llvm] r180762 - R600: Always use texture cache for compute shaders
Rafael EspĂndola
rafael.espindola at gmail.com
Mon Apr 29 18:51:37 PDT 2013
test?
On 29 April 2013 20:14, Vincent Lejeune <vljn at ovi.com> wrote:
> Author: vljn
> Date: Mon Apr 29 19:14:44 2013
> New Revision: 180762
>
> URL: http://llvm.org/viewvc/llvm-project?rev=180762&view=rev
> Log:
> R600: Always use texture cache for compute shaders
>
> This will improve the performance of memory reads.
>
> Modified:
> llvm/trunk/lib/Target/R600/R600InstrInfo.cpp
>
> Modified: llvm/trunk/lib/Target/R600/R600InstrInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/R600InstrInfo.cpp?rev=180762&r1=180761&r2=180762&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/R600/R600InstrInfo.cpp (original)
> +++ llvm/trunk/lib/Target/R600/R600InstrInfo.cpp Mon Apr 29 19:14:44 2013
> @@ -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(unsi
> }
>
> 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(uns
> }
>
> 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
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list