]> gcc.gnu.org Git - gcc.git/commit
gcn: Fix __builtin_gcn_first_call_this_thread_p
authorTobias Burnus <tobias@codesourcery.com>
Mon, 28 Nov 2022 10:11:43 +0000 (11:11 +0100)
committerTobias Burnus <tobias@codesourcery.com>
Mon, 28 Nov 2022 10:11:43 +0000 (11:11 +0100)
commit9fa67f1c1228a852e23943a41e68b664172c654c
tree6bab9ccf8a60059c9ee6419a5fd437fbf777862b
parent091b6dbc48177fa3ef15d62ea280ef6cb61c05b2
gcn: Fix __builtin_gcn_first_call_this_thread_p

Contrary naive expectation, unspec_volatile (via prologue_use) did not
prevent the cprop pass (at -O2) to remove the access to the s[0:1]
(PRIVATE_SEGMENT_BUFFER_ARG) register as the volatile got just put on
the preceeding pseudoregister.  Solution: Use gen_rtx_USE instead.
Additionally, this patch removes (gen_)prologue_use_di as it is then no
longer used.

Finally, as we already do bit manipulation, instead of using the full
64bit side - and then just keeping the value of 's0', just move directly
to use only s1 of s[0:1] and do the bit manipulations there, generating
more readable assembly code and better matching the '#else' branch.

gcc/ChangeLog:

* config/gcn/gcn.cc (gcn_expand_builtin_1): Work on s1 instead
of s[0:1] and use USE to prevent removal of setting that register.
* config/gcn/gcn.md (prologue_use_di): Remove.
gcc/config/gcn/gcn.cc
gcc/config/gcn/gcn.md
This page took 0.059702 seconds and 5 git commands to generate.