diff options
| author | Philip Reames <listmail@philipreames.com> | 2019-07-09 01:27:45 +0000 |
|---|---|---|
| committer | Philip Reames <listmail@philipreames.com> | 2019-07-09 01:27:45 +0000 |
| commit | 5a637cbdc7d8a59d5d56f329871cb3834c1f5095 (patch) | |
| tree | ba7fc4e5ebd62c7ab460751f4fc54a1678449537 /llvm/lib/Transforms | |
| parent | 8f9a4b2af0500f6e8fda494e01384fb0215ffa71 (diff) | |
| download | bcm5719-llvm-5a637cbdc7d8a59d5d56f329871cb3834c1f5095.tar.gz bcm5719-llvm-5a637cbdc7d8a59d5d56f329871cb3834c1f5095.zip | |
[LoopPred] Extend LFTR normalization to the inverse EQ case
A while back, I added support for NE latches formed by LFTR. I didn't think that quite through, as LFTR will also produce the inverse EQ form for some loops and I hadn't handled that. This change just adds handling for that case as well.
llvm-svn: 365419
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LoopPredication.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopPredication.cpp b/llvm/lib/Transforms/Scalar/LoopPredication.cpp index d3cec7568b6..4ee3d0079c7 100644 --- a/llvm/lib/Transforms/Scalar/LoopPredication.cpp +++ b/llvm/lib/Transforms/Scalar/LoopPredication.cpp @@ -653,6 +653,11 @@ static void normalizePredicate(ScalarEvolution *SE, Loop *L, RC.IV->getStepRecurrence(*SE)->isOne() && SE->isKnownPredicate(ICmpInst::ICMP_ULE, RC.IV->getStart(), RC.Limit)) RC.Pred = ICmpInst::ICMP_ULT; + if (RC.Pred == ICmpInst::ICMP_EQ && + RC.IV->getStepRecurrence(*SE)->isOne() && + SE->isKnownPredicate(ICmpInst::ICMP_ULE, RC.IV->getStart(), RC.Limit)) + RC.Pred = ICmpInst::ICMP_UGE; + } |

