diff options
| author | Ayal Zaks <ayal.zaks@intel.com> | 2017-08-15 08:32:59 +0000 |
|---|---|---|
| committer | Ayal Zaks <ayal.zaks@intel.com> | 2017-08-15 08:32:59 +0000 |
| commit | 25e2800e206af4e703c6d5ddbf81aa146cea1ec4 (patch) | |
| tree | 7913f5096f55b127c28088e66c9ce2266f0bed9f /llvm/lib/Transforms/Utils | |
| parent | b8417531dd37bff176df440bc013b036eda2c6a4 (diff) | |
| download | bcm5719-llvm-25e2800e206af4e703c6d5ddbf81aa146cea1ec4.tar.gz bcm5719-llvm-25e2800e206af4e703c6d5ddbf81aa146cea1ec4.zip | |
[LV] Minor savings to Sink casts to unravel first order recurrence
Two minor savings: avoid copying the SinkAfter map and avoid moving a cast if it
is not needed.
Differential Revision: https://reviews.llvm.org/D36408
llvm-svn: 310910
Diffstat (limited to 'llvm/lib/Transforms/Utils')
| -rw-r--r-- | llvm/lib/Transforms/Utils/LoopUtils.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp index 3c522786641..f2015c6389b 100644 --- a/llvm/lib/Transforms/Utils/LoopUtils.cpp +++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp @@ -565,7 +565,8 @@ bool RecurrenceDescriptor::isFirstOrderRecurrence( auto *I = Phi->user_back(); if (I->isCast() && (I->getParent() == Phi->getParent()) && I->hasOneUse() && DT->dominates(Previous, I->user_back())) { - SinkAfter[I] = Previous; + if (!DT->dominates(Previous, I)) // Otherwise we're good w/o sinking. + SinkAfter[I] = Previous; return true; } } |

