Go to file
Nicolai Haehnle 3c05d6d3b5 AMDGPU/SI: xnack_mask is always reserved on VI
Summary:
Somehow, I first interpreted the docs as saying space for xnack_mask is only
reserved when XNACK is enabled via SH_MEM_CONFIG. I felt uneasy about this and
went back to actually test what is happening, and it turns out that xnack_mask
is always reserved at least on Tonga and Carrizo, in the sense that flat_scr
is always fixed below the SGPRs that are used to implement xnack_mask, whether
or not they are actually used.

I confirmed this by writing a shader using inline assembly to tease out the
aliasing between flat_scratch and regular SGPRs. For example, on Tonga, where
we fix the number of SGPRs to 80, s[74:75] aliases flat_scratch (so
xnack_mask is s[76:77] and vcc is s[78:79]).

This patch changes both the calculation of the total number of SGPRs and the
various register reservations to account for this.

It ought to be possible to use the gap left by xnack_mask when the feature
isn't used, but this patch doesn't try to do that. (Note that the same applies
to vcc.)

Note that previously, even before my earlier change in r256794, the SGPRs that
alias to xnack_mask could end up being used as well when flat_scr was unused
and the total number of SGPRs happened to fall on the right alignment
(e.g. highest regular SGPR being used s29 and VCC used would lead to number
of SGPRs being 32, where s28 and s29 alias with xnack_mask). So if there
were some conflict due to such aliasing, we should have noticed that already.

Reviewers: arsenm, tstellarAMD

Subscribers: arsenm, llvm-commits

Differential Revision: http://reviews.llvm.org/D15898

llvm-svn: 257073
2016-01-07 17:10:20 +00:00
clang [OpenMP] Fix issue in the offloading metadata testing. 2016-01-07 14:58:16 +00:00
clang-tools-extra Fix typo. 2016-01-04 21:25:10 +00:00
compiler-rt Follow-up fix for r256988 to unbreak the Linux buildbot. 2016-01-07 09:14:41 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc AMDGPU: Add aliases for all VI targets 2015-12-15 18:37:04 +00:00
libcxx [libcxx] Set LC_ALL rather than LC_COLLATE to override collation. 2016-01-07 02:36:09 +00:00
libcxxabi Add new tests for throwing incomplete pointer types 2015-12-23 07:04:32 +00:00
libunwind Replace cmake check for printf with a check for fopen. 2015-12-10 00:47:08 +00:00
lld Fix typo. 2016-01-07 16:41:06 +00:00
lldb XFAIL TestMultithreaded on linux 2016-01-07 15:24:51 +00:00
llgo [llgo] Force exporting __morestack from llgoi 2015-11-27 04:46:46 +00:00
llvm AMDGPU/SI: xnack_mask is always reserved on VI 2016-01-07 17:10:20 +00:00
openmp Removed unused __kmp_*_i8 functions. 2016-01-04 23:20:26 +00:00
polly Define buildScheduleRec on RegionNodes and pull out the tree traversal [NFC] 2016-01-06 15:30:06 +00:00