diff options
author | Nikita Popov <npopov@redhat.com> | 2023-08-11 16:56:02 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2023-08-11 16:56:02 +0200 |
commit | 5820c9257e38fbfc15c314b50e629616800a0f95 (patch) | |
tree | a57a949fc82510022e56e2e101c253a7608f73c5 /llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp | |
parent | ed72dc8c1fdae691f5d57bb2254e3922db46b7e2 (diff) | |
download | llvm-5820c9257e38fbfc15c314b50e629616800a0f95.zip llvm-5820c9257e38fbfc15c314b50e629616800a0f95.tar.gz llvm-5820c9257e38fbfc15c314b50e629616800a0f95.tar.bz2 |
[SCEVExpander] Use early continue and move comment (NFC)
In preparation for adding additional checks here.
Diffstat (limited to 'llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp b/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp index 2084427..f41aa47 100644 --- a/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp +++ b/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp @@ -1470,20 +1470,21 @@ Value *SCEVExpander::FindValueInExprValueMap(const SCEV *S, if (isa<SCEVConstant>(S)) return nullptr; - // Choose a Value from the set which dominates the InsertPt. - // InsertPt should be inside the Value's parent loop so as not to break - // the LCSSA form. for (Value *V : SE.getSCEVValues(S)) { Instruction *EntInst = dyn_cast<Instruction>(V); if (!EntInst) continue; + // Choose a Value from the set which dominates the InsertPt. + // InsertPt should be inside the Value's parent loop so as not to break + // the LCSSA form. assert(EntInst->getFunction() == InsertPt->getFunction()); - if (S->getType() == V->getType() && - SE.DT.dominates(EntInst, InsertPt) && - (SE.LI.getLoopFor(EntInst->getParent()) == nullptr || - SE.LI.getLoopFor(EntInst->getParent())->contains(InsertPt))) - return V; + if (S->getType() != V->getType() || !SE.DT.dominates(EntInst, InsertPt) || + !(SE.LI.getLoopFor(EntInst->getParent()) == nullptr || + SE.LI.getLoopFor(EntInst->getParent())->contains(InsertPt))) + continue; + + return V; } return nullptr; } |