<div dir="ltr">More specifically, I want to use two undefined instructions X86::UD2B and X86::TRAP (declared in lib/Target/X86/X86InstrSystem.td) for annotation. Since X86::UD2B can accept extra operands, we can put the basic block ID there.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Yizhou Wei <<a href="mailto:787012293john@gmail.com">787012293john@gmail.com</a>> 于2019年3月1日周五 上午9:33写道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi everyone,<div>What I want to do is to generate an X86 binary that is annorated with LLVM basic block information, which can be helpful for further trace-based analysis. After I go through the documents, the only way I can think of is writing a MachineFunctionPass and adding dummy instructions to the beginning and end of each basic block that indicates its ID. Since this requires a recompilation of entire LLVM, which is far from ideal, so I follow the suggestion on the documentation and come and ask here first. I am really new to LLVM, so any suggestions would be very appreciated!</div><div><br></div><div>Yizhou</div></div>
</blockquote></div>