Skip to content

Commit 04113a5

Browse files
committed
Revert the MC changes for disabling relocation types
The pass added can suppress EGPR/NDD/NF instructions to avoid APX relocation types emitted in MC.
1 parent b034872 commit 04113a5

35 files changed

+555
-455
lines changed

clang/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,6 @@ set(ENABLE_LINKER_BUILD_ID OFF CACHE BOOL "pass --build-id to ld")
219219
set(ENABLE_X86_RELAX_RELOCATIONS ON CACHE BOOL
220220
"enable x86 relax relocations by default")
221221

222-
set(ENABLE_X86_APX_RELAX_RELOCATIONS OFF CACHE BOOL
223-
"Enable x86 APX relax relocations by default")
224-
225222
set(PPC_LINUX_DEFAULT_IEEELONGDOUBLE OFF CACHE BOOL
226223
"Enable IEEE binary128 as default long double format on PowerPC Linux.")
227224

clang/cmake/caches/Fuchsia-stage2.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ set(CLANG_PLUGIN_SUPPORT OFF CACHE BOOL "")
4949

5050
set(ENABLE_LINKER_BUILD_ID ON CACHE BOOL "")
5151
set(ENABLE_X86_RELAX_RELOCATIONS ON CACHE BOOL "")
52-
set(ENABLE_X86_APX_RELAX_RELOCATIONS OFF CACHE BOOL "")
5352

5453
# TODO(#67176): relative-vtables doesn't play well with different default
5554
# visibilities. Making everything hidden visibility causes other complications

clang/cmake/caches/Fuchsia.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ set(CLANG_PLUGIN_SUPPORT OFF CACHE BOOL "")
8989

9090
set(ENABLE_LINKER_BUILD_ID ON CACHE BOOL "")
9191
set(ENABLE_X86_RELAX_RELOCATIONS ON CACHE BOOL "")
92-
set(ENABLE_X86_APX_RELAX_RELOCATIONS OFF CACHE BOOL "")
9392

9493
set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
9594
set(LLVM_ENABLE_BACKTRACES ON CACHE BOOL "")

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ CODEGENOPT(UniqueInternalLinkageNames, 1, 0) ///< Internal Linkage symbols get u
201201
CODEGENOPT(SplitMachineFunctions, 1, 0) ///< Split machine functions using profile information.
202202
CODEGENOPT(PPCUseFullRegisterNames, 1, 0) ///< Print full register names in assembly
203203
CODEGENOPT(X86RelaxRelocations, 1, 1) ///< -Wa,-mrelax-relocations={yes,no}
204-
CODEGENOPT(X86APXRelaxRelocations, 1, 0) ///< -Wa,-mapx-relax-relocations={yes,no}
205204
CODEGENOPT(X86Sse2Avx , 1, 0) ///< -Wa,-msse2avx
206205

207206
/// When false, this attempts to generate code as if the result of an

clang/include/clang/Config/config.h.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@
7272
/* enable x86 relax relocations by default */
7373
#cmakedefine01 ENABLE_X86_RELAX_RELOCATIONS
7474

75-
/* enable x86 APX relax relocations by default */
76-
#cmakedefine01 ENABLE_X86_APX_RELAX_RELOCATIONS
77-
7875
/* Enable IEEE binary128 as default long double format on PowerPC Linux. */
7976
#cmakedefine01 PPC_LINUX_DEFAULT_IEEELONGDOUBLE
8077

clang/include/clang/Driver/Options.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7442,9 +7442,6 @@ def mmapsyms_implicit : Flag<["-"], "mmapsyms=implicit">,
74427442
def mrelax_relocations_no : Flag<["-"], "mrelax-relocations=no">,
74437443
HelpText<"Disable x86 relax relocations">,
74447444
MarshallingInfoNegativeFlag<CodeGenOpts<"X86RelaxRelocations">>;
7445-
def mapx_relax_relocations_yes : Flag<["-"], "mapx-relax-relocations=yes">,
7446-
HelpText<"Enable x86 APX relax relocations">,
7447-
MarshallingInfoFlag<CodeGenOpts<"X86APXRelaxRelocations">>;
74487445
def msave_temp_labels : Flag<["-"], "msave-temp-labels">,
74497446
HelpText<"Save temporary labels in the symbol table. "
74507447
"Note this may change .s semantics and shouldn't generally be used "

clang/include/clang/Driver/ToolChain.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -473,9 +473,6 @@ class ToolChain {
473473
/// Check whether to enable x86 relax relocations by default.
474474
virtual bool useRelaxRelocations() const;
475475

476-
/// Check whether to enable x86 APX relax relocations by default.
477-
virtual bool useAPXRelaxRelocations() const;
478-
479476
/// Check whether use IEEE binary128 as long double format by default.
480477
bool defaultToIEEELongDouble() const;
481478

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,6 @@ static bool initTargetOptions(const CompilerInstance &CI,
513513
Options.MCOptions.Crel = CodeGenOpts.Crel;
514514
Options.MCOptions.ImplicitMapSyms = CodeGenOpts.ImplicitMapSyms;
515515
Options.MCOptions.X86RelaxRelocations = CodeGenOpts.X86RelaxRelocations;
516-
Options.MCOptions.X86APXRelaxRelocations = CodeGenOpts.X86APXRelaxRelocations;
517516
Options.MCOptions.CompressDebugSections =
518517
CodeGenOpts.getCompressDebugSections();
519518
if (CodeGenOpts.OutputAsmVariant != 3) // 3 (default): not specified

clang/lib/Driver/ToolChain.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,6 @@ bool ToolChain::useRelaxRelocations() const {
192192
return ENABLE_X86_RELAX_RELOCATIONS;
193193
}
194194

195-
bool ToolChain::useAPXRelaxRelocations() const {
196-
return ENABLE_X86_APX_RELAX_RELOCATIONS;
197-
}
198-
199195
bool ToolChain::defaultToIEEELongDouble() const {
200196
return PPC_LINUX_DEFAULT_IEEELONGDOUBLE && getTriple().isOSLinux();
201197
}

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2602,8 +2602,6 @@ static void CollectArgsForIntegratedAssembler(Compilation &C,
26022602
bool Crel = false, ExperimentalCrel = false;
26032603
bool ImplicitMapSyms = false;
26042604
bool UseRelaxRelocations = C.getDefaultToolChain().useRelaxRelocations();
2605-
bool UseAPXRelaxRelocations =
2606-
C.getDefaultToolChain().useAPXRelaxRelocations();
26072605
bool UseNoExecStack = false;
26082606
bool Msa = false;
26092607
const char *MipsTargetFeature = nullptr;
@@ -2665,12 +2663,6 @@ static void CollectArgsForIntegratedAssembler(Compilation &C,
26652663
checkArg(IsELF, {"yes", "no"});
26662664
continue;
26672665
}
2668-
if (Equal.first == "-mapx-relax-relocations" ||
2669-
Equal.first == "--mapx-relax-relocations") {
2670-
UseAPXRelaxRelocations = Equal.second == "yes";
2671-
checkArg(IsELF, {"yes", "no"});
2672-
continue;
2673-
}
26742666
if (Value == "-msse2avx") {
26752667
CmdArgs.push_back("-msse2avx");
26762668
continue;
@@ -2882,8 +2874,6 @@ static void CollectArgsForIntegratedAssembler(Compilation &C,
28822874
CmdArgs.push_back("-mmsa");
28832875
if (!UseRelaxRelocations)
28842876
CmdArgs.push_back("-mrelax-relocations=no");
2885-
if (UseAPXRelaxRelocations)
2886-
CmdArgs.push_back("-mapx-relax-relocations=yes");
28872877
if (UseNoExecStack)
28882878
CmdArgs.push_back("-mnoexecstack");
28892879
if (MipsTargetFeature != nullptr) {

0 commit comments

Comments
 (0)