Aarch64_legitimate_constant_p currently returns false for symbols,
eventhough they are always valid constants. This means LOSYM isn't
CSEd correctly. If we return true CSE works better, resulting in
smaller/faster code (0.3% smaller code on SPEC2006). Avoid this
for TLS symbols since their sequence is complex.
gcc/
* config/aarch64/aarch64.c (aarch64_legitimate_constant_p):
Return true for non-tls symbols.
From-SVN: r249442
+2017-06-21 Wilco Dijkstra <wdijkstr@arm.com>
+
+ * config/aarch64/aarch64.c (aarch64_legitimate_constant_p):
+ Return true for non-tls symbols.
+
2017-06-21 James Greenhalgh <james.greenhalgh@arm.com>
* config/aarch64/aarch64-cores.def (cortex-a55): New.
&& aarch64_valid_symref (XEXP (x, 0), GET_MODE (XEXP (x, 0))))
return true;
+ /* Treat symbols as constants. Avoid TLS symbols as they are complex,
+ so spilling them is better than rematerialization. */
+ if (SYMBOL_REF_P (x) && !SYMBOL_REF_TLS_MODEL (x))
+ return true;
+
return aarch64_constant_address_p (x);
}