summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp
diff options
context:
space:
mode:
authorDavid Bolvansky <david.bolvansky@gmail.com>2018-05-16 11:39:52 +0000
committerDavid Bolvansky <david.bolvansky@gmail.com>2018-05-16 11:39:52 +0000
commitca22d427b94de946d4ef32b8acbdfb7e62e7cfa4 (patch)
tree01b8ba6b94791c2bcc898bcf34d39516a53dea10 /llvm/unittests/Analysis/TargetLibraryInfoTest.cpp
parent5647e89f5a6369836b08212c14b8ff42db8e82d2 (diff)
downloadbcm5719-llvm-ca22d427b94de946d4ef32b8acbdfb7e62e7cfa4.tar.gz
bcm5719-llvm-ca22d427b94de946d4ef32b8acbdfb7e62e7cfa4.zip
[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
Diffstat (limited to 'llvm/unittests/Analysis/TargetLibraryInfoTest.cpp')
-rw-r--r--llvm/unittests/Analysis/TargetLibraryInfoTest.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp b/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp
index 0c8ba9ee77b..ec0f89a7e50 100644
--- a/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp
+++ b/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp
@@ -161,8 +161,10 @@ TEST_F(TargetLibraryInfoTest, ValidProto) {
"declare i32 @ffsl(i64)\n"
"declare i32 @ffsll(i64)\n"
"declare i32 @fgetc(%struct*)\n"
+ "declare i32 @fgetc_unlocked(%struct*)\n"
"declare i32 @fgetpos(%struct*, i64*)\n"
"declare i8* @fgets(i8*, i32, %struct*)\n"
+ "declare i8* @fgets_unlocked(i8*, i32, %struct*)\n"
"declare i32 @fileno(%struct*)\n"
"declare void @flockfile(%struct*)\n"
"declare double @floor(double)\n"
@@ -182,7 +184,9 @@ TEST_F(TargetLibraryInfoTest, ValidProto) {
"declare x86_fp80 @fmodl(x86_fp80, x86_fp80)\n"
"declare i32 @fprintf(%struct*, i8*, ...)\n"
"declare i32 @fputc(i32, %struct*)\n"
+ "declare i32 @fputc_unlocked(i32, %struct*)\n"
"declare i64 @fread(i8*, i64, i64, %struct*)\n"
+ "declare i64 @fread_unlocked(i8*, i64, i64, %struct*)\n"
"declare void @free(i8*)\n"
"declare double @frexp(double, i32*)\n"
"declare float @frexpf(float, i32*)\n"
@@ -199,6 +203,7 @@ TEST_F(TargetLibraryInfoTest, ValidProto) {
"declare i32 @getc(%struct*)\n"
"declare i32 @getc_unlocked(%struct*)\n"
"declare i32 @getchar()\n"
+ "declare i32 @getchar_unlocked()\n"
"declare i8* @getenv(i8*)\n"
"declare i32 @getitimer(i32, %struct*)\n"
"declare i32 @getlogin_r(i8*, i64)\n"
@@ -250,7 +255,9 @@ TEST_F(TargetLibraryInfoTest, ValidProto) {
"declare x86_fp80 @powl(x86_fp80, x86_fp80)\n"
"declare i32 @printf(i8*, ...)\n"
"declare i32 @putc(i32, %struct*)\n"
+ "declare i32 @putc_unlocked(i32, %struct*)\n"
"declare i32 @putchar(i32)\n"
+ "declare i32 @putchar_unlocked(i32)\n"
"declare i32 @puts(i8*)\n"
"declare void @qsort(i8*, i64, i64, i32 (i8*, i8*)*)\n"
"declare i64 @readlink(i8*, i8*, i64)\n"
@@ -347,8 +354,10 @@ TEST_F(TargetLibraryInfoTest, ValidProto) {
"declare %struct* @fdopen(i32, i8*)\n"
"declare %struct* @fopen(i8*, i8*)\n"
"declare i32 @fputs(i8*, %struct*)\n"
+ "declare i32 @fputs_unlocked(i8*, %struct*)\n"
"declare i32 @fstat(i32, %struct*)\n"
"declare i64 @fwrite(i8*, i64, i64, %struct*)\n"
+ "declare i64 @fwrite_unlocked(i8*, i64, i64, %struct*)\n"
"declare i32 @lchown(i8*, i32, i32)\n"
"declare i32 @lstat(i8*, %struct*)\n"
"declare i64 @mktime(%struct*)\n"
OpenPOWER on IntegriCloud