[PATCH] D39788: [MC] Function stack size section.

Sean Eveson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 16 10:15:05 PST 2017


seaneveson added a comment.

Thanks for the feedback!

> The format of the new section ought to be documented properly in the llvm docs and not just in the commit message and sourcecode.

OK.

> I think this should report a special "unknown" value for functions with dynamic stack allocations.

I agree that would be useful. With the value being ULEB128 we could have 0 as "unknown" and encode everything else as value + 1, or we could not emit those functions (Neither is ideal).

> I'm not 100% sure that MachineFrameInfo::getStackSize() captures all possible allocations; it probably corresponds to what is allocated in the prologue

Yes I think that is the case.

> However we have to be very careful in managing expectations here! I would expect this to need several iterations, bugfixes and testing/fuzzing until I would trust this information in all cases. Nothing is stopping targets from emitting stack pointer modifying code without recording information in MachineFrameInfo.

Agreed. We would like to produce the maximum size each function might be on the stack (where possible). I imagine there will be a lot of cases to account for and we won't be able to foresee all of them (especially for all targets).


https://reviews.llvm.org/D39788





More information about the llvm-commits mailing list