diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2013-07-23 23:54:56 +0000 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2013-07-23 23:54:56 +0000 |
commit | 8cb0e47c9ee2061cedb06bbb648e1d5c2efea82e (patch) | |
tree | 3656bbef9c009cd3caed330b86d2e12327664963 /llvm/lib | |
parent | 28157828313582762803cd751acce078e8ebd49e (diff) | |
download | bcm5719-llvm-8cb0e47c9ee2061cedb06bbb648e1d5c2efea82e.tar.gz bcm5719-llvm-8cb0e47c9ee2061cedb06bbb648e1d5c2efea82e.zip |
R600: Treat CONSTANT_ADDRESS loads like GLOBAL_ADDRESS loads when necessary
These are really the same address space in hardware. The only
difference is that CONSTANT_ADDRESS uses a special cache for faster
access. When we are unable to use the constant kcache for some reason
(e.g. smaller types or lack of indirect addressing) then the instruction
selector must use GLOBAL_ADDRESS loads instead.
llvm-svn: 187006
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/R600/AMDGPUISelDAGToDAG.cpp | 7 | ||||
-rw-r--r-- | llvm/lib/Target/R600/R600Instructions.td | 19 |
2 files changed, 7 insertions, 19 deletions
diff --git a/llvm/lib/Target/R600/AMDGPUISelDAGToDAG.cpp b/llvm/lib/Target/R600/AMDGPUISelDAGToDAG.cpp index 696910911f9..307b80483aa 100644 --- a/llvm/lib/Target/R600/AMDGPUISelDAGToDAG.cpp +++ b/llvm/lib/Target/R600/AMDGPUISelDAGToDAG.cpp @@ -620,6 +620,13 @@ bool AMDGPUDAGToDAGISel::isConstantLoad(const LoadSDNode *N, int CbId) const { } bool AMDGPUDAGToDAGISel::isGlobalLoad(const LoadSDNode *N) const { + if (N->getAddressSpace() == AMDGPUAS::CONSTANT_ADDRESS) { + const AMDGPUSubtarget &ST = TM.getSubtarget<AMDGPUSubtarget>(); + if (ST.getGeneration() < AMDGPUSubtarget::SOUTHERN_ISLANDS || + N->getMemoryVT().bitsLT(MVT::i32)) { + return true; + } + } return checkType(N->getSrcValue(), AMDGPUAS::GLOBAL_ADDRESS); } diff --git a/llvm/lib/Target/R600/R600Instructions.td b/llvm/lib/Target/R600/R600Instructions.td index 3511dcd1ead..9ff389701e6 100644 --- a/llvm/lib/Target/R600/R600Instructions.td +++ b/llvm/lib/Target/R600/R600Instructions.td @@ -1418,16 +1418,6 @@ def VTX_READ_GLOBAL_128_eg : VTX_READ_128_eg <1, [(set v4i32:$dst_gpr, (global_load ADDRVTX_READ:$src_gpr))] >; -//===----------------------------------------------------------------------===// -// Constant Loads -// XXX: We are currently storing all constants in the global address space. -//===----------------------------------------------------------------------===// - -def CONSTANT_LOAD_eg : VTX_READ_32_eg <1, - [(set i32:$dst_gpr, (constant_load ADDRVTX_READ:$src_gpr))] ->; - - } // End Predicates = [isEG] //===----------------------------------------------------------------------===// @@ -1883,15 +1873,6 @@ def VTX_READ_GLOBAL_128_cm : VTX_READ_128_cm <1, [(set v4i32:$dst_gpr, (global_load ADDRVTX_READ:$src_gpr))] >; -//===----------------------------------------------------------------------===// -// Constant Loads -// XXX: We are currently storing all constants in the global address space. -//===----------------------------------------------------------------------===// - -def CONSTANT_LOAD_cm : VTX_READ_32_cm <1, - [(set i32:$dst_gpr, (constant_load ADDRVTX_READ:$src_gpr))] ->; - } // End isCayman //===----------------------------------------------------------------------===// |