[LoopUnroll] Use OptimizationRemarkEmitter directly not via the analysis pass
authorAdam Nemet <anemet@apple.com>
Fri, 26 Aug 2016 15:58:34 +0000 (15:58 +0000)
committerAdam Nemet <anemet@apple.com>
Fri, 26 Aug 2016 15:58:34 +0000 (15:58 +0000)
commit4f155b6e9122d4a95d98cab04ac4a18a64e389d5
treef84056ebd738f4f2c80a31b47414f85cb35b7959
parentf7ba0891ce6369cee4245991824a73279ca31258
[LoopUnroll] Use OptimizationRemarkEmitter directly not via the analysis pass

We can't mark ORE (a function pass) preserved as required by the loop
passes because that is how we ensure that the required passes like
LazyBFI are all available any time ORE is used.  See the new comments in
the patch.

Instead we use it directly just like the inliner does in D22694.

As expected there is some additional overhead after removing the caching
provided by analysis passes.  The worst case, I measured was
LNT/CINT2006_ref/401.bzip2 which regresses by 12%.  As before, this only
affects -Rpass-with-hotness and not default compilation.

llvm-svn: 279829
llvm/include/llvm/Analysis/OptimizationDiagnosticInfo.h
llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
llvm/lib/Transforms/Utils/LoopUtils.cpp