[PATCH] D75204: [VectorCombine] add a debug flag to skip all transforms

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 26 12:18:26 PST 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG25c6544f32ee: [VectorCombine] add a debug flag to skip all transforms (authored by spatel).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75204/new/

https://reviews.llvm.org/D75204

Files:
  llvm/lib/Transforms/Vectorize/VectorCombine.cpp


Index: llvm/lib/Transforms/Vectorize/VectorCombine.cpp
===================================================================
--- llvm/lib/Transforms/Vectorize/VectorCombine.cpp
+++ llvm/lib/Transforms/Vectorize/VectorCombine.cpp
@@ -23,6 +23,7 @@
 #include "llvm/IR/PatternMatch.h"
 #include "llvm/InitializePasses.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/CommandLine.h"
 #include "llvm/Transforms/Vectorize.h"
 #include "llvm/Transforms/Utils/Local.h"
 
@@ -33,6 +34,10 @@
 STATISTIC(NumVecCmp, "Number of vector compares formed");
 STATISTIC(NumVecBO, "Number of vector binops formed");
 
+static cl::opt<bool> DisableVectorCombine(
+    "disable-vector-combine", cl::init(false), cl::Hidden,
+    cl::desc("Disable all vector combine transforms"));
+
 /// Compare the relative costs of extracts followed by scalar operation vs.
 /// vector operation followed by extract:
 /// opcode (extelt V0, C), (extelt V1, C) --> extelt (opcode V0, V1), C
@@ -175,6 +180,9 @@
 /// handled in the callers of this function.
 static bool runImpl(Function &F, const TargetTransformInfo &TTI,
                     const DominatorTree &DT) {
+  if (DisableVectorCombine)
+    return false;
+
   bool MadeChange = false;
   for (BasicBlock &BB : F) {
     // Ignore unreachable basic blocks.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75204.246814.patch
Type: text/x-patch
Size: 1284 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200226/292fd866/attachment.bin>


More information about the llvm-commits mailing list