OSDN Git Service

[hot-cold-split] fix static analysis of cold regions
authorSebastian Pop <sebpop@gmail.com>
Mon, 15 Oct 2018 21:43:11 +0000 (21:43 +0000)
committerSebastian Pop <sebpop@gmail.com>
Mon, 15 Oct 2018 21:43:11 +0000 (21:43 +0000)
commite2d6b27abc89920c7b964c3b2d6544a2e51480d2
treee81e3f375ca80e329675d907a197626bff1f7309
parent11b69c205d90be3ef1ebc5c676bdaa485a3c6475
[hot-cold-split] fix static analysis of cold regions

Make the code of blockEndsInUnreachable to match the function
blockEndsInUnreachable in CodeGen/BranchFolding.cpp. I also have
added a note to make sure the code of this function will not be
modified unless the back-end version is also modified.

An early return before outlining has been added to avoid
outlining the full function body when the first block in the
function is marked cold.

The static analysis of cold code has been amended to avoid
marking the whole function as cold by back-propagation
because the back-propagation would mark blocks with return
statements as cold.

The patch adds debug statements to help discover these problems.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344558 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/HotColdSplitting.cpp
test/Transforms/HotColdSplit/split-cold-1.ll
test/Transforms/HotColdSplit/split-cold-2.ll