This is an archive of the discontinued LLVM Phabricator instance.

Cheap Function Entry Instrumentation for Dead Code Detection
Needs ReviewPublic

Authored by hiraditya on Feb 10 2020, 3:07 PM.

Diff Detail

Event Timeline

hiraditya created this revision.Feb 10 2020, 3:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 10 2020, 3:07 PM
hiraditya updated this revision to Diff 267477.May 30 2020, 1:47 PM

A high-level comment: does this pass achieve something not doable with XRay, a mature instrumentation framework in LLVM?

llvm/test/Instrumentation/InstrFuncEntry/funcentry.ll
2

%T in lit is deprecated.

llvm/test/Instrumentation/InstrFuncEntry/verify-files-created.ll
4

We generally avoid grep in tests. Just use FileCheck.

6

This is dangerous. %T refers to the parent directory. You may accidentally delete files in a sibling testing process.

43

No trailing empty line

A high-level comment: does this pass achieve something not doable with XRay, a mature instrumentation framework in LLVM?

All of this can be implemented as a runtime plugged into the XRay framework. If you just want to see which functions have been called (or executed) in this documentation I have an example of how to do precisely what this is attempting to do:

https://reviews.llvm.org/D56244

That implementation works for basic and FDR modes.

A high-level comment: does this pass achieve something not doable with XRay, a mature instrumentation framework in LLVM?

All of this can be implemented as a runtime plugged into the XRay framework. If you just want to see which functions have been called (or executed) in this documentation I have an example of how to do precisely what this is attempting to do:

https://reviews.llvm.org/D56244

That implementation works for basic and FDR modes.

Thanks for the link.
The code size overhead of this instrumentation is 12bytes per function(adrp+strb+1byte in global array) + 13bytes per module. how does this compare to xray instrumentation?

The results of fxray as compared to function entry instrumentation.

https://gist.github.com/aditya7fb/8d9ed4d86678b409e3b28d885c95e29a