[PATCH] D26872: Outliner: Add MIR-level outlining pass

Sean Silva via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 25 14:37:01 PST 2017


silvas added a comment.

btw, down the road you may want to have this pass really know in detail the encoded length of each instruction on x86. There are quite a few *single instructions* that would be beneficial from a code size perspective to outline (if the outlined function is set to have alignment of 1). A quick analysis of an LLD binary (which contains all of LLVM linked in for LTO) shows there is over 5% code size savings just from outlining single instructions (since many x86 instructions encode to be larger than a CALL instruction which is 5 bytes). About half of the benefit (so about 2-3% of the total on this test case) comes from instructions that reference the stack via %rsp (mostly zeroing out stack slots), which could still be outlined if the offset was rewritten.


https://reviews.llvm.org/D26872





More information about the llvm-commits mailing list