]> granicus.if.org Git - llvm/commit
[LICM] Make Loop ICM profile aware
authorWenlei He <aktoon@gmail.com>
Sun, 11 Aug 2019 06:05:35 +0000 (06:05 +0000)
committerWenlei He <aktoon@gmail.com>
Sun, 11 Aug 2019 06:05:35 +0000 (06:05 +0000)
commite69c6a95e370d8ab1afe3e0c705d320d6140561c
tree6ef55cd592efcf8f97f49a7375488878dff03c48
parent846158a371a6173d886549a7bbedb72f4bd21ca8
[LICM] Make Loop ICM profile aware

Summary:
Hoisting/sinking instruction out of a loop isn't always beneficial. Hoisting an instruction from a cold block inside a loop body out of the loop could hurt performance. This change makes Loop ICM profile aware - it now checks block frequency to make sure hoisting/sinking anly moves instruction to colder block.

Test Plan:

ninja check

Reviewers: asbirlea, sanjoy, reames, nikic, hfinkel, vsk

Reviewed By: asbirlea

Subscribers: fhahn, vsk, davidxl, xbolva00, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368526 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Utils/LoopUtils.h
lib/Transforms/Scalar/LICM.cpp
test/Other/opt-O2-pipeline.ll
test/Other/opt-O3-pipeline.ll
test/Other/opt-Os-pipeline.ll
test/Other/pass-pipelines.ll
test/Transforms/LICM/sink.ll