summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/Delinearization.cpp
diff options
context:
space:
mode:
authorSebastian Pop <spop@codeaurora.org>2014-05-27 22:41:45 +0000
committerSebastian Pop <spop@codeaurora.org>2014-05-27 22:41:45 +0000
commita6e586051388a83198e5e0f1092657a2fc78e133 (patch)
tree04ffe46c2cf36f94705b67e4fbd72db8076cf8f0 /llvm/lib/Analysis/Delinearization.cpp
parentf0e0cca0c761a9a8593873c67d3d081fa0d07ebe (diff)
downloadbcm5719-llvm-a6e586051388a83198e5e0f1092657a2fc78e133.tar.gz
bcm5719-llvm-a6e586051388a83198e5e0f1092657a2fc78e133.zip
remove constant terms
The delinearization is needed only to remove the non linearity induced by expressions involving multiplications of parameters and induction variables. There is no problem in dealing with constant times parameters, or constant times an induction variable. For this reason, the current patch discards all constant terms and multipliers before running the delinearization algorithm on the terms. The only thing remaining in the term expressions are parameters and multiply expressions of parameters: these simplified term expressions are passed to the array shape recognizer that will not recognize constant dimensions anymore: these will be recognized as different strides in parametric subscripts. The only important special case of a constant dimension is the size of elements. Instead of relying on the delinearization to infer the size of an element, compute the element size from the base address type. This is a much more precise way of computing the element size than before, as we would have mixed together the size of an element with the strides of the innermost dimension. llvm-svn: 209691
Diffstat (limited to 'llvm/lib/Analysis/Delinearization.cpp')
-rw-r--r--llvm/lib/Analysis/Delinearization.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/Delinearization.cpp b/llvm/lib/Analysis/Delinearization.cpp
index 1a588211a23..6c8702787d4 100644
--- a/llvm/lib/Analysis/Delinearization.cpp
+++ b/llvm/lib/Analysis/Delinearization.cpp
@@ -108,8 +108,8 @@ void Delinearization::print(raw_ostream &O, const Module *) const {
O << "AddRec: " << *AR << "\n";
SmallVector<const SCEV *, 3> Subscripts, Sizes;
- const SCEV *Res = AR->delinearize(*SE, Subscripts, Sizes);
- if (Res == AR || Subscripts.size() == 0 || Sizes.size() == 0 ||
+ const SCEV *Res = AR->delinearize(*SE, Subscripts, Sizes, SE->getElementSize(Inst));
+ if (Subscripts.size() == 0 || Sizes.size() == 0 ||
Subscripts.size() != Sizes.size()) {
O << "failed to delinearize\n";
continue;
OpenPOWER on IntegriCloud