mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-12-01 03:31:32 +00:00
[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
This commit is contained in:
1 parent
5647e89f5a
commit
ca22d427b9
9 files changed
+531
-19
No files matched your search
@@ -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"
|
||||
|
||||
Reference in new issue
Block a user