[llvm-commits] [PATCH] Optimize printf -> iprintf if there are no floating point arguments

Richard Osborne richard at xmos.com
Tue Mar 1 09:05:20 PST 2011


This patch adds an optimization to SimplifyLibCalls which transforms 
calls to printf into iprintf calls. iprintf is a restricted version of 
printf provided by newlib without floating-point formatting (see 
http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-February/037832.html).

This patch uses TargetLibraryInfo to determine whether iprintf is 
available. Currently it is only marked as available on the XCore target.

I intend to add similar optimizations for sprintf / fprintf once this 
patch is accepted. Please let me know if this is OK to commit.

Thanks,

Richard

-- 
Richard Osborne | XMOS
http://www.xmos.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: iprintf.patch
Type: text/x-patch
Size: 7934 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110301/70a38ac8/attachment.bin>


More information about the llvm-commits mailing list