summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2017-12-29 17:18:21 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2017-12-29 17:18:21 +0000
commite19bc2ee0fb20f05a9acf53b9e18f59c3b130960 (patch)
tree19a3f8114b1bd5a29a3782cb48394d5606be2bf8 /llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
parentd94b63d7659c9c327dbfe63ba9e1d0a4447cb253 (diff)
downloadbcm5719-llvm-e19bc2ee0fb20f05a9acf53b9e18f59c3b130960.tar.gz
bcm5719-llvm-e19bc2ee0fb20f05a9acf53b9e18f59c3b130960.zip
AMDGPU: Use unique PSVs for buffer resources
Also fixes using the wrong memory type for some intrinsics when custom lowering them. llvm-svn: 321557
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h')
-rw-r--r--llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
index 7ac755be04d..02e63f0258e 100644
--- a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
+++ b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
@@ -137,12 +137,11 @@ class SIMachineFunctionInfo final : public AMDGPUMachineFunction {
// Stack object indices for work item IDs.
std::array<int, 3> DebuggerWorkItemIDStackObjectIndices = {{0, 0, 0}};
- AMDGPUBufferPseudoSourceValue BufferPSV;
-
+ DenseMap<const Value *,
+ std::unique_ptr<const AMDGPUBufferPseudoSourceValue>> BufferPSVs;
DenseMap<const Value *,
std::unique_ptr<const AMDGPUImagePseudoSourceValue>> ImagePSVs;
-
private:
unsigned LDSWaveSpillSize = 0;
unsigned NumUserSGPRs = 0;
@@ -634,9 +633,13 @@ public:
return LDSWaveSpillSize;
}
- // FIXME: These should be unique
- const AMDGPUBufferPseudoSourceValue *getBufferPSV() const {
- return &BufferPSV;
+ const AMDGPUBufferPseudoSourceValue *getBufferPSV(const SIInstrInfo &TII,
+ const Value *BufferRsrc) {
+ assert(BufferRsrc);
+ auto PSV = BufferPSVs.try_emplace(
+ BufferRsrc,
+ llvm::make_unique<AMDGPUBufferPseudoSourceValue>(TII));
+ return PSV.first->second.get();
}
const AMDGPUImagePseudoSourceValue *getImagePSV(const SIInstrInfo &TII,
OpenPOWER on IntegriCloud