[llvm-dev] How to add assembly instructions in CodeGen

Dean Michael Berris via llvm-dev llvm-dev at lists.llvm.org
Wed May 9 18:47:42 PDT 2018


On Wed, May 9, 2018 at 11:55 PM Soham Sinha <soham1 at bu.edu> wrote:

> Hi Dean,

> I looked at XRay.

Cool! Can you share whether it might be helpful? Note that we have lots of
documentation on XRay available:

- http://llvm.org/docs/XRay.html -- high level description on usage, etc.
- http://llvm.org/docs/XRayExample.html -- a step-by-step example of how to
use it

We also have some tests that demonstrate how to install your own
implementation(s) to work with the XRay framework:

-
https://github.com/llvm-project/llvm-project-20170507/blob/master/compiler-rt/test/xray/TestCases/Posix/custom-event-logging.cc
-- for custom-event handling in particular
-
https://github.com/llvm-project/llvm-project-20170507/blob/master/compiler-rt/test/xray/TestCases/Posix/logging-modes.cc
-- for implementing a full "logging mode"

I have a long-standing task to write up a document to show a more detailed
end-to-end of how to plug into the XRay framework. That can be done
piecemeal given the examples from the tests. Feedback from you and the
community at large would be greatly appreciated!

> I also thought on the similar line to add assembly instructions as
auxiliary template code and jump on to there. However, that may still
dis-align the stack. I have to think about it. But your XRay code does give
me the courage to think about this seriously.

> Thank you for your help. I also figured out that we can access certain
CodeGen's feature right from the IR level, as you have explained your
tussle of dealing with IR and CodeGen together. Hopefully I can work out a
convenient way.


If you run into anything that you think I might be able to help with
(either with XRay or in the CodeGen) please don't hesitate to reach out!

Cheers

[snipped context]


More information about the llvm-dev mailing list