[LoopUnroll] Include hotness of region in opt remark
authorAdam Nemet <anemet@apple.com>
Fri, 29 Jul 2016 19:29:47 +0000 (19:29 +0000)
committerAdam Nemet <anemet@apple.com>
Fri, 29 Jul 2016 19:29:47 +0000 (19:29 +0000)
commit12937c361fb17467b18ab14e9e7b81e2477f5c82
tree8ff1ff2762338cfce2cfeb89861f49bb20c52b4e
parent716a94787cdfb3ad71f2b6b5ac5cea3d0f127de0
[LoopUnroll] Include hotness of region in opt remark

LoopUnroll is a loop pass, so the analysis of OptimizationRemarkEmitter
is added to the common function analysis passes that loop passes
depend on.

The BFI and indirectly BPI used in this pass is computed lazily so no
overhead should be observed unless -pass-remarks-with-hotness is used.

This is how the patch affects the O3 pipeline:

         Dominator Tree Construction
         Natural Loop Information
         Canonicalize natural loops
         Loop-Closed SSA Form Pass
         Basic Alias Analysis (stateless AA impl)
         Function Alias Analysis Results
         Scalar Evolution Analysis
+        Lazy Branch Probability Analysis
+        Lazy Block Frequency Analysis
+        Optimization Remark Emitter
         Loop Pass Manager
           Rotate Loops
           Loop Invariant Code Motion
           Unswitch loops
         Simplify the CFG
         Dominator Tree Construction
         Basic Alias Analysis (stateless AA impl)
         Function Alias Analysis Results
         Combine redundant instructions
         Natural Loop Information
         Canonicalize natural loops
         Loop-Closed SSA Form Pass
         Scalar Evolution Analysis
+        Lazy Branch Probability Analysis
+        Lazy Block Frequency Analysis
+        Optimization Remark Emitter
         Loop Pass Manager
           Induction Variable Simplification
           Recognize loop idioms
           Delete dead loops
           Unroll loops
...

llvm-svn: 277203
llvm/include/llvm/Transforms/Utils/UnrollLoop.h
llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
llvm/lib/Transforms/Utils/LoopUnroll.cpp
llvm/lib/Transforms/Utils/LoopUtils.cpp
llvm/test/Transforms/LoopUnroll/loop-remarks-with-hotness.ll [new file with mode: 0644]
llvm/test/Transforms/LoopUnroll/unloop.ll