[LLVMdev] Which pass converts call printf to puts?
Joerg Sonnenberger
joerg at britannica.bec.de
Sun Jun 17 09:15:45 PDT 2012
On Sun, Jun 17, 2012 at 11:58:05PM +0800, Thomson wrote:
> I found that LLVM optimized the IR by replacing printf with puts. I
> wondered which pass did this optimization? And is it common that puts is
> faster (and some other metric) than printf?
As mentioned already, it is part of the library simplification pass.
puts is faster than printf, because it doesn't have to parse the input
string, it only needs to compute the size.
Joerg
More information about the llvm-dev
mailing list