Use profile info to adjust loop unroll threshold.
authorDehao Chen <dehao@google.com>
Thu, 17 Nov 2016 01:17:02 +0000 (01:17 +0000)
committerDehao Chen <dehao@google.com>
Thu, 17 Nov 2016 01:17:02 +0000 (01:17 +0000)
commit41d72a8632605ad9366b9bfcd12fe80a177b80ca
tree8c52313d46859c2c91ec359ae6d57836f7e70379
parent9103036f5ffadf7a881e8dca42ff862570d1e79f
Use profile info to adjust loop unroll threshold.

Summary:
For flat loop, even if it is hot, it is not a good idea to unroll in runtime, thus we set a lower partial unroll threshold.
For hot loop, we set a higher unroll threshold and allows expensive tripcount computation to allow more aggressive unrolling.

Reviewers: davidxl, mzolotukhin

Subscribers: sanjoy, mehdi_amini, llvm-commits

Differential Revision: https://reviews.llvm.org/D26527

llvm-svn: 287186
llvm/include/llvm/Transforms/Utils/LoopUtils.h
llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
llvm/lib/Transforms/Utils/LoopUtils.cpp
llvm/test/Transforms/LoopUnroll/unroll-heuristics-pgo.ll [new file with mode: 0644]