summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2015-12-17 17:05:09 +0000
committerTom Stellard <thomas.stellard@amd.com>2015-12-17 17:05:09 +0000
commitcaaa3aa07c8fa129c8032597f2d0317637a1569a (patch)
tree096a7d50f9ad42b1dae39129f466ea8a7df170b2 /llvm/lib
parentf741312c6f290a3ff83d09ab13cbb77fef69fdd3 (diff)
downloadbcm5719-llvm-caaa3aa07c8fa129c8032597f2d0317637a1569a.tar.gz
bcm5719-llvm-caaa3aa07c8fa129c8032597f2d0317637a1569a.zip
AMDGPU/SI: Reserve appropriate number of sgprs for flat scratch init.
Reviewers: tstellarAMD Subscribers: arsenm, llvm-commits Differential Revision: http://reviews.llvm.org/D15583 Patch by: Changpeng Fang llvm-svn: 255908
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp b/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
index ac8f568da18..ba71dc05a8f 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
@@ -417,11 +417,15 @@ void AMDGPUAsmPrinter::getSIProgramInfo(SIProgramInfo &ProgInfo,
}
}
- if (VCCUsed)
+ if (VCCUsed || FlatUsed)
MaxSGPR += 2;
- if (FlatUsed)
+ if (FlatUsed) {
MaxSGPR += 2;
+ // 2 additional for VI+.
+ if (STM.getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS)
+ MaxSGPR += 2;
+ }
// We found the maximum register index. They start at 0, so add one to get the
// number of registers.
OpenPOWER on IntegriCloud