[LDist] Match behavior between invoking via optimization pipeline or opt -loop-distribute
authorAdam Nemet <anemet@apple.com>
Wed, 21 Dec 2016 04:07:40 +0000 (04:07 +0000)
committerAdam Nemet <anemet@apple.com>
Wed, 21 Dec 2016 04:07:40 +0000 (04:07 +0000)
commit32e6a34c02e625184f0a108a5d5c23a6cd90234c
tree889f62a67831f0b9bcd6eea3bff50c9705045e3b
parent1857800cb56caea13cee1e7e664d123274624322
[LDist] Match behavior between invoking via optimization pipeline or opt -loop-distribute

In r267672, where the loop distribution pragma was introduced, I tried
it hard to keep the old behavior for opt: when opt is invoked
with -loop-distribute, it should distribute the loop (it's off by
default when ran via the optimization pipeline).

As MichaelZ has discovered this has the unintended consequence of
breaking a very common developer work-flow to reproduce compilations
using opt: First you print the pass pipeline of clang
with -debug-pass=Arguments and then invoking opt with the returned
arguments.

clang -debug-pass will include -loop-distribute but the pass is invoked
with default=off so nothing happens unless the loop carries the pragma.
While through opt (default=on) we will try to distribute all loops.

This changes opt's default to off as well to match clang.  The tests are
modified to explicitly enable the transformation.

llvm-svn: 290235
18 files changed:
llvm/include/llvm/Transforms/Scalar.h
llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
llvm/lib/Transforms/Scalar/LoopDistribute.cpp
llvm/test/Transforms/LoopDistribute/basic-with-memchecks.ll
llvm/test/Transforms/LoopDistribute/basic.ll
llvm/test/Transforms/LoopDistribute/bounds-expansion-bug.ll
llvm/test/Transforms/LoopDistribute/crash-in-memcheck-generation.ll
llvm/test/Transforms/LoopDistribute/diagnostics-with-hotness-lazy-BFI.ll
llvm/test/Transforms/LoopDistribute/diagnostics-with-hotness.ll
llvm/test/Transforms/LoopDistribute/diagnostics.ll
llvm/test/Transforms/LoopDistribute/no-if-convert.ll
llvm/test/Transforms/LoopDistribute/outside-use.ll
llvm/test/Transforms/LoopDistribute/pr28443.ll
llvm/test/Transforms/LoopDistribute/program-order.ll
llvm/test/Transforms/LoopDistribute/symbolic-stride.ll
llvm/test/Transforms/LoopDistribute/unknown-bounds-for-memchecks.ll
llvm/test/Transforms/LoopVersioning/exit-block-dominates-rt-check-block.ll
llvm/test/Transforms/LoopVersioning/noalias-version-twice.ll