[PATCH] D17435: [LPM] Factor all of the loop analysis usage updates into a common helper routine.

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 20:18:43 PST 2016


chandlerc created this revision.
chandlerc added a reviewer: hfinkel.
chandlerc added a subscriber: llvm-commits.
Herald added subscribers: mzolotukhin, mcrosier, sanjoy.

We were getting this wrong in small ways and generally being very
inconsistent about it across loop passes. Instead, let's have a common
place where we do this. One minor downside is that this will require
some analyses like SCEV in more places than they are strictly needed.
However, this seems benign as these analyses are complete no-ops, and
without this consistency we can in many cases end up with the legacy
pass manager scheduling deciding to split up a loop pass pipeline in
order to run the function analysis half-way through. It is very, very
annoying to fix these without just being very pedantic across the board.

The only loop passes I've not updated here are ones that use
AU.setPreservesAll() such as IVUsers (an analysis) and the pass printer.
They seemed less relevant.

With this patch, almost all of the problems in PR24804 around loop pass
pipelines are fixed. The one remaining issue is that we run simplify-cfg
and instcombine in the middle of the loop pass pipeline. We've recently
added some loop variants of these passes that would seem substantially
cleaner to use, but this at least gets us much closer to the previous
state. Notably, the seven loop pass managers is down to three.

Note that this doesn't currently pass tests because in changing this, I've made
the INITIALIZE_PASS_DEPENDENCY nonsense totally not work. I'll fix that, but
that won't change the substantive parts of this patch that I'd really like to
get review feedback on -- essentially, is this a reasonable approach?

http://reviews.llvm.org/D17435

Files:
  include/llvm/Transforms/Utils/LoopUtils.h
  lib/Transforms/IPO/LoopExtractor.cpp
  lib/Transforms/Scalar/IndVarSimplify.cpp
  lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
  lib/Transforms/Scalar/LICM.cpp
  lib/Transforms/Scalar/LoopDeletion.cpp
  lib/Transforms/Scalar/LoopDistribute.cpp
  lib/Transforms/Scalar/LoopIdiomRecognize.cpp
  lib/Transforms/Scalar/LoopInstSimplify.cpp
  lib/Transforms/Scalar/LoopRerollPass.cpp
  lib/Transforms/Scalar/LoopRotation.cpp
  lib/Transforms/Scalar/LoopSimplifyCFG.cpp
  lib/Transforms/Scalar/LoopStrengthReduce.cpp
  lib/Transforms/Scalar/LoopUnrollPass.cpp
  lib/Transforms/Scalar/LoopUnswitch.cpp
  lib/Transforms/Scalar/LoopVersioningLICM.cpp
  lib/Transforms/Utils/LoopUtils.cpp
  test/Other/pass-pipelines.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17435.48451.patch
Type: text/x-patch
Size: 19970 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160219/cd94fe7a/attachment.bin>


More information about the llvm-commits mailing list