Dale Johannesen wrote:
Certainly. In general it will make the total size bigger, as does inlining. If you have good
information about what's hot and cold, it should reduce the number of pages that actually
get swapped in. The information has to be good, though, as a branch from
hot<->cold section becomes more expensive. I'd recommend it only if you have
profiling data (this is a known winner on Spec in that situation).
Should I do custom basic block reordering in machine_dependent_reorg to clean up
the turds of hot and cold partitioning?
No, you should not turn on partitioning in situations where code size is important to you.
You are missing the point. In my example, with perfect profiling data, you still end up with
more code in the hot section,
Yes.
i.e. more pages are actually swapped in.
Unless the cross-section branch is actually executed, there's no reason the unconditional
jumps should get paged in, so this doesn't follow.
A block should not
be put in the code section unless it is larger than a jump into the cold section.
Worth trying, certainly. My guess is it won't matter much either way.