[PATCH] D72659: [xray] Add xray-ignore-loops option

Dean Michael Berris via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 14 00:17:28 PST 2020


dberris accepted this revision.
dberris added a comment.
This revision is now accepted and ready to land.

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?

In D72659#1818503 <https://reviews.llvm.org/D72659#1818503>, @smeenai wrote:

> 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.


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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72659/new/

https://reviews.llvm.org/D72659





More information about the llvm-commits mailing list