r345170 - [Hexagon] Flip hexagon-autohvx to be true by default

Krzysztof Parzyszek via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 24 10:55:19 PDT 2018


Author: kparzysz
Date: Wed Oct 24 10:55:18 2018
New Revision: 345170

URL: http://llvm.org/viewvc/llvm-project?rev=345170&view=rev
Log:
[Hexagon] Flip hexagon-autohvx to be true by default

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.

Modified:
    cfe/trunk/lib/Driver/ToolChains/Hexagon.cpp
    cfe/trunk/test/Driver/hexagon-vectorize.c

Modified: cfe/trunk/lib/Driver/ToolChains/Hexagon.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Hexagon.cpp?rev=345170&r1=345169&r2=345170&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Hexagon.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Hexagon.cpp Wed Oct 24 10:55:18 2018
@@ -516,9 +516,9 @@ void HexagonToolChain::addClangTargetOpt
     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");
   }
 }
 

Modified: cfe/trunk/test/Driver/hexagon-vectorize.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/hexagon-vectorize.c?rev=345170&r1=345169&r2=345170&view=diff
==============================================================================
--- cfe/trunk/test/Driver/hexagon-vectorize.c (original)
+++ cfe/trunk/test/Driver/hexagon-vectorize.c Wed Oct 24 10:55:18 2018
@@ -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




More information about the cfe-commits mailing list