[PATCH] D31197: [ARM] Add a driver option for +no-neg-immediates
Sanne Wouda via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 27 08:47:20 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL298850: [ARM] Add a driver option for +no-neg-immediates (authored by sanwou01).
Changed prior to commit:
https://reviews.llvm.org/D31197?vs=92643&id=93139#toc
Repository:
rL LLVM
https://reviews.llvm.org/D31197
Files:
cfe/trunk/include/clang/Driver/Options.td
cfe/trunk/lib/Driver/ToolChains/Arch/AArch64.cpp
cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp
cfe/trunk/test/Driver/arm-no-neg-immediates.c
Index: cfe/trunk/include/clang/Driver/Options.td
===================================================================
--- cfe/trunk/include/clang/Driver/Options.td
+++ cfe/trunk/include/clang/Driver/Options.td
@@ -1760,6 +1760,8 @@
HelpText<"Allow use of CRC instructions (ARM only)">;
def mnocrc : Flag<["-"], "mnocrc">, Group<m_arm_Features_Group>,
HelpText<"Disallow use of CRC instructions (ARM only)">;
+def mno_neg_immediates: Flag<["-"], "mno-neg-immediates">, Group<m_arm_Features_Group>,
+ HelpText<"Disallow converting instructions with negative immediates to their negation or inversion.">;
def mgeneral_regs_only : Flag<["-"], "mgeneral-regs-only">, Group<m_aarch64_Features_Group>,
HelpText<"Generate code which only uses the general purpose registers (AArch64 only)">;
Index: cfe/trunk/test/Driver/arm-no-neg-immediates.c
===================================================================
--- cfe/trunk/test/Driver/arm-no-neg-immediates.c
+++ cfe/trunk/test/Driver/arm-no-neg-immediates.c
@@ -0,0 +1,8 @@
+// RUN: %clang -target arm-none-gnueabi -### %s 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT
+// RUN: %clang -target arm-none-gnueabi -mno-neg-immediates -### %s 2>&1 | FileCheck %s
+
+// RUN: %clang -target aarch64-none-gnueabi -### %s 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT
+// RUN: %clang -target aarch64-none-gnueabi -mno-neg-immediates -### %s 2>&1 | FileCheck %s
+
+// CHECK: "-target-feature" "+no-neg-immediates"
+// CHECK-DEFAULT-NOT: "+no-neg-immediates"
Index: cfe/trunk/lib/Driver/ToolChains/Arch/AArch64.cpp
===================================================================
--- cfe/trunk/lib/Driver/ToolChains/Arch/AArch64.cpp
+++ cfe/trunk/lib/Driver/ToolChains/Arch/AArch64.cpp
@@ -193,4 +193,7 @@
if (Args.hasArg(options::OPT_ffixed_x18))
Features.push_back("+reserve-x18");
+
+ if (Args.hasArg(options::OPT_mno_neg_immediates))
+ Features.push_back("+no-neg-immediates");
}
Index: cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp
===================================================================
--- cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp
+++ cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp
@@ -449,6 +449,9 @@
// The kext linker doesn't know how to deal with movw/movt.
if (KernelOrKext || Args.hasArg(options::OPT_mno_movt))
Features.push_back("+no-movt");
+
+ if (Args.hasArg(options::OPT_mno_neg_immediates))
+ Features.push_back("+no-neg-immediates");
}
const std::string arm::getARMArch(StringRef Arch, const llvm::Triple &Triple) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31197.93139.patch
Type: text/x-patch
Size: 2541 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170327/07d5d683/attachment.bin>
More information about the llvm-commits
mailing list