[New PM][IRCE] port of Inductive Range Check Elimination pass to the new pass manager
authorFedor Sergeev <fedor.sergeev@azul.com>
Thu, 15 Mar 2018 11:01:19 +0000 (11:01 +0000)
committerFedor Sergeev <fedor.sergeev@azul.com>
Thu, 15 Mar 2018 11:01:19 +0000 (11:01 +0000)
commit194a407bda2b604ca0e43edbb56ce51989a7dc0a
tree0111706c9876bdb4bd32a16464e2362555bcc506
parent5704dc0c7f6cfd0f2e6519edaf6f444295ccb7ca
[New PM][IRCE] port of Inductive Range Check Elimination pass to the new pass manager

There are two nontrivial details here:
* Loop structure update interface is quite different with new pass manager,
  so the code to add new loops was factored out

* BranchProbabilityInfo is not a loop analysis, so it can not be just getResult'ed from
  within the loop pass. It cant even be queried through getCachedResult as LoopCanonicalization
  sequence (e.g. LoopSimplify) might invalidate BPI results.

  Complete solution for BPI will likely take some time to discuss and figure out,
  so for now this was partially solved by making BPI optional in IRCE
  (skipping a couple of profitability checks if it is absent).

Most of the IRCE tests got their corresponding new-pass-manager variant enabled.
Only two of them depend on BPI, both marked with TODO, to be turned on when BPI
starts being available for loop passes.

Reviewers: chandlerc, mkazantsev, sanjoy, asbirlea
Reviewed By: mkazantsev
Differential Revision: https://reviews.llvm.org/D43795

llvm-svn: 327619
33 files changed:
llvm/include/llvm/InitializePasses.h
llvm/include/llvm/Transforms/Scalar/InductiveRangeCheckElimination.h [new file with mode: 0644]
llvm/lib/Passes/PassBuilder.cpp
llvm/lib/Passes/PassRegistry.def
llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
llvm/lib/Transforms/Scalar/Scalar.cpp
llvm/test/Transforms/IRCE/add-metadata-pre-post-loops.ll
llvm/test/Transforms/IRCE/bad-loop-structure.ll
llvm/test/Transforms/IRCE/bad_expander.ll
llvm/test/Transforms/IRCE/bug-loop-varying-upper-limit.ll
llvm/test/Transforms/IRCE/bug-mismatched-types.ll
llvm/test/Transforms/IRCE/clamp.ll
llvm/test/Transforms/IRCE/conjunctive-checks.ll
llvm/test/Transforms/IRCE/correct-loop-info.ll
llvm/test/Transforms/IRCE/decrementing-loop.ll
llvm/test/Transforms/IRCE/empty_ranges.ll
llvm/test/Transforms/IRCE/eq_ne.ll
llvm/test/Transforms/IRCE/low-becount.ll
llvm/test/Transforms/IRCE/multiple-access-no-preloop.ll
llvm/test/Transforms/IRCE/not-likely-taken.ll
llvm/test/Transforms/IRCE/only-lower-check.ll
llvm/test/Transforms/IRCE/only-upper-check.ll
llvm/test/Transforms/IRCE/pre_post_loops.ll
llvm/test/Transforms/IRCE/range_intersect_miscompile.ll
llvm/test/Transforms/IRCE/ranges_of_different_types.ll
llvm/test/Transforms/IRCE/single-access-no-preloop.ll
llvm/test/Transforms/IRCE/single-access-with-preloop.ll
llvm/test/Transforms/IRCE/skip-profitability-checks.ll
llvm/test/Transforms/IRCE/stride_more_than_1.ll
llvm/test/Transforms/IRCE/unhandled.ll
llvm/test/Transforms/IRCE/unsigned_comparisons_ugt.ll
llvm/test/Transforms/IRCE/unsigned_comparisons_ult.ll
llvm/test/Transforms/IRCE/with-parent-loops.ll