[llvm-dev] Question about llvm::Value::print performance

Dr.-Ing. Christoph Cullmann via llvm-dev llvm-dev at lists.llvm.org
Mon Jun 5 07:30:35 PDT 2017


I want to use llvm::Value::print to output the assembly strings for llvm::Instructions
inside a rather large llvm::Module (linked module with lots of types/...).

I started with plain ::print and switched over to 


with a ModuleSlotTracker I pass in myself to avoid some complexity.

Still now I have the issue that the TypeFinder::run and related that is done internally
by each print still is 99% of my program runtime. (at least perf tells me that)

Is there any clever workaround for this?

I looked a bit through the sources but it seems that no API is exported that would allow a faster print

Given I want the output only more or less as "debugging" annotation to my graph, is there some other
"fast" way to print instructions, even if some info is missing then?


----------------------------- Dr.-Ing. Christoph Cullmann ---------
AbsInt Angewandte Informatik GmbH      Email: cullmann at AbsInt.com
Science Park 1                         Tel:   +49-681-38360-22
66123 Saarbrücken                      Fax:   +49-681-38360-20
GERMANY                                WWW:   http://www.AbsInt.com
Geschäftsführung: Dr.-Ing. Christian Ferdinand
Eingetragen im Handelsregister des Amtsgerichts Saarbrücken, HRB 11234

More information about the llvm-dev mailing list