[SimplifyLibcalls] Replace locked IO with unlocked IO
authorDavid Bolvansky <david.bolvansky@gmail.com>
Wed, 16 May 2018 11:39:52 +0000 (11:39 +0000)
committerDavid Bolvansky <david.bolvansky@gmail.com>
Wed, 16 May 2018 11:39:52 +0000 (11:39 +0000)
commitca22d427b94de946d4ef32b8acbdfb7e62e7cfa4
tree01b8ba6b94791c2bcc898bcf34d39516a53dea10
parent5647e89f5a6369836b08212c14b8ff42db8e82d2
[SimplifyLibcalls] Replace locked IO with unlocked IO

Summary: If file stream arg is not captured and source is fopen, we could replace IO calls by unlocked IO ("_unlocked" function variants) to gain better speed,

Reviewers: efriedma, RKSimon, spatel, sanjoy, hfinkel, majnemer, lebedev.ri, rja

Reviewed By: rja

Subscribers: rja, srhines, efriedma, lebedev.ri, llvm-commits

Differential Revision: https://reviews.llvm.org/D45736

llvm-svn: 332452
llvm/include/llvm/Analysis/TargetLibraryInfo.def
llvm/include/llvm/Transforms/Utils/BuildLibCalls.h
llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h
llvm/lib/Analysis/TargetLibraryInfo.cpp
llvm/lib/Transforms/Utils/BuildLibCalls.cpp
llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
llvm/test/Transforms/InferFunctionAttrs/annotate.ll
llvm/test/Transforms/InstCombine/unlocked-stdio.ll [new file with mode: 0644]
llvm/unittests/Analysis/TargetLibraryInfoTest.cpp