forked from OSchip/llvm-project
[cgp] group related code together [nfc]
This commit is contained in:
parent
e60ab72137
commit
e85d798b5b
|
@ -1348,14 +1348,15 @@ bool CodeGenPrepare::replaceMathCmpWithIntrinsic(BinaryOperator *BO,
|
|||
return false;
|
||||
const Loop *L = LI->getLoopFor(BO->getParent());
|
||||
assert(L && "L should not be null after isIVIncrement()");
|
||||
// Do not risk on moving increment into a child loop.
|
||||
if (LI->getLoopFor(Cmp->getParent()) != L)
|
||||
return false;
|
||||
|
||||
// IV increment may have other users than the IV. We do not want to make
|
||||
// dominance queries to analyze the legality of moving it towards the cmp,
|
||||
// so just check that there is no other users.
|
||||
if (!BO->hasOneUse())
|
||||
return false;
|
||||
// Do not risk on moving increment into a child loop.
|
||||
if (LI->getLoopFor(Cmp->getParent()) != L)
|
||||
return false;
|
||||
// Ultimately, the insertion point must dominate latch. This should be a
|
||||
// cheap check because no CFG changes & dom tree recomputation happens
|
||||
// during the transform.
|
||||
|
|
Loading…
Reference in New Issue