XRay allows tuning by minimum function size, but also always instruments
functions with loops in them. If the minimum function size is set to a
large value the loop instrumention ends up causing most functions to be
instrumented anyway. This adds a new flag, xray-ignore-loops, to disable
the loop detection logic.
Details
- Reviewers
hiraditya dberris smeenai - Commits
- rG7628e474a591: [xray] Add xray-ignore-loops option
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
To make sure I'm understanding this correctly, previously, for any function with a loop in it, XRay would ignore the minimum instruction count threshold and instrument it unconditionally. You're adding an option to make XRay respect the threshold even if the function has loops. Is that correct?
I'm wondering what the reason is for the existing logic ignoring loops, and if we can incorporate loops into the existing logic instead of adding another option (and whether that would be better). I'm sure @dberris can speak more to that, so leaving this to him.
LGTM
I'm wondering how you're imbuing these attributes to the functions from the front-ends -- is this something you intend to support as a flag in Clang for example?
Because we assume that loops that haven't been optimised out might have variable runtime, we ensure that any code that has loops might have interesting performance characteristics and always instrument those. That might have been a conservative assumption, and it might be a bit hard to manually mark functions that must never be instrumented instead, so I understand the need for something like this attribute to be more targeted.