llvm: Set warn-stack-size=0 on naked functions.#21207
Closed
alexrp wants to merge 1 commit intoziglang:masterfrom
alexrp:llvm-naked-fn-stack-size
Closed
llvm: Set warn-stack-size=0 on naked functions.#21207alexrp wants to merge 1 commit intoziglang:masterfrom alexrp:llvm-naked-fn-stack-size
llvm: Set warn-stack-size=0 on naked functions.#21207alexrp wants to merge 1 commit intoziglang:masterfrom
alexrp:llvm-naked-fn-stack-size
Conversation
This makes LLVM produce a warning if *any* stack allocations happen.
Member
Author
|
Just to be clear, this is for stack allocations that LLVM introduces, not us, so #21082 does not help with this. When compiling in debug mode, LLVM's register allocator seems to use a fast but low-quality block-local allocation strategy that results in spills for any branch, which is what happened in #21193. |
Member
|
I don't find this to be acceptable. Writing some crap to stderr when the requirements cannot be met is the wrong road to go down. Take it up with the LLVM devs, this is not a good enough API for us. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes LLVM produce a warning if any stack allocations happen.
As suggested by @zeroZshadow after discussion about #21193:
It's not the most ideal way to surface this information, but it's a lot better than silently wrong codegen.