[Hexagon] Flip hexagon-autohvx to be true by default
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>
Wed, 24 Oct 2018 17:55:18 +0000 (17:55 +0000)
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>
Wed, 24 Oct 2018 17:55:18 +0000 (17:55 +0000)
This will allow other generators of LLVM IR to use the auto-vectorizer
without having to change that flag.

Note: on its own, this patch will disable auto-vectorization on Hexagon
in all cases, regardless of the -fvectorize flag. There is a companion
LLVM patch that together with this one forms an NFC for clang users.

llvm-svn: 345170

clang/lib/Driver/ToolChains/Hexagon.cpp
clang/test/Driver/hexagon-vectorize.c

index 8778a1a..4da63a6 100644 (file)
@@ -516,9 +516,9 @@ void HexagonToolChain::addClangTargetOptions(const ArgList &DriverArgs,
     CC1Args.push_back("-target-feature");
     CC1Args.push_back("+reserved-r19");
   }
-  if (isAutoHVXEnabled(DriverArgs)) {
+  if (!isAutoHVXEnabled(DriverArgs)) {
     CC1Args.push_back("-mllvm");
-    CC1Args.push_back("-hexagon-autohvx");
+    CC1Args.push_back("-hexagon-autohvx=0");
   }
 }
 
index dcd6a09..145011c 100644 (file)
@@ -3,7 +3,7 @@
 // RUN: %clang -target hexagon -fvectorize -fno-vectorize -### %s 2>&1 | FileCheck %s --check-prefix=CHECK-NOVECTOR
 // RUN: %clang -target hexagon -fvectorize -### %s 2>&1 | FileCheck %s --check-prefix=CHECK-NEEDHVX
 
-// CHECK-DEFAULT-NOT: hexagon-autohvx
-// CHECK-VECTOR: "-mllvm" "-hexagon-autohvx"
-// CHECK-NOVECTOR-NOT: hexagon-autohvx
+// CHECK-DEFAULT: -hexagon-autohvx={{false|0}}
+// CHECK-VECTOR-NOT: -hexagon-autohvx={{false|0}}
+// CHECK-NOVECTOR: -hexagon-autohvx={{false|0}}
 // CHECK-NEEDHVX: warning: auto-vectorization requires HVX, use -mhvx to enable it