This is an archive of the discontinued LLVM Phabricator instance.

[clang][xray] Add -fxray-ignore-loops option
ClosedPublic

Authored by ianlevesque on Jan 16 2020, 1:30 PM.

Details

Summary

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, -fxray-ignore-loops, to disable
the loop detection logic.

The LLVM change to take the new function attribute into account is in D72659

Diff Detail

Event Timeline

ianlevesque created this revision.Jan 16 2020, 1:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 16 2020, 1:30 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

fix clang-format

Harbormaster completed remote builds in B44196: Diff 238600.
hiraditya added inline comments.Jan 17 2020, 10:14 AM
clang/lib/CodeGen/CodeGenFunction.cpp
821

we can remove braces here.

clang/test/CodeGen/xray-ignore-loops.cpp
6

I think we need one more test case of a function having a loop.

ianlevesque marked an inline comment as done.Jan 17 2020, 10:16 AM
ianlevesque added inline comments.
clang/test/CodeGen/xray-ignore-loops.cpp
6

I'm not opposed but the logic to actually ignore loops has a test on D72659

hiraditya accepted this revision.Jan 17 2020, 10:21 AM

The test case is in another patch so LGTM.

This revision is now accepted and ready to land.Jan 17 2020, 10:21 AM
This revision was automatically updated to reflect the committed changes.