1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

[BuildLibCalls] Add noundef to standard I/O functions

This patch adds noundef to return value and arguments of standard I/O functions.
With this patch, passing undef or poison to the functions becomes undefined
behavior in LLVM IR. Since undef/poison is lowered from operations having UB in C/C++,
passing undef to them was already UB in source.

With this patch, the functions cannot return undef or poison anymore as well.
According to C17 standard, ungetc/ungetwc/fgetpos/ftell can generate unspecified
value; 3.19.3 says unspecified value is a valid value of the relevant type,
and using unspecified value is unspecified behavior, which is not UB, so it
cannot be undef (using undef is UB when e.g. it is used at branch condition).

— The value of the file position indicator after a successful call to the ungetc function for a text stream, or the ungetwc function for any stream, until all pushed-back characters are read or discarded (7.21.7.10, 7.29.3.10).
— The details of the value stored by the fgetpos function (7.21.9.1).
— The details of the value returned by the ftell function for a text stream (7.21.9.4).

In the long run, most of the functions listed in BuildLibCalls should have noundefs; to remove redundant diffs which will anyway disappear in the future, I added noundef to a few more non-I/O functions as well.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D85345
This commit is contained in:
Juneyoung Lee 2020-08-10 10:57:18 +09:00
parent 6da8fa8433
commit 6fcfc1d6c4
3 changed files with 142 additions and 61 deletions

View File

@ -37,6 +37,7 @@ STATISTIC(NumNoUnwind, "Number of functions inferred as nounwind");
STATISTIC(NumNoCapture, "Number of arguments inferred as nocapture"); STATISTIC(NumNoCapture, "Number of arguments inferred as nocapture");
STATISTIC(NumReadOnlyArg, "Number of arguments inferred as readonly"); STATISTIC(NumReadOnlyArg, "Number of arguments inferred as readonly");
STATISTIC(NumNoAlias, "Number of function returns inferred as noalias"); STATISTIC(NumNoAlias, "Number of function returns inferred as noalias");
STATISTIC(NumNoUndef, "Number of function returns inferred as noundef returns");
STATISTIC(NumNonNull, "Number of function returns inferred as nonnull returns"); STATISTIC(NumNonNull, "Number of function returns inferred as nonnull returns");
STATISTIC(NumReturnedArg, "Number of arguments inferred as returned"); STATISTIC(NumReturnedArg, "Number of arguments inferred as returned");
@ -104,6 +105,24 @@ static bool setOnlyReadsMemory(Function &F, unsigned ArgNo) {
return true; return true;
} }
static bool setRetAndArgsNoUndef(Function &F) {
bool Changed = false;
if (!F.getReturnType()->isVoidTy() &&
!F.hasAttribute(AttributeList::ReturnIndex, Attribute::NoUndef)) {
F.addAttribute(AttributeList::ReturnIndex, Attribute::NoUndef);
++NumNoUndef;
Changed = true;
}
for (unsigned ArgNo = 0; ArgNo < F.arg_size(); ++ArgNo) {
if (!F.hasParamAttribute(ArgNo, Attribute::NoUndef)) {
F.addParamAttr(ArgNo, Attribute::NoUndef);
++NumNoUndef;
Changed = true;
}
}
return Changed;
}
static bool setRetNonNull(Function &F) { static bool setRetNonNull(Function &F) {
assert(F.getReturnType()->isPointerTy() && assert(F.getReturnType()->isPointerTy() &&
"nonnull applies only to pointers"); "nonnull applies only to pointers");
@ -227,6 +246,7 @@ bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) {
Changed |= setOnlyReadsMemory(F, 1); Changed |= setOnlyReadsMemory(F, 1);
return Changed; return Changed;
case LibFunc_scanf: case LibFunc_scanf:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
Changed |= setOnlyReadsMemory(F, 0); Changed |= setOnlyReadsMemory(F, 0);
@ -251,6 +271,7 @@ bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) {
Changed |= setOnlyReadsMemory(F, 0); Changed |= setOnlyReadsMemory(F, 0);
return Changed; return Changed;
case LibFunc_sscanf: case LibFunc_sscanf:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
Changed |= setDoesNotCapture(F, 1); Changed |= setDoesNotCapture(F, 1);
@ -258,6 +279,7 @@ bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) {
Changed |= setOnlyReadsMemory(F, 1); Changed |= setOnlyReadsMemory(F, 1);
return Changed; return Changed;
case LibFunc_sprintf: case LibFunc_sprintf:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
Changed |= setDoesNotAlias(F, 0); Changed |= setDoesNotAlias(F, 0);
@ -265,6 +287,7 @@ bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) {
Changed |= setOnlyReadsMemory(F, 1); Changed |= setOnlyReadsMemory(F, 1);
return Changed; return Changed;
case LibFunc_snprintf: case LibFunc_snprintf:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
Changed |= setDoesNotAlias(F, 0); Changed |= setDoesNotAlias(F, 0);
@ -347,9 +370,11 @@ bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) {
return Changed; return Changed;
case LibFunc_read: case LibFunc_read:
// May throw; "read" is a valid pthread cancellation point. // May throw; "read" is a valid pthread cancellation point.
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotCapture(F, 1); Changed |= setDoesNotCapture(F, 1);
return Changed; return Changed;
case LibFunc_rewind: case LibFunc_rewind:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
return Changed; return Changed;
@ -375,6 +400,7 @@ bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) {
return Changed; return Changed;
case LibFunc_write: case LibFunc_write:
// May throw; "write" is a valid pthread cancellation point. // May throw; "write" is a valid pthread cancellation point.
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotCapture(F, 1); Changed |= setDoesNotCapture(F, 1);
Changed |= setOnlyReadsMemory(F, 1); Changed |= setOnlyReadsMemory(F, 1);
return Changed; return Changed;
@ -428,6 +454,7 @@ bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) {
Changed |= setOnlyReadsMemory(F, 0); Changed |= setOnlyReadsMemory(F, 0);
return Changed; return Changed;
case LibFunc_fopen: case LibFunc_fopen:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setRetDoesNotAlias(F); Changed |= setRetDoesNotAlias(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
@ -436,13 +463,21 @@ bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) {
Changed |= setOnlyReadsMemory(F, 1); Changed |= setOnlyReadsMemory(F, 1);
return Changed; return Changed;
case LibFunc_fdopen: case LibFunc_fdopen:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setRetDoesNotAlias(F); Changed |= setRetDoesNotAlias(F);
Changed |= setDoesNotCapture(F, 1); Changed |= setDoesNotCapture(F, 1);
Changed |= setOnlyReadsMemory(F, 1); Changed |= setOnlyReadsMemory(F, 1);
return Changed; return Changed;
case LibFunc_feof: case LibFunc_feof:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0);
return Changed;
case LibFunc_free: case LibFunc_free:
Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0);
return Changed;
case LibFunc_fseek: case LibFunc_fseek:
case LibFunc_ftell: case LibFunc_ftell:
case LibFunc_fgetc: case LibFunc_fgetc:
@ -456,10 +491,12 @@ bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) {
case LibFunc_flockfile: case LibFunc_flockfile:
case LibFunc_funlockfile: case LibFunc_funlockfile:
case LibFunc_ftrylockfile: case LibFunc_ftrylockfile:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
return Changed; return Changed;
case LibFunc_ferror: case LibFunc_ferror:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
Changed |= setOnlyReadsMemory(F); Changed |= setOnlyReadsMemory(F);
@ -467,26 +504,37 @@ bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) {
case LibFunc_fputc: case LibFunc_fputc:
case LibFunc_fputc_unlocked: case LibFunc_fputc_unlocked:
case LibFunc_fstat: case LibFunc_fstat:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 1);
return Changed;
case LibFunc_frexp: case LibFunc_frexp:
case LibFunc_frexpf: case LibFunc_frexpf:
case LibFunc_frexpl: case LibFunc_frexpl:
Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 1);
return Changed;
case LibFunc_fstatvfs: case LibFunc_fstatvfs:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 1); Changed |= setDoesNotCapture(F, 1);
return Changed; return Changed;
case LibFunc_fgets: case LibFunc_fgets:
case LibFunc_fgets_unlocked: case LibFunc_fgets_unlocked:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 2); Changed |= setDoesNotCapture(F, 2);
return Changed; return Changed;
case LibFunc_fread: case LibFunc_fread:
case LibFunc_fread_unlocked: case LibFunc_fread_unlocked:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
Changed |= setDoesNotCapture(F, 3); Changed |= setDoesNotCapture(F, 3);
return Changed; return Changed;
case LibFunc_fwrite: case LibFunc_fwrite:
case LibFunc_fwrite_unlocked: case LibFunc_fwrite_unlocked:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
Changed |= setDoesNotCapture(F, 3); Changed |= setDoesNotCapture(F, 3);
@ -494,6 +542,7 @@ bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) {
return Changed; return Changed;
case LibFunc_fputs: case LibFunc_fputs:
case LibFunc_fputs_unlocked: case LibFunc_fputs_unlocked:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
Changed |= setDoesNotCapture(F, 1); Changed |= setDoesNotCapture(F, 1);
@ -501,19 +550,29 @@ bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) {
return Changed; return Changed;
case LibFunc_fscanf: case LibFunc_fscanf:
case LibFunc_fprintf: case LibFunc_fprintf:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
Changed |= setDoesNotCapture(F, 1); Changed |= setDoesNotCapture(F, 1);
Changed |= setOnlyReadsMemory(F, 1); Changed |= setOnlyReadsMemory(F, 1);
return Changed; return Changed;
case LibFunc_fgetpos: case LibFunc_fgetpos:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
Changed |= setDoesNotCapture(F, 1); Changed |= setDoesNotCapture(F, 1);
return Changed; return Changed;
case LibFunc_getc: case LibFunc_getc:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0);
return Changed;
case LibFunc_getlogin_r: case LibFunc_getlogin_r:
Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0);
return Changed;
case LibFunc_getc_unlocked: case LibFunc_getc_unlocked:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
return Changed; return Changed;
@ -525,6 +584,7 @@ bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) {
case LibFunc_gets: case LibFunc_gets:
case LibFunc_getchar: case LibFunc_getchar:
case LibFunc_getchar_unlocked: case LibFunc_getchar_unlocked:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
return Changed; return Changed;
case LibFunc_getitimer: case LibFunc_getitimer:
@ -537,6 +597,7 @@ bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) {
Changed |= setOnlyReadsMemory(F, 0); Changed |= setOnlyReadsMemory(F, 0);
return Changed; return Changed;
case LibFunc_ungetc: case LibFunc_ungetc:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 1); Changed |= setDoesNotCapture(F, 1);
return Changed; return Changed;
@ -564,27 +625,32 @@ bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) {
return Changed; return Changed;
case LibFunc_putc: case LibFunc_putc:
case LibFunc_putc_unlocked: case LibFunc_putc_unlocked:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 1); Changed |= setDoesNotCapture(F, 1);
return Changed; return Changed;
case LibFunc_puts: case LibFunc_puts:
case LibFunc_printf: case LibFunc_printf:
case LibFunc_perror: case LibFunc_perror:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
Changed |= setOnlyReadsMemory(F, 0); Changed |= setOnlyReadsMemory(F, 0);
return Changed; return Changed;
case LibFunc_pread: case LibFunc_pread:
// May throw; "pread" is a valid pthread cancellation point. // May throw; "pread" is a valid pthread cancellation point.
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotCapture(F, 1); Changed |= setDoesNotCapture(F, 1);
return Changed; return Changed;
case LibFunc_pwrite: case LibFunc_pwrite:
// May throw; "pwrite" is a valid pthread cancellation point. // May throw; "pwrite" is a valid pthread cancellation point.
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotCapture(F, 1); Changed |= setDoesNotCapture(F, 1);
Changed |= setOnlyReadsMemory(F, 1); Changed |= setOnlyReadsMemory(F, 1);
return Changed; return Changed;
case LibFunc_putchar: case LibFunc_putchar:
case LibFunc_putchar_unlocked: case LibFunc_putchar_unlocked:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
return Changed; return Changed;
case LibFunc_popen: case LibFunc_popen:
@ -600,11 +666,13 @@ bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) {
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
return Changed; return Changed;
case LibFunc_vscanf: case LibFunc_vscanf:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
Changed |= setOnlyReadsMemory(F, 0); Changed |= setOnlyReadsMemory(F, 0);
return Changed; return Changed;
case LibFunc_vsscanf: case LibFunc_vsscanf:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
Changed |= setDoesNotCapture(F, 1); Changed |= setDoesNotCapture(F, 1);
@ -612,6 +680,7 @@ bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) {
Changed |= setOnlyReadsMemory(F, 1); Changed |= setOnlyReadsMemory(F, 1);
return Changed; return Changed;
case LibFunc_vfscanf: case LibFunc_vfscanf:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
Changed |= setDoesNotCapture(F, 1); Changed |= setDoesNotCapture(F, 1);
@ -622,18 +691,21 @@ bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) {
Changed |= setRetDoesNotAlias(F); Changed |= setRetDoesNotAlias(F);
return Changed; return Changed;
case LibFunc_vprintf: case LibFunc_vprintf:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
Changed |= setOnlyReadsMemory(F, 0); Changed |= setOnlyReadsMemory(F, 0);
return Changed; return Changed;
case LibFunc_vfprintf: case LibFunc_vfprintf:
case LibFunc_vsprintf: case LibFunc_vsprintf:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
Changed |= setDoesNotCapture(F, 1); Changed |= setDoesNotCapture(F, 1);
Changed |= setOnlyReadsMemory(F, 1); Changed |= setOnlyReadsMemory(F, 1);
return Changed; return Changed;
case LibFunc_vsnprintf: case LibFunc_vsnprintf:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
Changed |= setDoesNotCapture(F, 2); Changed |= setDoesNotCapture(F, 2);
@ -641,6 +713,7 @@ bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) {
return Changed; return Changed;
case LibFunc_open: case LibFunc_open:
// May throw; "open" is a valid pthread cancellation point. // May throw; "open" is a valid pthread cancellation point.
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
Changed |= setOnlyReadsMemory(F, 0); Changed |= setOnlyReadsMemory(F, 0);
return Changed; return Changed;
@ -693,14 +766,17 @@ bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) {
Changed |= setOnlyReadsMemory(F, 1); Changed |= setOnlyReadsMemory(F, 1);
return Changed; return Changed;
case LibFunc_under_IO_getc: case LibFunc_under_IO_getc:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
return Changed; return Changed;
case LibFunc_under_IO_putc: case LibFunc_under_IO_putc:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 1); Changed |= setDoesNotCapture(F, 1);
return Changed; return Changed;
case LibFunc_dunder_isoc99_scanf: case LibFunc_dunder_isoc99_scanf:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
Changed |= setOnlyReadsMemory(F, 0); Changed |= setOnlyReadsMemory(F, 0);
@ -714,6 +790,7 @@ bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) {
Changed |= setOnlyReadsMemory(F, 0); Changed |= setOnlyReadsMemory(F, 0);
return Changed; return Changed;
case LibFunc_dunder_isoc99_sscanf: case LibFunc_dunder_isoc99_sscanf:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
Changed |= setDoesNotCapture(F, 1); Changed |= setDoesNotCapture(F, 1);
@ -721,6 +798,7 @@ bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) {
Changed |= setOnlyReadsMemory(F, 1); Changed |= setOnlyReadsMemory(F, 1);
return Changed; return Changed;
case LibFunc_fopen64: case LibFunc_fopen64:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setRetDoesNotAlias(F); Changed |= setRetDoesNotAlias(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
@ -730,6 +808,7 @@ bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) {
return Changed; return Changed;
case LibFunc_fseeko64: case LibFunc_fseeko64:
case LibFunc_ftello64: case LibFunc_ftello64:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
return Changed; return Changed;
@ -739,11 +818,13 @@ bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) {
return Changed; return Changed;
case LibFunc_fstat64: case LibFunc_fstat64:
case LibFunc_fstatvfs64: case LibFunc_fstatvfs64:
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotThrow(F); Changed |= setDoesNotThrow(F);
Changed |= setDoesNotCapture(F, 1); Changed |= setDoesNotCapture(F, 1);
return Changed; return Changed;
case LibFunc_open64: case LibFunc_open64:
// May throw; "open" is a valid pthread cancellation point. // May throw; "open" is a valid pthread cancellation point.
Changed |= setRetAndArgsNoUndef(F);
Changed |= setDoesNotCapture(F, 0); Changed |= setDoesNotCapture(F, 0);
Changed |= setOnlyReadsMemory(F, 0); Changed |= setOnlyReadsMemory(F, 0);
return Changed; return Changed;

View File

@ -17,7 +17,7 @@ define void @printf_call() {
} }
; CHECK: Function Attrs: nofree nounwind nonlazybind ; CHECK: Function Attrs: nofree nounwind nonlazybind
; CHECK-NEXT: declare i32 @puts(i8* nocapture readonly) ; CHECK-NEXT: declare noundef i32 @puts(i8* nocapture noundef readonly)
!llvm.module.flags = !{!0} !llvm.module.flags = !{!0}
!0 = !{i32 7, !"RtLibUseGOT", i32 1} !0 = !{i32 7, !"RtLibUseGOT", i32 1}

View File

@ -352,19 +352,19 @@ declare float @fabsf(float)
; CHECK: declare x86_fp80 @fabsl(x86_fp80) [[G0]] ; CHECK: declare x86_fp80 @fabsl(x86_fp80) [[G0]]
declare x86_fp80 @fabsl(x86_fp80) declare x86_fp80 @fabsl(x86_fp80)
; CHECK: declare i32 @fclose(%opaque* nocapture) [[G1]] ; CHECK: declare noundef i32 @fclose(%opaque* nocapture noundef) [[G1]]
declare i32 @fclose(%opaque*) declare i32 @fclose(%opaque*)
; CHECK: declare noalias %opaque* @fdopen(i32, i8* nocapture readonly) [[G1]] ; CHECK: declare noalias noundef %opaque* @fdopen(i32 noundef, i8* nocapture noundef readonly) [[G1]]
declare %opaque* @fdopen(i32, i8*) declare %opaque* @fdopen(i32, i8*)
; CHECK: declare i32 @feof(%opaque* nocapture) [[G1]] ; CHECK: declare noundef i32 @feof(%opaque* nocapture noundef) [[G1]]
declare i32 @feof(%opaque*) declare i32 @feof(%opaque*)
; CHECK: declare i32 @ferror(%opaque* nocapture) [[G2]] ; CHECK: declare noundef i32 @ferror(%opaque* nocapture noundef) [[G2]]
declare i32 @ferror(%opaque*) declare i32 @ferror(%opaque*)
; CHECK: declare i32 @fflush(%opaque* nocapture) [[G1]] ; CHECK: declare noundef i32 @fflush(%opaque* nocapture noundef) [[G1]]
declare i32 @fflush(%opaque*) declare i32 @fflush(%opaque*)
; CHECK: declare i32 @ffs(i32) [[G0]] ; CHECK: declare i32 @ffs(i32) [[G0]]
@ -376,19 +376,19 @@ declare i32 @ffsl(i64)
; CHECK: declare i32 @ffsll(i64) [[G0]] ; CHECK: declare i32 @ffsll(i64) [[G0]]
declare i32 @ffsll(i64) declare i32 @ffsll(i64)
; CHECK: declare i32 @fgetc(%opaque* nocapture) [[G1]] ; CHECK: declare noundef i32 @fgetc(%opaque* nocapture noundef) [[G1]]
declare i32 @fgetc(%opaque*) declare i32 @fgetc(%opaque*)
; CHECK: declare i32 @fgetpos(%opaque* nocapture, i64* nocapture) [[G1]] ; CHECK: declare noundef i32 @fgetpos(%opaque* nocapture noundef, i64* nocapture noundef) [[G1]]
declare i32 @fgetpos(%opaque*, i64*) declare i32 @fgetpos(%opaque*, i64*)
; CHECK: declare i8* @fgets(i8*, i32, %opaque* nocapture) [[G1]] ; CHECK: declare noundef i8* @fgets(i8* noundef, i32 noundef, %opaque* nocapture noundef) [[G1]]
declare i8* @fgets(i8*, i32, %opaque*) declare i8* @fgets(i8*, i32, %opaque*)
; CHECK: declare i32 @fileno(%opaque* nocapture) [[G1]] ; CHECK: declare noundef i32 @fileno(%opaque* nocapture noundef) [[G1]]
declare i32 @fileno(%opaque*) declare i32 @fileno(%opaque*)
; CHECK: declare void @flockfile(%opaque* nocapture) [[G1]] ; CHECK: declare void @flockfile(%opaque* nocapture noundef) [[G1]]
declare void @flockfile(%opaque*) declare void @flockfile(%opaque*)
; CHECK: declare double @floor(double) [[G0]] ; CHECK: declare double @floor(double) [[G0]]
@ -436,19 +436,19 @@ declare float @fmodf(float, float)
; CHECK: declare x86_fp80 @fmodl(x86_fp80, x86_fp80) [[G0]] ; CHECK: declare x86_fp80 @fmodl(x86_fp80, x86_fp80) [[G0]]
declare x86_fp80 @fmodl(x86_fp80, x86_fp80) declare x86_fp80 @fmodl(x86_fp80, x86_fp80)
; CHECK: declare noalias %opaque* @fopen(i8* nocapture readonly, i8* nocapture readonly) [[G1]] ; CHECK: declare noalias noundef %opaque* @fopen(i8* nocapture noundef readonly, i8* nocapture noundef readonly) [[G1]]
declare %opaque* @fopen(i8*, i8*) declare %opaque* @fopen(i8*, i8*)
; CHECK: declare i32 @fprintf(%opaque* nocapture, i8* nocapture readonly, ...) [[G1]] ; CHECK: declare noundef i32 @fprintf(%opaque* nocapture noundef, i8* nocapture noundef readonly, ...) [[G1]]
declare i32 @fprintf(%opaque*, i8*, ...) declare i32 @fprintf(%opaque*, i8*, ...)
; CHECK: declare i32 @fputc(i32, %opaque* nocapture) [[G1]] ; CHECK: declare noundef i32 @fputc(i32 noundef, %opaque* nocapture noundef) [[G1]]
declare i32 @fputc(i32, %opaque*) declare i32 @fputc(i32, %opaque*)
; CHECK: declare i32 @fputs(i8* nocapture readonly, %opaque* nocapture) [[G1]] ; CHECK: declare noundef i32 @fputs(i8* nocapture noundef readonly, %opaque* nocapture noundef) [[G1]]
declare i32 @fputs(i8*, %opaque*) declare i32 @fputs(i8*, %opaque*)
; CHECK: declare i64 @fread(i8* nocapture, i64, i64, %opaque* nocapture) [[G1]] ; CHECK: declare noundef i64 @fread(i8* nocapture noundef, i64 noundef, i64 noundef, %opaque* nocapture noundef) [[G1]]
declare i64 @fread(i8*, i64, i64, %opaque*) declare i64 @fread(i8*, i64, i64, %opaque*)
; CHECK: declare void @free(i8* nocapture) [[G3:#[0-9]+]] ; CHECK: declare void @free(i8* nocapture) [[G3:#[0-9]+]]
@ -463,61 +463,61 @@ declare float @frexpf(float, i32*)
; CHECK: declare x86_fp80 @frexpl(x86_fp80, i32* nocapture) [[G1]] ; CHECK: declare x86_fp80 @frexpl(x86_fp80, i32* nocapture) [[G1]]
declare x86_fp80 @frexpl(x86_fp80, i32*) declare x86_fp80 @frexpl(x86_fp80, i32*)
; CHECK: declare i32 @fscanf(%opaque* nocapture, i8* nocapture readonly, ...) [[G1]] ; CHECK: declare noundef i32 @fscanf(%opaque* nocapture noundef, i8* nocapture noundef readonly, ...) [[G1]]
declare i32 @fscanf(%opaque*, i8*, ...) declare i32 @fscanf(%opaque*, i8*, ...)
; CHECK: declare i32 @fseek(%opaque* nocapture, i64, i32) [[G1]] ; CHECK: declare noundef i32 @fseek(%opaque* nocapture noundef, i64 noundef, i32 noundef) [[G1]]
declare i32 @fseek(%opaque*, i64, i32) declare i32 @fseek(%opaque*, i64, i32)
; CHECK: declare i32 @fseeko(%opaque* nocapture, i64, i32) [[G1]] ; CHECK: declare noundef i32 @fseeko(%opaque* nocapture noundef, i64 noundef, i32 noundef) [[G1]]
declare i32 @fseeko(%opaque*, i64, i32) declare i32 @fseeko(%opaque*, i64, i32)
; CHECK-LINUX: declare i32 @fseeko64(%opaque* nocapture, i64, i32) [[G1]] ; CHECK-LINUX: declare noundef i32 @fseeko64(%opaque* nocapture noundef, i64 noundef, i32 noundef) [[G1]]
declare i32 @fseeko64(%opaque*, i64, i32) declare i32 @fseeko64(%opaque*, i64, i32)
; CHECK: declare i32 @fsetpos(%opaque* nocapture, i64*) [[G1]] ; CHECK: declare noundef i32 @fsetpos(%opaque* nocapture noundef, i64* noundef) [[G1]]
declare i32 @fsetpos(%opaque*, i64*) declare i32 @fsetpos(%opaque*, i64*)
; CHECK: declare i32 @fstat(i32, %opaque* nocapture) [[G1]] ; CHECK: declare noundef i32 @fstat(i32 noundef, %opaque* nocapture noundef) [[G1]]
declare i32 @fstat(i32, %opaque*) declare i32 @fstat(i32, %opaque*)
; CHECK-LINUX: declare i32 @fstat64(i32, %opaque* nocapture) [[G1]] ; CHECK-LINUX: declare noundef i32 @fstat64(i32 noundef, %opaque* nocapture noundef) [[G1]]
declare i32 @fstat64(i32, %opaque*) declare i32 @fstat64(i32, %opaque*)
; CHECK: declare i32 @fstatvfs(i32, %opaque* nocapture) [[G1]] ; CHECK: declare noundef i32 @fstatvfs(i32 noundef, %opaque* nocapture noundef) [[G1]]
declare i32 @fstatvfs(i32, %opaque*) declare i32 @fstatvfs(i32, %opaque*)
; CHECK-LINUX: declare i32 @fstatvfs64(i32, %opaque* nocapture) [[G1]] ; CHECK-LINUX: declare noundef i32 @fstatvfs64(i32 noundef, %opaque* nocapture noundef) [[G1]]
declare i32 @fstatvfs64(i32, %opaque*) declare i32 @fstatvfs64(i32, %opaque*)
; CHECK: declare i64 @ftell(%opaque* nocapture) [[G1]] ; CHECK: declare noundef i64 @ftell(%opaque* nocapture noundef) [[G1]]
declare i64 @ftell(%opaque*) declare i64 @ftell(%opaque*)
; CHECK: declare i64 @ftello(%opaque* nocapture) [[G1]] ; CHECK: declare noundef i64 @ftello(%opaque* nocapture noundef) [[G1]]
declare i64 @ftello(%opaque*) declare i64 @ftello(%opaque*)
; CHECK-LINUX: declare i64 @ftello64(%opaque* nocapture) [[G1]] ; CHECK-LINUX: declare noundef i64 @ftello64(%opaque* nocapture noundef) [[G1]]
declare i64 @ftello64(%opaque*) declare i64 @ftello64(%opaque*)
; CHECK: declare i32 @ftrylockfile(%opaque* nocapture) [[G1]] ; CHECK: declare noundef i32 @ftrylockfile(%opaque* nocapture noundef) [[G1]]
declare i32 @ftrylockfile(%opaque*) declare i32 @ftrylockfile(%opaque*)
; CHECK: declare void @funlockfile(%opaque* nocapture) [[G1]] ; CHECK: declare void @funlockfile(%opaque* nocapture noundef) [[G1]]
declare void @funlockfile(%opaque*) declare void @funlockfile(%opaque*)
; CHECK: declare i64 @fwrite(i8* nocapture, i64, i64, %opaque* nocapture) [[G1]] ; CHECK: declare noundef i64 @fwrite(i8* nocapture noundef, i64 noundef, i64 noundef, %opaque* nocapture noundef) [[G1]]
declare i64 @fwrite(i8*, i64, i64, %opaque*) declare i64 @fwrite(i8*, i64, i64, %opaque*)
; CHECK: declare i32 @getc(%opaque* nocapture) [[G1]] ; CHECK: declare noundef i32 @getc(%opaque* nocapture noundef) [[G1]]
declare i32 @getc(%opaque*) declare i32 @getc(%opaque*)
; CHECK: declare i32 @getc_unlocked(%opaque* nocapture) [[G1]] ; CHECK: declare noundef i32 @getc_unlocked(%opaque* nocapture noundef) [[G1]]
declare i32 @getc_unlocked(%opaque*) declare i32 @getc_unlocked(%opaque*)
; CHECK: declare i32 @getchar() [[G1]] ; CHECK: declare noundef i32 @getchar() [[G1]]
declare i32 @getchar() declare i32 @getchar()
; CHECK: declare i32 @getchar_unlocked() [[G1]] ; CHECK: declare noundef i32 @getchar_unlocked() [[G1]]
declare i32 @getchar_unlocked() declare i32 @getchar_unlocked()
; CHECK: declare i8* @getenv(i8* nocapture) [[G2]] ; CHECK: declare i8* @getenv(i8* nocapture) [[G2]]
@ -532,7 +532,7 @@ declare i32 @getlogin_r(i8*, i64)
; CHECK: declare %opaque* @getpwnam(i8* nocapture readonly) [[G1]] ; CHECK: declare %opaque* @getpwnam(i8* nocapture readonly) [[G1]]
declare %opaque* @getpwnam(i8*) declare %opaque* @getpwnam(i8*)
; CHECK: declare i8* @gets(i8*) [[G1]] ; CHECK: declare noundef i8* @gets(i8* noundef) [[G1]]
declare i8* @gets(i8*) declare i8* @gets(i8*)
; CHECK: declare i32 @gettimeofday(%opaque* nocapture, i8* nocapture) [[G1]] ; CHECK: declare i32 @gettimeofday(%opaque* nocapture, i8* nocapture) [[G1]]
@ -664,10 +664,10 @@ declare float @nearbyintf(float)
; CHECK: declare x86_fp80 @nearbyintl(x86_fp80) [[G0]] ; CHECK: declare x86_fp80 @nearbyintl(x86_fp80) [[G0]]
declare x86_fp80 @nearbyintl(x86_fp80) declare x86_fp80 @nearbyintl(x86_fp80)
; CHECK: declare i32 @open(i8* nocapture readonly, i32, ...) [[G0]] ; CHECK: declare noundef i32 @open(i8* nocapture noundef readonly, i32 noundef, ...) [[G0]]
declare i32 @open(i8*, i32, ...) declare i32 @open(i8*, i32, ...)
; CHECK-LINUX: declare i32 @open64(i8* nocapture readonly, i32, ...) [[G0]] ; CHECK-LINUX: declare noundef i32 @open64(i8* nocapture noundef readonly, i32 noundef, ...) [[G0]]
declare i32 @open64(i8*, i32, ...) declare i32 @open64(i8*, i32, ...)
; CHECK: declare noalias %opaque* @opendir(i8* nocapture readonly) [[G1]] ; CHECK: declare noalias %opaque* @opendir(i8* nocapture readonly) [[G1]]
@ -676,7 +676,7 @@ declare %opaque* @opendir(i8*)
; CHECK: declare i32 @pclose(%opaque* nocapture) [[G1]] ; CHECK: declare i32 @pclose(%opaque* nocapture) [[G1]]
declare i32 @pclose(%opaque*) declare i32 @pclose(%opaque*)
; CHECK: declare void @perror(i8* nocapture readonly) [[G1]] ; CHECK: declare void @perror(i8* nocapture noundef readonly) [[G1]]
declare void @perror(i8*) declare void @perror(i8*)
; CHECK: declare noalias %opaque* @popen(i8* nocapture readonly, i8* nocapture readonly) [[G1]] ; CHECK: declare noalias %opaque* @popen(i8* nocapture readonly, i8* nocapture readonly) [[G1]]
@ -694,31 +694,31 @@ declare float @powf(float, float)
; CHECK: declare x86_fp80 @powl(x86_fp80, x86_fp80) [[G0]] ; CHECK: declare x86_fp80 @powl(x86_fp80, x86_fp80) [[G0]]
declare x86_fp80 @powl(x86_fp80, x86_fp80) declare x86_fp80 @powl(x86_fp80, x86_fp80)
; CHECK: declare i64 @pread(i32, i8* nocapture, i64, i64) [[G0]] ; CHECK: declare noundef i64 @pread(i32 noundef, i8* nocapture noundef, i64 noundef, i64 noundef) [[G0]]
declare i64 @pread(i32, i8*, i64, i64) declare i64 @pread(i32, i8*, i64, i64)
; CHECK: declare i32 @printf(i8* nocapture readonly, ...) [[G1]] ; CHECK: declare noundef i32 @printf(i8* nocapture noundef readonly, ...) [[G1]]
declare i32 @printf(i8*, ...) declare i32 @printf(i8*, ...)
; CHECK: declare i32 @putc(i32, %opaque* nocapture) [[G1]] ; CHECK: declare noundef i32 @putc(i32 noundef, %opaque* nocapture noundef) [[G1]]
declare i32 @putc(i32, %opaque*) declare i32 @putc(i32, %opaque*)
; CHECK: declare i32 @putchar(i32) [[G1]] ; CHECK: declare noundef i32 @putchar(i32 noundef) [[G1]]
declare i32 @putchar(i32) declare i32 @putchar(i32)
; CHECK: declare i32 @putchar_unlocked(i32) [[G1]] ; CHECK: declare noundef i32 @putchar_unlocked(i32 noundef) [[G1]]
declare i32 @putchar_unlocked(i32) declare i32 @putchar_unlocked(i32)
; CHECK: declare i32 @puts(i8* nocapture readonly) [[G1]] ; CHECK: declare noundef i32 @puts(i8* nocapture noundef readonly) [[G1]]
declare i32 @puts(i8*) declare i32 @puts(i8*)
; CHECK: declare i64 @pwrite(i32, i8* nocapture readonly, i64, i64) [[G0]] ; CHECK: declare noundef i64 @pwrite(i32 noundef, i8* nocapture noundef readonly, i64 noundef, i64 noundef) [[G0]]
declare i64 @pwrite(i32, i8*, i64, i64) declare i64 @pwrite(i32, i8*, i64, i64)
; CHECK: declare void @qsort(i8*, i64, i64, i32 (i8*, i8*)* nocapture) [[G0]] ; CHECK: declare void @qsort(i8*, i64, i64, i32 (i8*, i8*)* nocapture) [[G0]]
declare void @qsort(i8*, i64, i64, i32 (i8*, i8*)*) declare void @qsort(i8*, i64, i64, i32 (i8*, i8*)*)
; CHECK: declare i64 @read(i32, i8* nocapture, i64) [[G0]] ; CHECK: declare noundef i64 @read(i32 noundef, i8* nocapture noundef, i64 noundef) [[G0]]
declare i64 @read(i32, i8*, i64) declare i64 @read(i32, i8*, i64)
; CHECK: declare i64 @readlink(i8* nocapture readonly, i8* nocapture, i64) [[G1]] ; CHECK: declare i64 @readlink(i8* nocapture readonly, i8* nocapture, i64) [[G1]]
@ -739,7 +739,7 @@ declare i32 @remove(i8*)
; CHECK: declare i32 @rename(i8* nocapture readonly, i8* nocapture readonly) [[G1]] ; CHECK: declare i32 @rename(i8* nocapture readonly, i8* nocapture readonly) [[G1]]
declare i32 @rename(i8*, i8*) declare i32 @rename(i8*, i8*)
; CHECK: declare void @rewind(%opaque* nocapture) [[G1]] ; CHECK: declare void @rewind(%opaque* nocapture noundef) [[G1]]
declare void @rewind(%opaque*) declare void @rewind(%opaque*)
; CHECK: declare double @rint(double) [[G0]] ; CHECK: declare double @rint(double) [[G0]]
@ -763,7 +763,7 @@ declare float @roundf(float)
; CHECK: declare x86_fp80 @roundl(x86_fp80) [[G0]] ; CHECK: declare x86_fp80 @roundl(x86_fp80) [[G0]]
declare x86_fp80 @roundl(x86_fp80) declare x86_fp80 @roundl(x86_fp80)
; CHECK: declare i32 @scanf(i8* nocapture readonly, ...) [[G1]] ; CHECK: declare noundef i32 @scanf(i8* nocapture noundef readonly, ...) [[G1]]
declare i32 @scanf(i8*, ...) declare i32 @scanf(i8*, ...)
; CHECK: declare void @setbuf(%opaque* nocapture, i8*) [[G1]] ; CHECK: declare void @setbuf(%opaque* nocapture, i8*) [[G1]]
@ -793,10 +793,10 @@ declare x86_fp80 @sinhl(x86_fp80)
; CHECK: declare x86_fp80 @sinl(x86_fp80) [[G0]] ; CHECK: declare x86_fp80 @sinl(x86_fp80) [[G0]]
declare x86_fp80 @sinl(x86_fp80) declare x86_fp80 @sinl(x86_fp80)
; CHECK: declare i32 @snprintf(i8* noalias nocapture, i64, i8* nocapture readonly, ...) [[G1]] ; CHECK: declare noundef i32 @snprintf(i8* noalias nocapture noundef, i64 noundef, i8* nocapture noundef readonly, ...) [[G1]]
declare i32 @snprintf(i8*, i64, i8*, ...) declare i32 @snprintf(i8*, i64, i8*, ...)
; CHECK: declare i32 @sprintf(i8* noalias nocapture, i8* nocapture readonly, ...) [[G1]] ; CHECK: declare noundef i32 @sprintf(i8* noalias nocapture noundef, i8* nocapture noundef readonly, ...) [[G1]]
declare i32 @sprintf(i8*, i8*, ...) declare i32 @sprintf(i8*, i8*, ...)
; CHECK: declare double @sqrt(double) [[G0]] ; CHECK: declare double @sqrt(double) [[G0]]
@ -808,7 +808,7 @@ declare float @sqrtf(float)
; CHECK: declare x86_fp80 @sqrtl(x86_fp80) [[G0]] ; CHECK: declare x86_fp80 @sqrtl(x86_fp80) [[G0]]
declare x86_fp80 @sqrtl(x86_fp80) declare x86_fp80 @sqrtl(x86_fp80)
; CHECK: declare i32 @sscanf(i8* nocapture readonly, i8* nocapture readonly, ...) [[G1]] ; CHECK: declare noundef i32 @sscanf(i8* nocapture noundef readonly, i8* nocapture noundef readonly, ...) [[G1]]
declare i32 @sscanf(i8*, i8*, ...) declare i32 @sscanf(i8*, i8*, ...)
; CHECK: declare i32 @stat(i8* nocapture readonly, %opaque* nocapture) [[G1]] ; CHECK: declare i32 @stat(i8* nocapture readonly, %opaque* nocapture) [[G1]]
@ -961,7 +961,7 @@ declare x86_fp80 @truncl(x86_fp80)
; CHECK: declare i32 @uname(%opaque* nocapture) [[G1]] ; CHECK: declare i32 @uname(%opaque* nocapture) [[G1]]
declare i32 @uname(%opaque*) declare i32 @uname(%opaque*)
; CHECK: declare i32 @ungetc(i32, %opaque* nocapture) [[G1]] ; CHECK: declare noundef i32 @ungetc(i32 noundef, %opaque* nocapture noundef) [[G1]]
declare i32 @ungetc(i32, %opaque*) declare i32 @ungetc(i32, %opaque*)
; CHECK: declare i32 @unlink(i8* nocapture readonly) [[G1]] ; CHECK: declare i32 @unlink(i8* nocapture readonly) [[G1]]
@ -979,28 +979,28 @@ declare i32 @utimes(i8*, %opaque*)
; CHECK: declare noalias i8* @valloc(i64) [[G1]] ; CHECK: declare noalias i8* @valloc(i64) [[G1]]
declare i8* @valloc(i64) declare i8* @valloc(i64)
; CHECK: declare i32 @vfprintf(%opaque* nocapture, i8* nocapture readonly, %opaque*) [[G1]] ; CHECK: declare noundef i32 @vfprintf(%opaque* nocapture noundef, i8* nocapture noundef readonly, %opaque* noundef) [[G1]]
declare i32 @vfprintf(%opaque*, i8*, %opaque*) declare i32 @vfprintf(%opaque*, i8*, %opaque*)
; CHECK: declare i32 @vfscanf(%opaque* nocapture, i8* nocapture readonly, %opaque*) [[G1]] ; CHECK: declare noundef i32 @vfscanf(%opaque* nocapture noundef, i8* nocapture noundef readonly, %opaque* noundef) [[G1]]
declare i32 @vfscanf(%opaque*, i8*, %opaque*) declare i32 @vfscanf(%opaque*, i8*, %opaque*)
; CHECK: declare i32 @vprintf(i8* nocapture readonly, %opaque*) [[G1]] ; CHECK: declare noundef i32 @vprintf(i8* nocapture noundef readonly, %opaque* noundef) [[G1]]
declare i32 @vprintf(i8*, %opaque*) declare i32 @vprintf(i8*, %opaque*)
; CHECK: declare i32 @vscanf(i8* nocapture readonly, %opaque*) [[G1]] ; CHECK: declare noundef i32 @vscanf(i8* nocapture noundef readonly, %opaque* noundef) [[G1]]
declare i32 @vscanf(i8*, %opaque*) declare i32 @vscanf(i8*, %opaque*)
; CHECK: declare i32 @vsnprintf(i8* nocapture, i64, i8* nocapture readonly, %opaque*) [[G1]] ; CHECK: declare noundef i32 @vsnprintf(i8* nocapture noundef, i64 noundef, i8* nocapture noundef readonly, %opaque* noundef) [[G1]]
declare i32 @vsnprintf(i8*, i64, i8*, %opaque*) declare i32 @vsnprintf(i8*, i64, i8*, %opaque*)
; CHECK: declare i32 @vsprintf(i8* nocapture, i8* nocapture readonly, %opaque*) [[G1]] ; CHECK: declare noundef i32 @vsprintf(i8* nocapture noundef, i8* nocapture noundef readonly, %opaque* noundef) [[G1]]
declare i32 @vsprintf(i8*, i8*, %opaque*) declare i32 @vsprintf(i8*, i8*, %opaque*)
; CHECK: declare i32 @vsscanf(i8* nocapture readonly, i8* nocapture readonly, %opaque*) [[G1]] ; CHECK: declare noundef i32 @vsscanf(i8* nocapture noundef readonly, i8* nocapture noundef readonly, %opaque* noundef) [[G1]]
declare i32 @vsscanf(i8*, i8*, %opaque*) declare i32 @vsscanf(i8*, i8*, %opaque*)
; CHECK: declare i64 @write(i32, i8* nocapture readonly, i64) [[G0]] ; CHECK: declare noundef i64 @write(i32 noundef, i8* nocapture noundef readonly, i64 noundef) [[G0]]
declare i64 @write(i32, i8*, i64) declare i64 @write(i32, i8*, i64)