diff options
Diffstat (limited to 'src/passes/LoopInvariantCodeMotion.cpp')
-rw-r--r-- | src/passes/LoopInvariantCodeMotion.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/passes/LoopInvariantCodeMotion.cpp b/src/passes/LoopInvariantCodeMotion.cpp index a95f4c8eb..26e2a0844 100644 --- a/src/passes/LoopInvariantCodeMotion.cpp +++ b/src/passes/LoopInvariantCodeMotion.cpp @@ -60,13 +60,14 @@ struct LoopInvariantCodeMotion // Accumulate effects of things we can't move out - things // we move out later must cross them, so we must verify it // is ok to do so. - EffectAnalyzer effectsSoFar(getPassOptions()); + FeatureSet features = getModule()->features; + EffectAnalyzer effectsSoFar(getPassOptions(), features); // The loop's total effects also matter. For example, a store // in the loop means we can't move a load outside. // FIXME: we look at the loop "tail" area too, after the last // possible branch back, which can cause false positives // for bad effect interactions. - EffectAnalyzer loopEffects(getPassOptions(), loop); + EffectAnalyzer loopEffects(getPassOptions(), features, loop); // Note all the sets in each loop, and how many per index. Currently // EffectAnalyzer can't do that, and we need it to know if we // can move a set out of the loop (if there is another set @@ -107,8 +108,8 @@ struct LoopInvariantCodeMotion // a branch to it anyhow, so we would stop before that point anyhow. } // If this may branch, we are done. - EffectAnalyzer effects(getPassOptions(), curr); - if (effects.branches) { + EffectAnalyzer effects(getPassOptions(), features, curr); + if (effects.transfersControlFlow()) { break; } if (interestingToMove(curr)) { |