[PATCH] D15393: [X86] Order the local stack symbols to improve code size and locality.

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 9 14:16:16 PST 2015


rnk added a comment.

Oops, I hit submit too early.

Our current default stack layout algorithm optimizes for stack frame size without accounting for code size from frame offsets. I'm worried that your algorithm may reorder all of the potentially large allocations outside of the 256 bytes of stack that we can address with a smaller offset, and unnecessarily increase stack frame sizes.

I wonder if we can rephrase this as a weighted bin packing problem, where we only have one bin and it has size ~128 bytes, or the max one byte displacement from FP/SP. The object weights would be the use counts, and the goal is to put as many uses into the bin as possible. There's probably a good approximate dynamic programming algorithm that we could use for that.


http://reviews.llvm.org/D15393





More information about the llvm-commits mailing list