summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Simpson <mssimpso@codeaurora.org>2016-05-16 14:14:49 +0000
committerMatthew Simpson <mssimpso@codeaurora.org>2016-05-16 14:14:49 +0000
commita250dc9f111f1af6a413adf6a3749df857d668bc (patch)
treef50fa63bf93129a0828947e17f394ed9fb6c86f3
parentc73d559df43a0f19b0ee734cae9db2fb6c964120 (diff)
downloadbcm5719-llvm-a250dc9f111f1af6a413adf6a3749df857d668bc.tar.gz
bcm5719-llvm-a250dc9f111f1af6a413adf6a3749df857d668bc.zip
[LAA] Add option to disable conflict detection (NFC)
llvm-svn: 269654
-rw-r--r--llvm/lib/Analysis/LoopAccessAnalysis.cpp11
1 files changed, 9 insertions, 2 deletions
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<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 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;
OpenPOWER on IntegriCloud