3 Commits

Author SHA1 Message Date
Arthur Eubanks
f05b081214
[clang] Adjust -mlarge-data-threshold handling (#77958)
Make it apply to x86-64 medium and large code models since that's what
the backend does.

Limit logic to exclude x86-32.

Default to 0, let the driver set it to 65536 for the medium code model
if one is not passed. Set it to 0 for the large code model by default to
match gcc and since some users make assumptions about the large code
model that any small data will break.
2024-01-12 12:23:42 -08:00
Arthur Eubanks
b7ac16c70f
[clang] Default x86-64's medium code model -mlarge-data-threshold to 65535 (#67506)
This matches gcc.

This means that by default, under x86-64's medium code model we treat
globals < 2^16 bytes as "small data" and globals >= 2^16 bytes as "large
data".

The previous clang behavior of treating all data as "large data" can be
set with `-mlarge-data-threshold=0`.

See
https://discourse.llvm.org/t/rfc-matching-gccs-mlarge-data-threshold-for-x86-64s-medium-code-model/73727.
2023-10-04 13:06:23 -07:00
Arthur Eubanks
a42787d108
[clang] Add -mlarge-data-threshold for x86_64 medium code model (#66839)
Error if not used with x86_64.
Warn if not used with the medium code model (can update if other code
models end up using this).

Set TargetMachine option and add module flag.
2023-09-26 09:44:31 -07:00