[PATCH] D40864: [Darwin] Add a new -mstack-probe option and enable by default
Akira Hatanaka via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 6 11:45:18 PST 2017
ahatanak added inline comments.
================
Comment at: lib/CodeGen/BackendUtil.cpp:442
Options.DebuggerTuning = CodeGenOpts.getDebuggerTuning();
+ Options.EnableStackProbe = CodeGenOpts.StackProbe;
----------------
aemerson wrote:
> ahatanak wrote:
> > Is there a reason you can't use function attributes "probe-stack"="___chkstk_darwin" and "stack-probe-size"=4096 instead of setting a TargetOptions flag here? If you intend to use stack probing with LTO, I think you need function attributes. Also, it looks like that would simplify the changes made to X86 backend.
> I don't think there's any reason not to. Is it worth specifying the probe size itself given that it'll be a known fixed value? It could be misleading to give a probe size which only has a single valid value for Darwin.
If 4096B is the only valid size for Darwin and the default size is 4096B in the backend, you can just add attribute "probe-stack"="___chkstk_darwin" to the function. The backend can check the existence of the attribute and decide whether to enable stack-probing.
Repository:
rC Clang
https://reviews.llvm.org/D40864
More information about the cfe-commits
mailing list