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.
|
||||
//
|
||||
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,
|
||||
ORE) &&
|
||||
!I.mayHaveSideEffects()) {
|
||||
ORE)) {
|
||||
if (sink(I, LI, DT, CurLoop, SafetyInfo, MSSAU, ORE)) {
|
||||
if (!FreeInLoop) {
|
||||
++II;
|
||||
|
|
Loading…
Reference in New Issue