Optimize printf -> iprintf if there are no floating point arguments
and iprintf is available on the target. Currently iprintf is only
marked as being available on the XCore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126935 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/TargetLibraryInfo.cpp b/lib/Target/TargetLibraryInfo.cpp
index c8bed18..6bf6c0d 100644
--- a/lib/Target/TargetLibraryInfo.cpp
+++ b/lib/Target/TargetLibraryInfo.cpp
@@ -30,7 +30,10 @@
// memset_pattern16 is only available on iOS 3.0 and Mac OS/X 10.5 and later.
if (T.getOS() != Triple::Darwin || T.getDarwinMajorNumber() < 9)
TLI.setUnavailable(LibFunc::memset_pattern16);
-
+
+ // iprintf is only available on XCore.
+ if (T.getArch() != Triple::xcore)
+ TLI.setUnavailable(LibFunc::iprintf);
}