[PATCH] D62610: [DA] Add an option to control delinearization validity checks
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 6 08:09:50 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL362711: [DA] Add an option to control delinearization validity checks (authored by whitneyt, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D62610?vs=203003&id=203369#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62610/new/
https://reviews.llvm.org/D62610
Files:
llvm/trunk/lib/Analysis/DependenceAnalysis.cpp
Index: llvm/trunk/lib/Analysis/DependenceAnalysis.cpp
===================================================================
--- llvm/trunk/lib/Analysis/DependenceAnalysis.cpp
+++ llvm/trunk/lib/Analysis/DependenceAnalysis.cpp
@@ -109,6 +109,14 @@
static cl::opt<bool>
Delinearize("da-delinearize", cl::init(true), cl::Hidden, cl::ZeroOrMore,
cl::desc("Try to delinearize array references."));
+static cl::opt<bool> DisableDelinearizationChecks(
+ "da-disable-delinearization-checks", cl::init(false), cl::Hidden,
+ cl::ZeroOrMore,
+ cl::desc(
+ "Disable checks that try to statically verify validity of "
+ "delinearized subscripts. Enabling this option may result in incorrect "
+ "dependence vectors for languages that allow the subscript of one "
+ "dimension to underflow or overflow into another dimension."));
//===----------------------------------------------------------------------===//
// basics
@@ -3316,19 +3324,20 @@
// and dst.
// FIXME: It may be better to record these sizes and add them as constraints
// to the dependency checks.
- for (int i = 1; i < size; ++i) {
- if (!isKnownNonNegative(SrcSubscripts[i], SrcPtr))
- return false;
+ if (!DisableDelinearizationChecks)
+ for (int i = 1; i < size; ++i) {
+ if (!isKnownNonNegative(SrcSubscripts[i], SrcPtr))
+ return false;
- if (!isKnownLessThan(SrcSubscripts[i], Sizes[i - 1]))
- return false;
+ if (!isKnownLessThan(SrcSubscripts[i], Sizes[i - 1]))
+ return false;
- if (!isKnownNonNegative(DstSubscripts[i], DstPtr))
- return false;
+ if (!isKnownNonNegative(DstSubscripts[i], DstPtr))
+ return false;
- if (!isKnownLessThan(DstSubscripts[i], Sizes[i - 1]))
- return false;
- }
+ if (!isKnownLessThan(DstSubscripts[i], Sizes[i - 1]))
+ return false;
+ }
LLVM_DEBUG({
dbgs() << "\nSrcSubscripts: ";
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62610.203369.patch
Type: text/x-patch
Size: 1948 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190606/c4d4b581/attachment.bin>
More information about the llvm-commits
mailing list