forked from OSchip/llvm-project
[LICM][NFC] Reorder checks to speed up things slightly
Side effect check is made faster than potentially heavy other checks.
This commit is contained in:
parent
68b2e507e4
commit
a116f0fa86
|
@ -497,10 +497,10 @@ bool llvm::sinkRegion(DomTreeNode *N, AliasAnalysis *AA, LoopInfo *LI,
|
||||||
// operands of the instruction are loop invariant.
|
// operands of the instruction are loop invariant.
|
||||||
//
|
//
|
||||||
bool FreeInLoop = false;
|
bool FreeInLoop = false;
|
||||||
if (isNotUsedOrFreeInLoop(I, CurLoop, SafetyInfo, TTI, FreeInLoop) &&
|
if (!I.mayHaveSideEffects() &&
|
||||||
|
isNotUsedOrFreeInLoop(I, CurLoop, SafetyInfo, TTI, FreeInLoop) &&
|
||||||
canSinkOrHoistInst(I, AA, DT, CurLoop, CurAST, MSSAU, true, &Flags,
|
canSinkOrHoistInst(I, AA, DT, CurLoop, CurAST, MSSAU, true, &Flags,
|
||||||
ORE) &&
|
ORE)) {
|
||||||
!I.mayHaveSideEffects()) {
|
|
||||||
if (sink(I, LI, DT, CurLoop, SafetyInfo, MSSAU, ORE)) {
|
if (sink(I, LI, DT, CurLoop, SafetyInfo, MSSAU, ORE)) {
|
||||||
if (!FreeInLoop) {
|
if (!FreeInLoop) {
|
||||||
++II;
|
++II;
|
||||||
|
|
Loading…
Reference in New Issue