See discussion here.
-mllvm -inline-max-stacksize=<NBytes>
The intent is to give the user a way to prevent inlining of functions with large stack sizes. There is no change in behavior if the option is not used. I opted for direct suppression instead of adding to the inlining cost, as that would have added uncertainty.
Works for LTO as well.
If this is acceptable I'll add a clang option in a separate patch.
Any opinions or suggestions are welcome.