diff options
| author | Philip Reames <listmail@philipreames.com> | 2019-04-18 17:01:19 +0000 |
|---|---|---|
| committer | Philip Reames <listmail@philipreames.com> | 2019-04-18 17:01:19 +0000 |
| commit | adf288c5d93e60a91fe226ae2dcebad0f760a259 (patch) | |
| tree | 1f6d97c45218e63cbee36c5a5db4d7953068b9ee /llvm/lib/Transforms | |
| parent | 51fa60bcbb91961849bef930584ec08ddad8eecf (diff) | |
| download | bcm5719-llvm-adf288c5d93e60a91fe226ae2dcebad0f760a259.tar.gz bcm5719-llvm-adf288c5d93e60a91fe226ae2dcebad0f760a259.zip | |
[LoopPred] Fix a blatantly obvious bug in r358684
The bug is that I didn't check whether the operand of the invariant_loads were themselves invariant. I don't know how this got missed in the patch and review. I even had an unreduced test case locally, and I remember handling this case, but I must have lost it in one of the rebases. Oops.
llvm-svn: 358688
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LoopPredication.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopPredication.cpp b/llvm/lib/Transforms/Scalar/LoopPredication.cpp index 0fc796eae18..15e5b6433af 100644 --- a/llvm/lib/Transforms/Scalar/LoopPredication.cpp +++ b/llvm/lib/Transforms/Scalar/LoopPredication.cpp @@ -510,7 +510,7 @@ bool LoopPredication::isLoopInvariantValue(const SCEV* S) { // TODO: This should be sunk inside SCEV. if (const SCEVUnknown *U = dyn_cast<SCEVUnknown>(S)) if (const auto *LI = dyn_cast<LoadInst>(U->getValue())) - if (LI->isUnordered()) + if (LI->isUnordered() && L->hasLoopInvariantOperands(LI)) if (AA->pointsToConstantMemory(LI->getOperand(0)) || LI->getMetadata(LLVMContext::MD_invariant_load) != nullptr) return true; |

