From a250dc9f111f1af6a413adf6a3749df857d668bc Mon Sep 17 00:00:00 2001 From: Matthew Simpson Date: Mon, 16 May 2016 14:14:49 +0000 Subject: [LAA] Add option to disable conflict detection (NFC) llvm-svn: 269654 --- llvm/lib/Analysis/LoopAccessAnalysis.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Analysis/LoopAccessAnalysis.cpp') diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp index 725e9b34c42..6eaf0ff84a9 100644 --- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp +++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp @@ -65,6 +65,13 @@ static cl::opt "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 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 MemAccessInfo &A, unsigned AIdx, 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 MemAccessInfo &A, unsigned AIdx, Distance < MaxSafeDepDistBytes ? Distance : MaxSafeDepDistBytes; bool IsTrueDataDependence = (!AIsWrite && BIsWrite); - if (IsTrueDataDependence && + if (IsTrueDataDependence && EnableConflictDetection && couldPreventStoreLoadForward(Distance, TypeByteSize)) return Dependence::BackwardVectorizableButPreventsForwarding; -- cgit v1.2.3