diff options
author | Matthew Simpson <mssimpso@codeaurora.org> | 2016-05-16 14:14:49 +0000 |
---|---|---|
committer | Matthew Simpson <mssimpso@codeaurora.org> | 2016-05-16 14:14:49 +0000 |
commit | a250dc9f111f1af6a413adf6a3749df857d668bc (patch) | |
tree | f50fa63bf93129a0828947e17f394ed9fb6c86f3 /llvm/lib/Analysis/LoopAccessAnalysis.cpp | |
parent | c73d559df43a0f19b0ee734cae9db2fb6c964120 (diff) | |
download | bcm5719-llvm-a250dc9f111f1af6a413adf6a3749df857d668bc.tar.gz bcm5719-llvm-a250dc9f111f1af6a413adf6a3749df857d668bc.zip |
[LAA] Add option to disable conflict detection (NFC)
llvm-svn: 269654
Diffstat (limited to 'llvm/lib/Analysis/LoopAccessAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/LoopAccessAnalysis.cpp | 11 |
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; |