[PATCH] D32274: [XRay] Detect loops in functions being lowered

Dean Michael Berris via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 20 00:38:06 PDT 2017


dberris created this revision.

This is an implementation of the loop detection logic that XRay needs to
determine whether a function might take time at runtime. Without this
heuristic, XRay will tend to not instrument short functions that have
loops that might have runtime dependent on inputs or external values.

While this implementation doesn't do any further analysis than just
figuring out whether there is a loop in the MachineFunction being
code-gen'ed, we're paving the way for being able to perform more
sophisticated analysis of the function in the future (for example to
determine whether the trip count for the loop might be constant, and
make a decision on that instead). This enables us to cover more
functions with the default heuristics, and potentially identify ones
that have variable runtime latency just by looking for the presence of
loops.


https://reviews.llvm.org/D32274

Files:
  lib/CodeGen/XRayInstrumentation.cpp
  test/CodeGen/X86/xray-loop-detection.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32274.95899.patch
Type: text/x-patch
Size: 5263 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170420/619f4e00/attachment.bin>


More information about the llvm-commits mailing list