[llvm-branch-commits] [cfe-branch] r352139 - Merging r351579:
Hans Wennborg via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Jan 24 16:15:41 PST 2019
Author: hans
Date: Thu Jan 24 16:15:41 2019
New Revision: 352139
URL: http://llvm.org/viewvc/llvm-project?rev=352139&view=rev
Log:
Merging r351579:
------------------------------------------------------------------------
r351579 | vstefanovic | 2019-01-18 20:54:51 +0100 (Fri, 18 Jan 2019) | 9 lines
[mips] Add '-mrelax-pic-calls', '-mno-relax-pic-calls'
These two options enable/disable emission of R_{MICRO}MIPS_JALR fixups along
with PIC calls. The linker may then try to turn PIC calls into direct jumps.
By default, these fixups do get emitted by the backend, use
'-mno-relax-pic-calls' to omit them.
Differential revision: https://reviews.llvm.org/D56878
------------------------------------------------------------------------
Modified:
cfe/branches/release_80/ (props changed)
cfe/branches/release_80/include/clang/Driver/Options.td
cfe/branches/release_80/lib/Driver/ToolChains/Clang.cpp
cfe/branches/release_80/test/Driver/mips-features.c
Propchange: cfe/branches/release_80/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 24 16:15:41 2019
@@ -1,4 +1,4 @@
/cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:351334,351340,351344,351360,351457,351459,351531,351580,352040,352102
+/cfe/trunk:351334,351340,351344,351360,351457,351459,351531,351579-351580,352040,352102
/cfe/trunk/test:170344
/cfe/trunk/test/SemaTemplate:126920
Modified: cfe/branches/release_80/include/clang/Driver/Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_80/include/clang/Driver/Options.td?rev=352139&r1=352138&r2=352139&view=diff
==============================================================================
--- cfe/branches/release_80/include/clang/Driver/Options.td (original)
+++ cfe/branches/release_80/include/clang/Driver/Options.td Thu Jan 24 16:15:41 2019
@@ -2418,6 +2418,14 @@ def modd_spreg : Flag<["-"], "modd-spreg
def mno_odd_spreg : Flag<["-"], "mno-odd-spreg">, Group<m_mips_Features_Group>,
HelpText<"Disable odd single-precision floating point registers">,
Flags<[HelpHidden]>;
+def mrelax_pic_calls : Flag<["-"], "mrelax-pic-calls">,
+ Group<m_mips_Features_Group>,
+ HelpText<"Try turning PIC calls (j{al}r{c} $25) into direct calls "
+ "(MIPS only)">, Flags<[HelpHidden]>;
+def mno_relax_pic_calls : Flag<["-"], "mno-relax-pic-calls">,
+ Group<m_mips_Features_Group>,
+ HelpText<"Do not try turning PIC calls (j{al}r{c} $25) into direct calls "
+ "(MIPS only)">, Flags<[HelpHidden]>;
def mglibc : Flag<["-"], "mglibc">, Group<m_libc_Group>, Flags<[HelpHidden]>;
def muclibc : Flag<["-"], "muclibc">, Group<m_libc_Group>, Flags<[HelpHidden]>;
def module_file_info : Flag<["-"], "module-file-info">, Flags<[DriverOption,CC1Option]>, Group<Action_Group>,
Modified: cfe/branches/release_80/lib/Driver/ToolChains/Clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_80/lib/Driver/ToolChains/Clang.cpp?rev=352139&r1=352138&r2=352139&view=diff
==============================================================================
--- cfe/branches/release_80/lib/Driver/ToolChains/Clang.cpp (original)
+++ cfe/branches/release_80/lib/Driver/ToolChains/Clang.cpp Thu Jan 24 16:15:41 2019
@@ -1716,6 +1716,14 @@ void Clang::AddMIPSTargetArgs(const ArgL
} else
D.Diag(diag::warn_target_unsupported_compact_branches) << CPUName;
}
+
+ if (Arg *A = Args.getLastArg(options::OPT_mrelax_pic_calls,
+ options::OPT_mno_relax_pic_calls)) {
+ if (A->getOption().matches(options::OPT_mno_relax_pic_calls)) {
+ CmdArgs.push_back("-mllvm");
+ CmdArgs.push_back("-mips-jalr-reloc=0");
+ }
+ }
}
void Clang::AddPPCTargetArgs(const ArgList &Args,
Modified: cfe/branches/release_80/test/Driver/mips-features.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_80/test/Driver/mips-features.c?rev=352139&r1=352138&r2=352139&view=diff
==============================================================================
--- cfe/branches/release_80/test/Driver/mips-features.c (original)
+++ cfe/branches/release_80/test/Driver/mips-features.c Thu Jan 24 16:15:41 2019
@@ -444,3 +444,15 @@
// RUN: -mginv -mno-ginv 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-GINV %s
// CHECK-NO-GINV: "-target-feature" "-ginv"
+//
+// -mrelax-pic-calls
+// RUN: %clang -target mips-unknown-linux-gnu -### -c %s \
+// RUN: -mno-relax-pic-calls -mrelax-pic-calls 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-RELAX-PIC-CALLS %s
+// CHECK-RELAX-PIC-CALLS-NOT: "-mllvm" "-mips-jalr-reloc=0"
+//
+// -mno-relax-pic-calls
+// RUN: %clang -target mips-unknown-linux-gnu -### -c %s \
+// RUN: -mrelax-pic-calls -mno-relax-pic-calls 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NO-RELAX-PIC-CALLS %s
+// CHECK-NO-RELAX-PIC-CALLS: "-mllvm" "-mips-jalr-reloc=0"
More information about the llvm-branch-commits
mailing list