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

Thomas Krüger via llvm-dev llvm-dev at lists.llvm.org
Mon Jun 5 07:38:42 PDT 2017


Hi Christoph,

maybe there is a way of caching the print outputs and output them at the 
end of the program execution?
So, your real application do not have this kind of bottle neck.

Best regards,
Thomas

Am 05.06.2017 16:30 schrieb Dr.-Ing. Christoph Cullmann via llvm-dev:
> Hi,
> 
> 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
> 
> http://llvm.org/docs/doxygen/html/classllvm_1_1Value.html#a04e6fc765eeb0c4c90ac5d55113db116
> 
> 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
> call.
> 
> 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?
> 
> Greetings
> Christoph


More information about the llvm-dev mailing list