WIP/RFC: Add intrinsics for querying the debug level#45948
WIP/RFC: Add intrinsics for querying the debug level#45948
Conversation
|
Hm I am a bit worried about codesize if we make it a multi-versioning property every |
|
Multiversioning could also support dispatching to the JIT at run time instead of cloning eagerly (although again I'm currently not familiar enough with the pass to implement such a feature). |
|
I think making it a Julia intrinsics and then marking branches that depend on it as cold would be a good first start and then we can later look at making it stronger. That would also prevent it from giving different optimization results depending on if the flag is on and off (which would be a boon on my side). I recently got burned by allocation tracking changing optimization results and yielding false positives. |
I don't think that matters here though. If you're running with |
To enable a cheaper version of #37874, we want compiler support for querying the debug level. This PR prototypes such a feature in two different ways:
The former is the simplest, but ideally we also want this functionality for the system image. That normally done with the multiversioning pass, which would require the intrinsic to be an LLVM intrinsic, hence the second form. I'm however not sure how to best adapt the multiversioning pass, if it even is suitable for this, so @yuyichao I'd appreciate some thoughts here.
Alternatively we could only have this supported for JITted code and basically require users to
make debugin order to get a debug sysimg, but that would be much less user friendly.cc @KristofferC