[HotColdSplitting] Attach MinSize to outlined code
authorVedant Kumar <vsk@apple.com>
Tue, 23 Oct 2018 19:41:12 +0000 (19:41 +0000)
committerVedant Kumar <vsk@apple.com>
Tue, 23 Oct 2018 19:41:12 +0000 (19:41 +0000)
commit503154615dac70491fef4797da6b35761320aaa1
tree918f593721da57c2eea4c75be662b4dfbcfa52e8
parent551a9585ce5c8e1e2afa5cbd8dc7a7c4fe5fdb85
[HotColdSplitting] Attach MinSize to outlined code

Outlined code is cold by assumption, so it makes sense to optimize it
for minimal code size rather than performance.

After r344869 moved the splitting pass to the end of the IR pipeline,
this does not result in much of a code size reduction. This is probably
because a comparatively small number backend transforms make use of the
MinSize hint.

Running LNT on x86_64, I see that 33/1020 binaries shrink for a total of
919 bytes of TEXT reduction. I didn't measure a significant performance
impact.

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

llvm-svn: 345072
llvm/lib/Transforms/IPO/HotColdSplitting.cpp
llvm/test/Transforms/HotColdSplit/minsize.ll [new file with mode: 0644]