[PATCH] D67160: [clang, ARM] Default to -fno-lax-vector-conversions in ARM v8.1-M.
Simon Tatham via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 9 06:03:32 PDT 2019
simon_tatham updated this revision to Diff 224031.
simon_tatham added a comment.
Rebased to current master.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D67160/new/
https://reviews.llvm.org/D67160
Files:
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/lax-vector-conversions.c
Index: clang/test/Driver/lax-vector-conversions.c
===================================================================
--- /dev/null
+++ clang/test/Driver/lax-vector-conversions.c
@@ -0,0 +1,8 @@
+// RUN: %clang --target=arm-arm-none-eabi -march=armv8.1m.main -### -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-STRICT %s
+
+// RUN: %clang --target=arm-arm-none-eabi -march=armv8a -### -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-LAX %s
+
+// CHECK-STRICT: "-flax-vector-conversions=none"
+// CHECK-LAX-NOT: "-flax-vector-conversions=none"
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -1377,6 +1377,17 @@
}
}
+static bool isLaxVectorConversionsDefault(const llvm::Triple &Triple) {
+ switch (Triple.getArch()) {
+ default:
+ return true;
+
+ case llvm::Triple::thumb:
+ case llvm::Triple::thumbeb:
+ return Triple.getSubArch() != llvm::Triple::ARMSubArch_v8_1m_mainline;
+ }
+}
+
static bool isNoCommonDefault(const llvm::Triple &Triple) {
switch (Triple.getArch()) {
default:
@@ -4678,7 +4689,11 @@
(Args.hasArg(options::OPT_mkernel) && types::isCXX(InputType)))
CmdArgs.push_back("-fapple-kext");
- Args.AddLastArg(CmdArgs, options::OPT_flax_vector_conversions_EQ);
+ if (Args.getLastArg(options::OPT_flax_vector_conversions_EQ)) {
+ Args.AddLastArg(CmdArgs, options::OPT_flax_vector_conversions_EQ);
+ } else if (!isLaxVectorConversionsDefault(Triple)) {
+ CmdArgs.push_back("-flax-vector-conversions=none");
+ }
Args.AddLastArg(CmdArgs, options::OPT_fobjc_sender_dependent_dispatch);
Args.AddLastArg(CmdArgs, options::OPT_fdiagnostics_print_source_range_info);
Args.AddLastArg(CmdArgs, options::OPT_fdiagnostics_parseable_fixits);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67160.224031.patch
Type: text/x-patch
Size: 1869 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191009/46700539/attachment.bin>
More information about the cfe-commits
mailing list