[clang] [clang] Default x86_64's medium code model -mlarge-data-threshold to 65535 (PR #67506)
Arthur Eubanks via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 26 17:05:40 PDT 2023
https://github.com/aeubanks created https://github.com/llvm/llvm-project/pull/67506
This matches gcc.
See https://discourse.llvm.org/t/rfc-matching-gccs-mlarge-data-threshold-for-x86-64s-medium-code-model/73727.
>From b406b086709a1f5012aa444bc7774962c82c4f30 Mon Sep 17 00:00:00 2001
From: Arthur Eubanks <aeubanks at google.com>
Date: Tue, 26 Sep 2023 17:02:34 -0700
Subject: [PATCH] [clang] Default x86_64's medium code model
-mlarge-data-threshold to 65535
This matches gcc.
See https://discourse.llvm.org/t/rfc-matching-gccs-mlarge-data-threshold-for-x86-64s-medium-code-model/73727.
---
clang/include/clang/Driver/Options.td | 2 +-
clang/test/CodeGen/large-data-threshold.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index f573f5a06ceb501..5030a709f14a1f3 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -4250,7 +4250,7 @@ def mcmodel_EQ : Joined<["-"], "mcmodel=">, Group<m_Group>,
MarshallingInfoString<TargetOpts<"CodeModel">, [{"default"}]>;
def mlarge_data_threshold_EQ : Joined<["-"], "mlarge-data-threshold=">, Group<m_Group>,
Visibility<[ClangOption, CC1Option]>,
- MarshallingInfoInt<TargetOpts<"LargeDataThreshold">>;
+ MarshallingInfoInt<TargetOpts<"LargeDataThreshold">, "65535">;
def mtls_size_EQ : Joined<["-"], "mtls-size=">, Group<m_Group>,
Flags<[NoXarchOption]>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Specify bit size of immediate TLS offsets (AArch64 ELF only): "
diff --git a/clang/test/CodeGen/large-data-threshold.c b/clang/test/CodeGen/large-data-threshold.c
index 650a7fbb0094e66..29ae19e9b718994 100644
--- a/clang/test/CodeGen/large-data-threshold.c
+++ b/clang/test/CodeGen/large-data-threshold.c
@@ -5,7 +5,7 @@
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -S %s -o - -mcmodel=medium -mlarge-data-threshold=200 | FileCheck %s --check-prefix=ASM-SMALL
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -S %s -o - -mcmodel=medium -mlarge-data-threshold=2 | FileCheck %s --check-prefix=ASM-LARGE
-// IR-DEFAULT: !{i32 1, !"Large Data Threshold", i64 0}
+// IR-DEFAULT: !{i32 1, !"Large Data Threshold", i64 65535}
// IR-CUSTOM: !{i32 1, !"Large Data Threshold", i64 200}
// ASM-SMALL-NOT: movabsq
More information about the cfe-commits
mailing list