@@ -389,9 +389,9 @@ class SIMachineFunctionInfo final : public AMDGPUMachineFunction {
389
389
// unit. Minimum - first, maximum - second.
390
390
std::pair<unsigned , unsigned > WavesPerEU = {0 , 0 };
391
391
392
- std::unique_ptr< const AMDGPUBufferPseudoSourceValue> BufferPSV;
393
- std::unique_ptr< const AMDGPUImagePseudoSourceValue> ImagePSV;
394
- std::unique_ptr< const AMDGPUGWSResourcePseudoSourceValue> GWSResourcePSV;
392
+ const AMDGPUBufferPseudoSourceValue BufferPSV;
393
+ const AMDGPUImagePseudoSourceValue ImagePSV;
394
+ const AMDGPUGWSResourcePseudoSourceValue GWSResourcePSV;
395
395
396
396
private:
397
397
unsigned NumUserSGPRs = 0 ;
@@ -923,27 +923,17 @@ class SIMachineFunctionInfo final : public AMDGPUMachineFunction {
923
923
924
924
const AMDGPUBufferPseudoSourceValue *
925
925
getBufferPSV (const AMDGPUTargetMachine &TM) {
926
- if (!BufferPSV)
927
- BufferPSV = std::make_unique<AMDGPUBufferPseudoSourceValue>(TM);
928
-
929
- return BufferPSV.get ();
926
+ return &BufferPSV;
930
927
}
931
928
932
929
const AMDGPUImagePseudoSourceValue *
933
930
getImagePSV (const AMDGPUTargetMachine &TM) {
934
- if (!ImagePSV)
935
- ImagePSV = std::make_unique<AMDGPUImagePseudoSourceValue>(TM);
936
-
937
- return ImagePSV.get ();
931
+ return &ImagePSV;
938
932
}
939
933
940
934
const AMDGPUGWSResourcePseudoSourceValue *
941
935
getGWSPSV (const AMDGPUTargetMachine &TM) {
942
- if (!GWSResourcePSV) {
943
- GWSResourcePSV = std::make_unique<AMDGPUGWSResourcePseudoSourceValue>(TM);
944
- }
945
-
946
- return GWSResourcePSV.get ();
936
+ return &GWSResourcePSV;
947
937
}
948
938
949
939
unsigned getOccupancy () const {
0 commit comments