[llvm] r269654 - [LAA] Add option to disable conflict detection (NFC)

Matthew Simpson via llvm-commits llvm-commits at lists.llvm.org
Mon May 16 07:14:50 PDT 2016


Author: mssimpso
Date: Mon May 16 09:14:49 2016
New Revision: 269654

URL: http://llvm.org/viewvc/llvm-project?rev=269654&view=rev
Log:
[LAA] Add option to disable conflict detection (NFC)

Modified:
    llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp

Modified: llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp?rev=269654&r1=269653&r2=269654&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp Mon May 16 09:14:49 2016
@@ -65,6 +65,13 @@ static cl::opt<unsigned>
                             "loop-access analysis (default = 100)"),
                    cl::init(100));
 
+/// \brief Enable the conflict detection optimization. This option can be
+/// disabled for correctness testing.
+static cl::opt<bool> EnableConflictDetection(
+    "enable-conflict-detection", cl::Hidden,
+    cl::desc("Enable conflict detection in loop-access analysis"),
+    cl::init(true));
+
 bool VectorizerParams::isInterleaveForced() {
   return ::VectorizationInterleave.getNumOccurrences() > 0;
 }
@@ -1203,7 +1210,7 @@ MemoryDepChecker::isDependent(const MemA
   const APInt &Val = C->getAPInt();
   if (Val.isNegative()) {
     bool IsTrueDataDependence = (AIsWrite && !BIsWrite);
-    if (IsTrueDataDependence &&
+    if (IsTrueDataDependence && EnableConflictDetection &&
         (couldPreventStoreLoadForward(Val.abs().getZExtValue(), TypeByteSize) ||
          ATy != BTy)) {
       DEBUG(dbgs() << "LAA: Forward but may prevent st->ld forwarding\n");
@@ -1309,7 +1316,7 @@ MemoryDepChecker::isDependent(const MemA
       Distance < MaxSafeDepDistBytes ? Distance : MaxSafeDepDistBytes;
 
   bool IsTrueDataDependence = (!AIsWrite && BIsWrite);
-  if (IsTrueDataDependence &&
+  if (IsTrueDataDependence && EnableConflictDetection &&
       couldPreventStoreLoadForward(Distance, TypeByteSize))
     return Dependence::BackwardVectorizableButPreventsForwarding;
 




More information about the llvm-commits mailing list