rs6000: Make CSE'ing __tls_get_addr calls possible
authorSegher Boessenkool <segher@gcc.gnu.org>
Sun, 24 Mar 2019 20:26:53 +0000 (21:26 +0100)
committerSegher Boessenkool <segher@gcc.gnu.org>
Sun, 24 Mar 2019 20:26:53 +0000 (21:26 +0100)
commit06c1602ae4d1ff3270aa12ba6f010cd51302fe91
treef9ec455a6faac629af01a9bab47c4cbf8836633f
parent38a47a0fc6defeaf3f49ab63aff262ae42dffd89
rs6000: Make CSE'ing __tls_get_addr calls possible

CSE does not consider calls, not even const calls.  This patch puts a
REG_EQUAL note on the pseudo we assign the __tls_get_addr result to,
so that those pseudos can be CSE'd and the extra calls deleted as dead
code.

CSE should really handle const calls directly, but it is stage 4.

* config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Add REG_EQUAL
notes for the result of the __tls_get_addr calls.
* config/rs6000/rs6000.md (unspec UNSPEC_TLS_GET_ADDR): New.

From-SVN: r269902
gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.md