[llvm] f5e0391 - [InferFunctionAttrs] Convert tests to opaque pointers (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 27 01:54:00 PST 2022
Author: Nikita Popov
Date: 2022-12-27T10:53:42+01:00
New Revision: f5e03912e766dcb43fa6c71f990068cee259bb31
URL: https://github.com/llvm/llvm-project/commit/f5e03912e766dcb43fa6c71f990068cee259bb31
DIFF: https://github.com/llvm/llvm-project/commit/f5e03912e766dcb43fa6c71f990068cee259bb31.diff
LOG: [InferFunctionAttrs] Convert tests to opaque pointers (NFC)
Added:
Modified:
llvm/test/Transforms/InferFunctionAttrs/annotate.ll
llvm/test/Transforms/InferFunctionAttrs/dereferenceable-inseltpoison.ll
llvm/test/Transforms/InferFunctionAttrs/dereferenceable.ll
llvm/test/Transforms/InferFunctionAttrs/nobuiltin.ll
llvm/test/Transforms/InferFunctionAttrs/norecurse_debug.ll
llvm/test/Transforms/InferFunctionAttrs/pr30455.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InferFunctionAttrs/annotate.ll b/llvm/test/Transforms/InferFunctionAttrs/annotate.ll
index ef8cfd106514e..02f600105cf86 100644
--- a/llvm/test/Transforms/InferFunctionAttrs/annotate.ll
+++ b/llvm/test/Transforms/InferFunctionAttrs/annotate.ll
@@ -4,8 +4,8 @@
; RUN: opt < %s -mtriple=nvptx -passes=inferattrs -S | FileCheck --match-full-lines --check-prefixes=CHECK-NOLINUX,CHECK-NVPTX %s
; RUN: opt < %s -mtriple=powerpc-ibm-aix-xcoff -passes=inferattrs -S | FileCheck --match-full-lines --check-prefixes=CHECK-AIX %s
-declare i32 @__nvvm_reflect(i8*)
-; CHECK-NVPTX: declare noundef i32 @__nvvm_reflect(i8* noundef) [[NOFREE_NOUNWIND_READNONE:#[0-9]+]]
+declare i32 @__nvvm_reflect(ptr)
+; CHECK-NVPTX: declare noundef i32 @__nvvm_reflect(ptr noundef) [[NOFREE_NOUNWIND_READNONE:#[0-9]+]]
; Check all the libc functions (thereby also exercising the prototype check).
@@ -198,8 +198,8 @@ declare float @__sinpif(float)
; CHECK: declare i32 @abs(i32) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY:#[0-9]+]]
declare i32 @abs(i32)
-; CHECK: declare noundef i32 @access(i8* nocapture noundef readonly, i32 noundef) [[NOFREE_NOUNWIND:#[0-9]+]]
-declare i32 @access(i8*, i32)
+; CHECK: declare noundef i32 @access(ptr nocapture noundef readonly, i32 noundef) [[NOFREE_NOUNWIND:#[0-9]+]]
+declare i32 @access(ptr, i32)
; CHECK: declare double @acos(double) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare double @acos(double)
@@ -219,8 +219,8 @@ declare x86_fp80 @acoshl(x86_fp80)
; CHECK: declare x86_fp80 @acosl(x86_fp80) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare x86_fp80 @acosl(x86_fp80)
-; CHECK: declare noalias noundef i8* @aligned_alloc(i64 allocalign noundef, i64 noundef) [[INACCESSIBLEMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCKIND_ALLOCUNINIT_ALLOCSIZE1_FAMILY_MALLOC:#[0-9]+]]
-declare i8* @aligned_alloc(i64, i64)
+; CHECK: declare noalias noundef ptr @aligned_alloc(i64 allocalign noundef, i64 noundef) [[INACCESSIBLEMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCKIND_ALLOCUNINIT_ALLOCSIZE1_FAMILY_MALLOC:#[0-9]+]]
+declare ptr @aligned_alloc(i64, i64)
; CHECK: declare double @asin(double) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare double @asin(double)
@@ -267,33 +267,33 @@ declare x86_fp80 @atanhl(x86_fp80)
; CHECK: declare x86_fp80 @atanl(x86_fp80) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare x86_fp80 @atanl(x86_fp80)
-; CHECK: declare double @atof(i8* nocapture) [[NOFREE_NOUNWIND_READONLY_WILLRETURN:#[0-9]+]]
-declare double @atof(i8*)
+; CHECK: declare double @atof(ptr nocapture) [[NOFREE_NOUNWIND_READONLY_WILLRETURN:#[0-9]+]]
+declare double @atof(ptr)
-; CHECK: declare i32 @atoi(i8* nocapture) [[NOFREE_NOUNWIND_READONLY_WILLRETURN]]
-declare i32 @atoi(i8*)
+; CHECK: declare i32 @atoi(ptr nocapture) [[NOFREE_NOUNWIND_READONLY_WILLRETURN]]
+declare i32 @atoi(ptr)
-; CHECK: declare i64 @atol(i8* nocapture) [[NOFREE_NOUNWIND_READONLY_WILLRETURN]]
-declare i64 @atol(i8*)
+; CHECK: declare i64 @atol(ptr nocapture) [[NOFREE_NOUNWIND_READONLY_WILLRETURN]]
+declare i64 @atol(ptr)
-; CHECK: declare i64 @atoll(i8* nocapture) [[NOFREE_NOUNWIND_READONLY_WILLRETURN]]
-declare i64 @atoll(i8*)
+; CHECK: declare i64 @atoll(ptr nocapture) [[NOFREE_NOUNWIND_READONLY_WILLRETURN]]
+declare i64 @atoll(ptr)
-; CHECK-LINUX: declare i32 @bcmp(i8* nocapture, i8* nocapture, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY:#[0-9]+]]
-; CHECK-NOLINUX: declare i32 @bcmp(i8*, i8*, i64){{$}}
-declare i32 @bcmp(i8*, i8*, i64)
+; CHECK-LINUX: declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY:#[0-9]+]]
+; CHECK-NOLINUX: declare i32 @bcmp(ptr, ptr, i64){{$}}
+declare i32 @bcmp(ptr, ptr, i64)
-; CHECK: declare void @bcopy(i8* nocapture readonly, i8* nocapture writeonly, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]]
-declare void @bcopy(i8*, i8*, i64)
+; CHECK: declare void @bcopy(ptr nocapture readonly, ptr nocapture writeonly, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]]
+declare void @bcopy(ptr, ptr, i64)
-; CHECK: declare void @bzero(i8* nocapture writeonly, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
-declare void @bzero(i8*, i64)
+; CHECK: declare void @bzero(ptr nocapture writeonly, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
+declare void @bzero(ptr, i64)
-; CHECK: declare noalias noundef i8* @calloc(i64 noundef, i64 noundef) [[INACCESSIBLEMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCKIND_ALLOCZEROED_ALLOCSIZE01_FAMILY_MALLOC:#[0-9]+]]
-declare i8* @calloc(i64, i64)
+; CHECK: declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) [[INACCESSIBLEMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCKIND_ALLOCZEROED_ALLOCSIZE01_FAMILY_MALLOC:#[0-9]+]]
+declare ptr @calloc(i64, i64)
-; CHECK-AIX: declare noalias noundef i8* @vec_calloc(i64 noundef, i64 noundef) [[INACCESSIBLEMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCSIZE01_FAMILY_VEC_MALLOC:#[0-9]+]]
-declare i8* @vec_calloc(i64, i64)
+; CHECK-AIX: declare noalias noundef ptr @vec_calloc(i64 noundef, i64 noundef) [[INACCESSIBLEMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCSIZE01_FAMILY_VEC_MALLOC:#[0-9]+]]
+declare ptr @vec_calloc(i64, i64)
; CHECK: declare double @cbrt(double) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare double @cbrt(double)
@@ -318,17 +318,17 @@ declare x86_fp80 @ceill(x86_fp80)
; the function is still recognized.
; FIXME: this should be tightened up to verify that only the type with
; the right size for the target matches.
-; CHECK: declare noundef i32 @chmod(i8* nocapture noundef readonly, i16 noundef zeroext) [[NOFREE_NOUNWIND]]
-declare i32 @chmod(i8*, i16 zeroext)
+; CHECK: declare noundef i32 @chmod(ptr nocapture noundef readonly, i16 noundef zeroext) [[NOFREE_NOUNWIND]]
+declare i32 @chmod(ptr, i16 zeroext)
-; CHECK: declare noundef i32 @chown(i8* nocapture noundef readonly, i32 noundef, i32 noundef) [[NOFREE_NOUNWIND]]
-declare i32 @chown(i8*, i32, i32)
+; CHECK: declare noundef i32 @chown(ptr nocapture noundef readonly, i32 noundef, i32 noundef) [[NOFREE_NOUNWIND]]
+declare i32 @chown(ptr, i32, i32)
-; CHECK: declare void @clearerr(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare void @clearerr(%opaque*)
+; CHECK: declare void @clearerr(ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare void @clearerr(ptr)
-; CHECK: declare noundef i32 @closedir(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @closedir(%opaque*)
+; CHECK: declare noundef i32 @closedir(ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @closedir(ptr)
; CHECK: declare double @copysign(double, double) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare double @copysign(double, double)
@@ -357,8 +357,8 @@ declare x86_fp80 @coshl(x86_fp80)
; CHECK: declare x86_fp80 @cosl(x86_fp80) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare x86_fp80 @cosl(x86_fp80)
-; CHECK: declare noundef i8* @ctermid(i8* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i8* @ctermid(i8*)
+; CHECK: declare noundef ptr @ctermid(ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare ptr @ctermid(ptr)
; CHECK: declare double @exp(double) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare double @exp(double)
@@ -396,20 +396,20 @@ declare float @fabsf(float)
; CHECK: declare x86_fp80 @fabsl(x86_fp80) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare x86_fp80 @fabsl(x86_fp80)
-; CHECK: declare noundef i32 @fclose(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @fclose(%opaque*)
+; CHECK: declare noundef i32 @fclose(ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @fclose(ptr)
-; CHECK: declare noalias noundef %opaque* @fdopen(i32 noundef, i8* nocapture noundef readonly) [[NOFREE_NOUNWIND]]
-declare %opaque* @fdopen(i32, i8*)
+; CHECK: declare noalias noundef ptr @fdopen(i32 noundef, ptr nocapture noundef readonly) [[NOFREE_NOUNWIND]]
+declare ptr @fdopen(i32, ptr)
-; CHECK: declare noundef i32 @feof(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @feof(%opaque*)
+; CHECK: declare noundef i32 @feof(ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @feof(ptr)
-; CHECK: declare noundef i32 @ferror(%opaque* nocapture noundef) [[NOFREE_NOUNWIND_READONLY:#[0-9]+]]
-declare i32 @ferror(%opaque*)
+; CHECK: declare noundef i32 @ferror(ptr nocapture noundef) [[NOFREE_NOUNWIND_READONLY:#[0-9]+]]
+declare i32 @ferror(ptr)
-; CHECK: declare noundef i32 @fflush(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @fflush(%opaque*)
+; CHECK: declare noundef i32 @fflush(ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @fflush(ptr)
; CHECK: declare i32 @ffs(i32) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare i32 @ffs(i32)
@@ -422,20 +422,20 @@ declare i32 @ffsl(i64)
; CHECK-UNKNOWN: declare i32 @ffsll(i64){{$}}
declare i32 @ffsll(i64)
-; CHECK: declare noundef i32 @fgetc(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @fgetc(%opaque*)
+; CHECK: declare noundef i32 @fgetc(ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @fgetc(ptr)
-; CHECK: declare noundef i32 @fgetpos(%opaque* nocapture noundef, i64* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @fgetpos(%opaque*, i64*)
+; CHECK: declare noundef i32 @fgetpos(ptr nocapture noundef, ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @fgetpos(ptr, ptr)
-; CHECK: declare noundef i8* @fgets(i8* noundef, i32 noundef, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i8* @fgets(i8*, i32, %opaque*)
+; CHECK: declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare ptr @fgets(ptr, i32, ptr)
-; CHECK: declare noundef i32 @fileno(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @fileno(%opaque*)
+; CHECK: declare noundef i32 @fileno(ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @fileno(ptr)
-; CHECK: declare void @flockfile(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare void @flockfile(%opaque*)
+; CHECK: declare void @flockfile(ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare void @flockfile(ptr)
; CHECK: declare double @floor(double) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare double @floor(double)
@@ -482,87 +482,87 @@ declare float @fmodf(float, float)
; CHECK: declare x86_fp80 @fmodl(x86_fp80, x86_fp80) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare x86_fp80 @fmodl(x86_fp80, x86_fp80)
-; CHECK: declare noalias noundef %opaque* @fopen(i8* nocapture noundef readonly, i8* nocapture noundef readonly) [[NOFREE_NOUNWIND]]
-declare %opaque* @fopen(i8*, i8*)
+; CHECK: declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) [[NOFREE_NOUNWIND]]
+declare ptr @fopen(ptr, ptr)
-; CHECK: declare noundef i32 @fprintf(%opaque* nocapture noundef, i8* nocapture noundef readonly, ...) [[NOFREE_NOUNWIND]]
-declare i32 @fprintf(%opaque*, i8*, ...)
+; CHECK: declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) [[NOFREE_NOUNWIND]]
+declare i32 @fprintf(ptr, ptr, ...)
-; CHECK: declare noundef i32 @fputc(i32 noundef, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @fputc(i32, %opaque*)
+; CHECK: declare noundef i32 @fputc(i32 noundef, ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @fputc(i32, ptr)
-; CHECK: declare noundef i32 @fputs(i8* nocapture noundef readonly, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @fputs(i8*, %opaque*)
+; CHECK: declare noundef i32 @fputs(ptr nocapture noundef readonly, ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @fputs(ptr, ptr)
-; CHECK: declare noundef i64 @fread(i8* nocapture noundef, i64 noundef, i64 noundef, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i64 @fread(i8*, i64, i64, %opaque*)
+; CHECK: declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i64 @fread(ptr, i64, i64, ptr)
-; CHECK: declare void @free(i8* allocptr nocapture noundef) [[INACCESSIBLEMEMORARGMEMONLY_NOUNWIND_WILLRETURN_ALLOCKIND_FREE_FAMILY_MALLOC:#[0-9]+]]
-declare void @free(i8*)
+; CHECK: declare void @free(ptr allocptr nocapture noundef) [[INACCESSIBLEMEMORARGMEMONLY_NOUNWIND_WILLRETURN_ALLOCKIND_FREE_FAMILY_MALLOC:#[0-9]+]]
+declare void @free(ptr)
-; CHECK-AIX: declare void @vec_free(i8* allocptr nocapture noundef) [[INACCESSIBLEMEMORARGMEMONLY_NOUNWIND_WILLRETURN_FAMILY_VEC_MALLOC:#[0-9]+]]
-declare void @vec_free(i8*)
+; CHECK-AIX: declare void @vec_free(ptr allocptr nocapture noundef) [[INACCESSIBLEMEMORARGMEMONLY_NOUNWIND_WILLRETURN_FAMILY_VEC_MALLOC:#[0-9]+]]
+declare void @vec_free(ptr)
-; CHECK: declare double @frexp(double, i32* nocapture) [[NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]]
-declare double @frexp(double, i32*)
+; CHECK: declare double @frexp(double, ptr nocapture) [[NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]]
+declare double @frexp(double, ptr)
-; CHECK: declare float @frexpf(float, i32* nocapture) [[NOFREE_NOUNWIND_WILLRETURN]]
-declare float @frexpf(float, i32*)
+; CHECK: declare float @frexpf(float, ptr nocapture) [[NOFREE_NOUNWIND_WILLRETURN]]
+declare float @frexpf(float, ptr)
-; CHECK: declare x86_fp80 @frexpl(x86_fp80, i32* nocapture) [[NOFREE_NOUNWIND_WILLRETURN]]
-declare x86_fp80 @frexpl(x86_fp80, i32*)
+; CHECK: declare x86_fp80 @frexpl(x86_fp80, ptr nocapture) [[NOFREE_NOUNWIND_WILLRETURN]]
+declare x86_fp80 @frexpl(x86_fp80, ptr)
-; CHECK: declare noundef i32 @fscanf(%opaque* nocapture noundef, i8* nocapture noundef readonly, ...) [[NOFREE_NOUNWIND]]
-declare i32 @fscanf(%opaque*, i8*, ...)
+; CHECK: declare noundef i32 @fscanf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) [[NOFREE_NOUNWIND]]
+declare i32 @fscanf(ptr, ptr, ...)
-; CHECK: declare noundef i32 @fseek(%opaque* nocapture noundef, i64 noundef, i32 noundef) [[NOFREE_NOUNWIND]]
-declare i32 @fseek(%opaque*, i64, i32)
+; CHECK: declare noundef i32 @fseek(ptr nocapture noundef, i64 noundef, i32 noundef) [[NOFREE_NOUNWIND]]
+declare i32 @fseek(ptr, i64, i32)
-; CHECK: declare noundef i32 @fseeko(%opaque* nocapture noundef, i64 noundef, i32 noundef) [[NOFREE_NOUNWIND]]
-declare i32 @fseeko(%opaque*, i64, i32)
+; CHECK: declare noundef i32 @fseeko(ptr nocapture noundef, i64 noundef, i32 noundef) [[NOFREE_NOUNWIND]]
+declare i32 @fseeko(ptr, i64, i32)
-; CHECK-LINUX: declare noundef i32 @fseeko64(%opaque* nocapture noundef, i64 noundef, i32 noundef) [[NOFREE_NOUNWIND]]
-declare i32 @fseeko64(%opaque*, i64, i32)
+; CHECK-LINUX: declare noundef i32 @fseeko64(ptr nocapture noundef, i64 noundef, i32 noundef) [[NOFREE_NOUNWIND]]
+declare i32 @fseeko64(ptr, i64, i32)
-; CHECK: declare noundef i32 @fsetpos(%opaque* nocapture noundef, i64* noundef) [[NOFREE_NOUNWIND]]
-declare i32 @fsetpos(%opaque*, i64*)
+; CHECK: declare noundef i32 @fsetpos(ptr nocapture noundef, ptr noundef) [[NOFREE_NOUNWIND]]
+declare i32 @fsetpos(ptr, ptr)
-; CHECK: declare noundef i32 @fstat(i32 noundef, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @fstat(i32, %opaque*)
+; CHECK: declare noundef i32 @fstat(i32 noundef, ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @fstat(i32, ptr)
-; CHECK-LINUX: declare noundef i32 @fstat64(i32 noundef, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @fstat64(i32, %opaque*)
+; CHECK-LINUX: declare noundef i32 @fstat64(i32 noundef, ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @fstat64(i32, ptr)
-; CHECK: declare noundef i32 @fstatvfs(i32 noundef, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @fstatvfs(i32, %opaque*)
+; CHECK: declare noundef i32 @fstatvfs(i32 noundef, ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @fstatvfs(i32, ptr)
-; CHECK-LINUX: declare noundef i32 @fstatvfs64(i32 noundef, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @fstatvfs64(i32, %opaque*)
+; CHECK-LINUX: declare noundef i32 @fstatvfs64(i32 noundef, ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @fstatvfs64(i32, ptr)
-; CHECK: declare noundef i64 @ftell(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i64 @ftell(%opaque*)
+; CHECK: declare noundef i64 @ftell(ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i64 @ftell(ptr)
-; CHECK: declare noundef i64 @ftello(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i64 @ftello(%opaque*)
+; CHECK: declare noundef i64 @ftello(ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i64 @ftello(ptr)
-; CHECK-LINUX: declare noundef i64 @ftello64(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i64 @ftello64(%opaque*)
+; CHECK-LINUX: declare noundef i64 @ftello64(ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i64 @ftello64(ptr)
-; CHECK: declare noundef i32 @ftrylockfile(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @ftrylockfile(%opaque*)
+; CHECK: declare noundef i32 @ftrylockfile(ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @ftrylockfile(ptr)
-; CHECK: declare void @funlockfile(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare void @funlockfile(%opaque*)
+; CHECK: declare void @funlockfile(ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare void @funlockfile(ptr)
-; CHECK: declare noundef i64 @fwrite(i8* nocapture noundef, i64 noundef, i64 noundef, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i64 @fwrite(i8*, i64, i64, %opaque*)
+; CHECK: declare noundef i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i64 @fwrite(ptr, i64, i64, ptr)
-; CHECK: declare noundef i32 @getc(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @getc(%opaque*)
+; CHECK: declare noundef i32 @getc(ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @getc(ptr)
-; CHECK-KNOWN: declare noundef i32 @getc_unlocked(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-; CHECK-UNKNOWN: declare i32 @getc_unlocked(%opaque*){{$}}
-declare i32 @getc_unlocked(%opaque*)
+; CHECK-KNOWN: declare noundef i32 @getc_unlocked(ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+; CHECK-UNKNOWN: declare i32 @getc_unlocked(ptr){{$}}
+declare i32 @getc_unlocked(ptr)
; CHECK: declare noundef i32 @getchar() [[NOFREE_NOUNWIND]]
declare i32 @getchar()
@@ -571,23 +571,23 @@ declare i32 @getchar()
; CHECK-UNKNOWN: declare i32 @getchar_unlocked(){{$}}
declare i32 @getchar_unlocked()
-; CHECK: declare noundef i8* @getenv(i8* nocapture noundef) [[NOFREE_NOUNWIND_READONLY]]
-declare i8* @getenv(i8*)
+; CHECK: declare noundef ptr @getenv(ptr nocapture noundef) [[NOFREE_NOUNWIND_READONLY]]
+declare ptr @getenv(ptr)
-; CHECK: declare noundef i32 @getitimer(i32 noundef, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @getitimer(i32, %opaque*)
+; CHECK: declare noundef i32 @getitimer(i32 noundef, ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @getitimer(i32, ptr)
-; CHECK: declare noundef i32 @getlogin_r(i8* nocapture noundef, i64 noundef) [[NOFREE_NOUNWIND]]
-declare i32 @getlogin_r(i8*, i64)
+; CHECK: declare noundef i32 @getlogin_r(ptr nocapture noundef, i64 noundef) [[NOFREE_NOUNWIND]]
+declare i32 @getlogin_r(ptr, i64)
-; CHECK: declare noundef %opaque* @getpwnam(i8* nocapture noundef readonly) [[NOFREE_NOUNWIND]]
-declare %opaque* @getpwnam(i8*)
+; CHECK: declare noundef ptr @getpwnam(ptr nocapture noundef readonly) [[NOFREE_NOUNWIND]]
+declare ptr @getpwnam(ptr)
-; CHECK: declare noundef i8* @gets(i8* noundef) [[NOFREE_NOUNWIND]]
-declare i8* @gets(i8*)
+; CHECK: declare noundef ptr @gets(ptr noundef) [[NOFREE_NOUNWIND]]
+declare ptr @gets(ptr)
-; CHECK: declare noundef i32 @gettimeofday(%opaque* nocapture noundef, i8* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @gettimeofday(%opaque*, i8*)
+; CHECK: declare noundef i32 @gettimeofday(ptr nocapture noundef, ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @gettimeofday(ptr, ptr)
; CHECK: declare i32 @isascii(i32) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare i32 @isascii(i32)
@@ -598,8 +598,8 @@ declare i32 @isdigit(i32)
; CHECK: declare i64 @labs(i64) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare i64 @labs(i64)
-; CHECK: declare noundef i32 @lchown(i8* nocapture noundef readonly, i32 noundef, i32 noundef) [[NOFREE_NOUNWIND]]
-declare i32 @lchown(i8*, i32, i32)
+; CHECK: declare noundef i32 @lchown(ptr nocapture noundef readonly, i32 noundef, i32 noundef) [[NOFREE_NOUNWIND]]
+declare i32 @lchown(ptr, i32, i32)
; CHECK: declare double @ldexp(double, i32) [[NOFREE_WILLRETURN:#[0-9]+]]
declare double @ldexp(double, i32)
@@ -658,64 +658,64 @@ declare float @logf(float)
; CHECK: declare x86_fp80 @logl(x86_fp80) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare x86_fp80 @logl(x86_fp80)
-; CHECK: declare noundef i32 @lstat(i8* nocapture noundef readonly, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @lstat(i8*, %opaque*)
+; CHECK: declare noundef i32 @lstat(ptr nocapture noundef readonly, ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @lstat(ptr, ptr)
-; CHECK-LINUX: declare noundef i32 @lstat64(i8* nocapture noundef readonly, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @lstat64(i8*, %opaque*)
+; CHECK-LINUX: declare noundef i32 @lstat64(ptr nocapture noundef readonly, ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @lstat64(ptr, ptr)
-; CHECK: declare noalias noundef i8* @malloc(i64 noundef) [[INACCESSIBLEMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCKIND_ALLOCUNINIT_ALLOCSIZE0_FAMILY_MALLOC:#[0-9]+]]
-declare i8* @malloc(i64)
+; CHECK: declare noalias noundef ptr @malloc(i64 noundef) [[INACCESSIBLEMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCKIND_ALLOCUNINIT_ALLOCSIZE0_FAMILY_MALLOC:#[0-9]+]]
+declare ptr @malloc(i64)
-; CHECK-AIX: declare noalias noundef i8* @vec_malloc(i64 noundef) [[INACCESSIBLEMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCSIZE0_FAMILY_VEC_MALLOC:#[0-9]+]]
-declare i8* @vec_malloc(i64)
+; CHECK-AIX: declare noalias noundef ptr @vec_malloc(i64 noundef) [[INACCESSIBLEMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCSIZE0_FAMILY_VEC_MALLOC:#[0-9]+]]
+declare ptr @vec_malloc(i64)
-; CHECK-LINUX: declare noalias noundef i8* @memalign(i64 allocalign, i64) [[INACCESSIBLEMEMONLY_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]]
-declare i8* @memalign(i64, i64)
+; CHECK-LINUX: declare noalias noundef ptr @memalign(i64 allocalign, i64) [[INACCESSIBLEMEMONLY_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]]
+declare ptr @memalign(i64, i64)
-; CHECK: declare i8* @memccpy(i8* noalias writeonly, i8* noalias nocapture readonly, i32, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
-declare i8* @memccpy(i8*, i8*, i32, i64)
+; CHECK: declare ptr @memccpy(ptr noalias writeonly, ptr noalias nocapture readonly, i32, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
+declare ptr @memccpy(ptr, ptr, i32, i64)
-; CHECK-LINUX: declare i8* @memchr(i8*, i32, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY]]
-; CHECK-DARWIN: declare i8* @memchr(i8*, i32, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY:#[0-9]+]]
-; CHECK-UNKNOWN: declare i8* @memchr(i8*, i32, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY:#[0-9]+]]
-declare i8* @memchr(i8*, i32, i64)
+; CHECK-LINUX: declare ptr @memchr(ptr, i32, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY]]
+; CHECK-DARWIN: declare ptr @memchr(ptr, i32, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY:#[0-9]+]]
+; CHECK-UNKNOWN: declare ptr @memchr(ptr, i32, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY:#[0-9]+]]
+declare ptr @memchr(ptr, i32, i64)
-; CHECK: declare i32 @memcmp(i8* nocapture, i8* nocapture, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY]]
-declare i32 @memcmp(i8*, i8*, i64)
+; CHECK: declare i32 @memcmp(ptr nocapture, ptr nocapture, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY]]
+declare i32 @memcmp(ptr, ptr, i64)
-; CHECK: declare i8* @memcpy(i8* noalias returned writeonly, i8* noalias nocapture readonly, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
-declare i8* @memcpy(i8*, i8*, i64)
+; CHECK: declare ptr @memcpy(ptr noalias returned writeonly, ptr noalias nocapture readonly, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
+declare ptr @memcpy(ptr, ptr, i64)
-; CHECK: declare i8* @__memcpy_chk(i8* noalias writeonly, i8* noalias nocapture readonly, i64, i64) [[ARGMEMONLY_NOFREE_NOUNWIND:#[0-9]+]]
-declare i8* @__memcpy_chk(i8*, i8*, i64, i64)
+; CHECK: declare ptr @__memcpy_chk(ptr noalias writeonly, ptr noalias nocapture readonly, i64, i64) [[ARGMEMONLY_NOFREE_NOUNWIND:#[0-9]+]]
+declare ptr @__memcpy_chk(ptr, ptr, i64, i64)
-; CHECK: declare i8* @mempcpy(i8* noalias writeonly, i8* noalias nocapture readonly, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
-declare i8* @mempcpy(i8*, i8*, i64)
+; CHECK: declare ptr @mempcpy(ptr noalias writeonly, ptr noalias nocapture readonly, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
+declare ptr @mempcpy(ptr, ptr, i64)
-; CHECK: declare i8* @memmove(i8* returned writeonly, i8* nocapture readonly, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
-declare i8* @memmove(i8*, i8*, i64)
+; CHECK: declare ptr @memmove(ptr returned writeonly, ptr nocapture readonly, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
+declare ptr @memmove(ptr, ptr, i64)
-; CHECK: declare i8* @memset(i8* writeonly, i32, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]]
-declare i8* @memset(i8*, i32, i64)
+; CHECK: declare ptr @memset(ptr writeonly, i32, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]]
+declare ptr @memset(ptr, i32, i64)
-; CHECK: declare i8* @__memset_chk(i8* writeonly, i32, i64, i64) [[ARGMEMONLY_NOFREE_NOUNWIND]]
-declare i8* @__memset_chk(i8*, i32, i64, i64)
+; CHECK: declare ptr @__memset_chk(ptr writeonly, i32, i64, i64) [[ARGMEMONLY_NOFREE_NOUNWIND]]
+declare ptr @__memset_chk(ptr, i32, i64, i64)
-; CHECK: declare noundef i32 @mkdir(i8* nocapture noundef readonly, i16 noundef zeroext) [[NOFREE_NOUNWIND]]
-declare i32 @mkdir(i8*, i16 zeroext)
+; CHECK: declare noundef i32 @mkdir(ptr nocapture noundef readonly, i16 noundef zeroext) [[NOFREE_NOUNWIND]]
+declare i32 @mkdir(ptr, i16 zeroext)
-; CHECK: declare noundef i64 @mktime(%opaque* nocapture noundef) [[NOFREE_NOUNWIND_WILLRETURN]]
-declare i64 @mktime(%opaque*)
+; CHECK: declare noundef i64 @mktime(ptr nocapture noundef) [[NOFREE_NOUNWIND_WILLRETURN]]
+declare i64 @mktime(ptr)
-; CHECK: declare double @modf(double, double* nocapture) [[NOFREE_NOUNWIND_WILLRETURN]]
-declare double @modf(double, double*)
+; CHECK: declare double @modf(double, ptr nocapture) [[NOFREE_NOUNWIND_WILLRETURN]]
+declare double @modf(double, ptr)
-; CHECK: declare float @modff(float, float* nocapture) [[NOFREE_NOUNWIND_WILLRETURN]]
-declare float @modff(float, float*)
+; CHECK: declare float @modff(float, ptr nocapture) [[NOFREE_NOUNWIND_WILLRETURN]]
+declare float @modff(float, ptr)
-; CHECK: declare x86_fp80 @modfl(x86_fp80, x86_fp80* nocapture) [[NOFREE_NOUNWIND_WILLRETURN]]
-declare x86_fp80 @modfl(x86_fp80, x86_fp80*)
+; CHECK: declare x86_fp80 @modfl(x86_fp80, ptr nocapture) [[NOFREE_NOUNWIND_WILLRETURN]]
+declare x86_fp80 @modfl(x86_fp80, ptr)
; CHECK: declare double @nearbyint(double) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare double @nearbyint(double)
@@ -726,27 +726,27 @@ declare float @nearbyintf(float)
; CHECK: declare x86_fp80 @nearbyintl(x86_fp80) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare x86_fp80 @nearbyintl(x86_fp80)
-; CHECK-LINUX: declare noundef i32 @open(i8* nocapture noundef readonly, i32 noundef, ...) [[NOFREE]]
-; CHECK-OPEN: declare noundef i32 @open(i8* nocapture noundef readonly, i32 noundef, ...) [[NOFREE:#[0-9]+]]
-declare i32 @open(i8*, i32, ...)
+; CHECK-LINUX: declare noundef i32 @open(ptr nocapture noundef readonly, i32 noundef, ...) [[NOFREE]]
+; CHECK-OPEN: declare noundef i32 @open(ptr nocapture noundef readonly, i32 noundef, ...) [[NOFREE:#[0-9]+]]
+declare i32 @open(ptr, i32, ...)
-; CHECK-LINUX: declare noundef i32 @open64(i8* nocapture noundef readonly, i32 noundef, ...) [[NOFREE]]
-declare i32 @open64(i8*, i32, ...)
+; CHECK-LINUX: declare noundef i32 @open64(ptr nocapture noundef readonly, i32 noundef, ...) [[NOFREE]]
+declare i32 @open64(ptr, i32, ...)
-; CHECK: declare noalias noundef %opaque* @opendir(i8* nocapture noundef readonly) [[NOFREE_NOUNWIND]]
-declare %opaque* @opendir(i8*)
+; CHECK: declare noalias noundef ptr @opendir(ptr nocapture noundef readonly) [[NOFREE_NOUNWIND]]
+declare ptr @opendir(ptr)
-; CHECK: declare noundef i32 @pclose(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @pclose(%opaque*)
+; CHECK: declare noundef i32 @pclose(ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @pclose(ptr)
-; CHECK: declare void @perror(i8* nocapture noundef readonly) [[NOFREE_NOUNWIND]]
-declare void @perror(i8*)
+; CHECK: declare void @perror(ptr nocapture noundef readonly) [[NOFREE_NOUNWIND]]
+declare void @perror(ptr)
-; CHECK: declare noalias noundef %opaque* @popen(i8* nocapture noundef readonly, i8* nocapture noundef readonly) [[NOFREE_NOUNWIND]]
-declare %opaque* @popen(i8*, i8*)
+; CHECK: declare noalias noundef ptr @popen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) [[NOFREE_NOUNWIND]]
+declare ptr @popen(ptr, ptr)
-; CHECK: declare i32 @posix_memalign(i8**, i64, i64) [[NOFREE]]
-declare i32 @posix_memalign(i8**, i64, i64)
+; CHECK: declare i32 @posix_memalign(ptr, i64, i64) [[NOFREE]]
+declare i32 @posix_memalign(ptr, i64, i64)
; CHECK: declare double @pow(double, double) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare double @pow(double, double)
@@ -757,14 +757,14 @@ declare float @powf(float, float)
; CHECK: declare x86_fp80 @powl(x86_fp80, x86_fp80) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare x86_fp80 @powl(x86_fp80, x86_fp80)
-; CHECK: declare noundef i64 @pread(i32 noundef, i8* nocapture noundef, i64 noundef, i64 noundef) [[NOFREE]]
-declare i64 @pread(i32, i8*, i64, i64)
+; CHECK: declare noundef i64 @pread(i32 noundef, ptr nocapture noundef, i64 noundef, i64 noundef) [[NOFREE]]
+declare i64 @pread(i32, ptr, i64, i64)
-; CHECK: declare noundef i32 @printf(i8* nocapture noundef readonly, ...) [[NOFREE_NOUNWIND]]
-declare i32 @printf(i8*, ...)
+; CHECK: declare noundef i32 @printf(ptr nocapture noundef readonly, ...) [[NOFREE_NOUNWIND]]
+declare i32 @printf(ptr, ...)
-; CHECK: declare noundef i32 @putc(i32 noundef, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @putc(i32, %opaque*)
+; CHECK: declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @putc(i32, ptr)
; CHECK: declare noundef i32 @putchar(i32 noundef) [[NOFREE_NOUNWIND]]
declare i32 @putchar(i32)
@@ -773,41 +773,41 @@ declare i32 @putchar(i32)
; CHECK-UNKNOWN: declare i32 @putchar_unlocked(i32){{$}}
declare i32 @putchar_unlocked(i32)
-; CHECK: declare noundef i32 @puts(i8* nocapture noundef readonly) [[NOFREE_NOUNWIND]]
-declare i32 @puts(i8*)
+; CHECK: declare noundef i32 @puts(ptr nocapture noundef readonly) [[NOFREE_NOUNWIND]]
+declare i32 @puts(ptr)
-; CHECK: declare noundef i64 @pwrite(i32 noundef, i8* nocapture noundef readonly, i64 noundef, i64 noundef) [[NOFREE]]
-declare i64 @pwrite(i32, i8*, i64, i64)
+; CHECK: declare noundef i64 @pwrite(i32 noundef, ptr nocapture noundef readonly, i64 noundef, i64 noundef) [[NOFREE]]
+declare i64 @pwrite(i32, ptr, i64, i64)
-; CHECK: declare void @qsort(i8* noundef, i64 noundef, i64 noundef, i32 (i8*, i8*)* nocapture noundef) [[NOFREE]]
-declare void @qsort(i8*, i64, i64, i32 (i8*, i8*)*)
+; CHECK: declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) [[NOFREE]]
+declare void @qsort(ptr, i64, i64, ptr)
-; CHECK: declare noundef i64 @read(i32 noundef, i8* nocapture noundef, i64 noundef) [[NOFREE]]
-declare i64 @read(i32, i8*, i64)
+; CHECK: declare noundef i64 @read(i32 noundef, ptr nocapture noundef, i64 noundef) [[NOFREE]]
+declare i64 @read(i32, ptr, i64)
-; CHECK: declare noundef i64 @readlink(i8* nocapture noundef readonly, i8* nocapture noundef, i64 noundef) [[NOFREE_NOUNWIND]]
-declare i64 @readlink(i8*, i8*, i64)
+; CHECK: declare noundef i64 @readlink(ptr nocapture noundef readonly, ptr nocapture noundef, i64 noundef) [[NOFREE_NOUNWIND]]
+declare i64 @readlink(ptr, ptr, i64)
-; CHECK: declare noalias noundef i8* @realloc(i8* allocptr nocapture, i64 noundef) [[INACCESSIBLEMEMORARGMEMONLY_NOUNWIND_WILLRETURN_ALLOCKIND_REALLOC_ALLOCSIZE1_FAMILY_MALLOC:#[0-9]+]]
-declare i8* @realloc(i8*, i64)
+; CHECK: declare noalias noundef ptr @realloc(ptr allocptr nocapture, i64 noundef) [[INACCESSIBLEMEMORARGMEMONLY_NOUNWIND_WILLRETURN_ALLOCKIND_REALLOC_ALLOCSIZE1_FAMILY_MALLOC:#[0-9]+]]
+declare ptr @realloc(ptr, i64)
-; CHECK: declare noalias noundef i8* @reallocf(i8* allocptr nocapture, i64 noundef) [[INACCESSIBLEMEMORARGMEMONLY_NOUNWIND_WILLRETURN_ALLOCKIND_REALLOC_ALLOCSIZE1_FAMILY_MALLOC]]
-declare i8* @reallocf(i8*, i64)
+; CHECK: declare noalias noundef ptr @reallocf(ptr allocptr nocapture, i64 noundef) [[INACCESSIBLEMEMORARGMEMONLY_NOUNWIND_WILLRETURN_ALLOCKIND_REALLOC_ALLOCSIZE1_FAMILY_MALLOC]]
+declare ptr @reallocf(ptr, i64)
-; CHECK-AIX: declare noalias noundef i8* @vec_realloc(i8* allocptr nocapture, i64 noundef) [[INACCESSIBLEMEMORARGMEMONLY_NOUNWIND_WILLRETURN_ALLOCSIZE_FAMILY_VEC_MALLOC:#[0-9]+]]
-declare i8* @vec_realloc(i8*, i64)
+; CHECK-AIX: declare noalias noundef ptr @vec_realloc(ptr allocptr nocapture, i64 noundef) [[INACCESSIBLEMEMORARGMEMONLY_NOUNWIND_WILLRETURN_ALLOCSIZE_FAMILY_VEC_MALLOC:#[0-9]+]]
+declare ptr @vec_realloc(ptr, i64)
-; CHECK: declare noundef i8* @realpath(i8* nocapture noundef readonly, i8* noundef) [[NOFREE_NOUNWIND]]
-declare i8* @realpath(i8*, i8*)
+; CHECK: declare noundef ptr @realpath(ptr nocapture noundef readonly, ptr noundef) [[NOFREE_NOUNWIND]]
+declare ptr @realpath(ptr, ptr)
-; CHECK: declare noundef i32 @remove(i8* nocapture noundef readonly) [[NOFREE_NOUNWIND]]
-declare i32 @remove(i8*)
+; CHECK: declare noundef i32 @remove(ptr nocapture noundef readonly) [[NOFREE_NOUNWIND]]
+declare i32 @remove(ptr)
-; CHECK: declare noundef i32 @rename(i8* nocapture noundef readonly, i8* nocapture noundef readonly) [[NOFREE_NOUNWIND]]
-declare i32 @rename(i8*, i8*)
+; CHECK: declare noundef i32 @rename(ptr nocapture noundef readonly, ptr nocapture noundef readonly) [[NOFREE_NOUNWIND]]
+declare i32 @rename(ptr, ptr)
-; CHECK: declare void @rewind(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare void @rewind(%opaque*)
+; CHECK: declare void @rewind(ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare void @rewind(ptr)
; CHECK: declare double @rint(double) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare double @rint(double)
@@ -818,8 +818,8 @@ declare float @rintf(float)
; CHECK: declare x86_fp80 @rintl(x86_fp80) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare x86_fp80 @rintl(x86_fp80)
-; CHECK: declare noundef i32 @rmdir(i8* nocapture noundef readonly) [[NOFREE_NOUNWIND]]
-declare i32 @rmdir(i8*)
+; CHECK: declare noundef i32 @rmdir(ptr nocapture noundef readonly) [[NOFREE_NOUNWIND]]
+declare i32 @rmdir(ptr)
; CHECK: declare double @round(double) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare double @round(double)
@@ -830,17 +830,17 @@ declare float @roundf(float)
; CHECK: declare x86_fp80 @roundl(x86_fp80) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare x86_fp80 @roundl(x86_fp80)
-; CHECK: declare noundef i32 @scanf(i8* nocapture noundef readonly, ...) [[NOFREE_NOUNWIND]]
-declare i32 @scanf(i8*, ...)
+; CHECK: declare noundef i32 @scanf(ptr nocapture noundef readonly, ...) [[NOFREE_NOUNWIND]]
+declare i32 @scanf(ptr, ...)
-; CHECK: declare void @setbuf(%opaque* nocapture noundef, i8* noundef) [[NOFREE_NOUNWIND]]
-declare void @setbuf(%opaque*, i8*)
+; CHECK: declare void @setbuf(ptr nocapture noundef, ptr noundef) [[NOFREE_NOUNWIND]]
+declare void @setbuf(ptr, ptr)
-; CHECK: declare noundef i32 @setitimer(i32 noundef, %opaque* nocapture noundef readonly, %opaque* nocapture noundef) [[NOFREE_NOUNWIND_WILLRETURN]]
-declare i32 @setitimer(i32, %opaque*, %opaque*)
+; CHECK: declare noundef i32 @setitimer(i32 noundef, ptr nocapture noundef readonly, ptr nocapture noundef) [[NOFREE_NOUNWIND_WILLRETURN]]
+declare i32 @setitimer(i32, ptr, ptr)
-; CHECK: declare noundef i32 @setvbuf(%opaque* nocapture noundef, i8* noundef, i32 noundef, i64 noundef) [[NOFREE_NOUNWIND]]
-declare i32 @setvbuf(%opaque*, i8*, i32, i64)
+; CHECK: declare noundef i32 @setvbuf(ptr nocapture noundef, ptr noundef, i32 noundef, i64 noundef) [[NOFREE_NOUNWIND]]
+declare i32 @setvbuf(ptr, ptr, i32, i64)
; CHECK: declare double @sin(double) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare double @sin(double)
@@ -860,11 +860,11 @@ declare x86_fp80 @sinhl(x86_fp80)
; CHECK: declare x86_fp80 @sinl(x86_fp80) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare x86_fp80 @sinl(x86_fp80)
-; CHECK: declare noundef i32 @snprintf(i8* noalias nocapture noundef writeonly, i64 noundef, i8* nocapture noundef readonly, ...) [[NOFREE_NOUNWIND]]
-declare i32 @snprintf(i8*, i64, i8*, ...)
+; CHECK: declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) [[NOFREE_NOUNWIND]]
+declare i32 @snprintf(ptr, i64, ptr, ...)
-; CHECK: declare noundef i32 @sprintf(i8* noalias nocapture noundef writeonly, i8* nocapture noundef readonly, ...) [[NOFREE_NOUNWIND]]
-declare i32 @sprintf(i8*, i8*, ...)
+; CHECK: declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) [[NOFREE_NOUNWIND]]
+declare i32 @sprintf(ptr, ptr, ...)
; CHECK: declare double @sqrt(double) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare double @sqrt(double)
@@ -875,116 +875,116 @@ declare float @sqrtf(float)
; CHECK: declare x86_fp80 @sqrtl(x86_fp80) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare x86_fp80 @sqrtl(x86_fp80)
-; CHECK: declare noundef i32 @sscanf(i8* nocapture noundef readonly, i8* nocapture noundef readonly, ...) [[NOFREE_NOUNWIND]]
-declare i32 @sscanf(i8*, i8*, ...)
+; CHECK: declare noundef i32 @sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) [[NOFREE_NOUNWIND]]
+declare i32 @sscanf(ptr, ptr, ...)
-; CHECK: declare noundef i32 @stat(i8* nocapture noundef readonly, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @stat(i8*, %opaque*)
+; CHECK: declare noundef i32 @stat(ptr nocapture noundef readonly, ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @stat(ptr, ptr)
-; CHECK-LINUX: declare noundef i32 @stat64(i8* nocapture noundef readonly, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @stat64(i8*, %opaque*)
+; CHECK-LINUX: declare noundef i32 @stat64(ptr nocapture noundef readonly, ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @stat64(ptr, ptr)
-; CHECK: declare noundef i32 @statvfs(i8* nocapture noundef readonly, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @statvfs(i8*, %opaque*)
+; CHECK: declare noundef i32 @statvfs(ptr nocapture noundef readonly, ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @statvfs(ptr, ptr)
-; CHECK-LINUX: declare noundef i32 @statvfs64(i8* nocapture noundef readonly, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @statvfs64(i8*, %opaque*)
+; CHECK-LINUX: declare noundef i32 @statvfs64(ptr nocapture noundef readonly, ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @statvfs64(ptr, ptr)
-; CHECK: declare i8* @stpcpy(i8* noalias writeonly, i8* noalias nocapture readonly) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
-declare i8* @stpcpy(i8*, i8*)
+; CHECK: declare ptr @stpcpy(ptr noalias writeonly, ptr noalias nocapture readonly) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
+declare ptr @stpcpy(ptr, ptr)
-; CHECK: declare i8* @stpncpy(i8* noalias writeonly, i8* noalias nocapture readonly, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
-declare i8* @stpncpy(i8*, i8*, i64)
+; CHECK: declare ptr @stpncpy(ptr noalias writeonly, ptr noalias nocapture readonly, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
+declare ptr @stpncpy(ptr, ptr, i64)
-; CHECK: declare i32 @strcasecmp(i8* nocapture, i8* nocapture) [[NOFREE_NOUNWIND_READONLY_WILLRETURN:#[0-9]+]]
-declare i32 @strcasecmp(i8*, i8*)
+; CHECK: declare i32 @strcasecmp(ptr nocapture, ptr nocapture) [[NOFREE_NOUNWIND_READONLY_WILLRETURN:#[0-9]+]]
+declare i32 @strcasecmp(ptr, ptr)
-; CHECK: declare i8* @strcat(i8* noalias returned, i8* noalias nocapture readonly) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
-declare i8* @strcat(i8*, i8*)
+; CHECK: declare ptr @strcat(ptr noalias returned, ptr noalias nocapture readonly) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
+declare ptr @strcat(ptr, ptr)
-; CHECK: declare i8* @strchr(i8*, i32) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY]]
-declare i8* @strchr(i8*, i32)
+; CHECK: declare ptr @strchr(ptr, i32) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY]]
+declare ptr @strchr(ptr, i32)
-; CHECK: declare i32 @strcmp(i8* nocapture, i8* nocapture) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY]]
-declare i32 @strcmp(i8*, i8*)
+; CHECK: declare i32 @strcmp(ptr nocapture, ptr nocapture) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY]]
+declare i32 @strcmp(ptr, ptr)
-; CHECK: declare i32 @strcoll(i8* nocapture, i8* nocapture) [[NOFREE_NOUNWIND_READONLY_WILLRETURN]]
-declare i32 @strcoll(i8*, i8*)
+; CHECK: declare i32 @strcoll(ptr nocapture, ptr nocapture) [[NOFREE_NOUNWIND_READONLY_WILLRETURN]]
+declare i32 @strcoll(ptr, ptr)
-; CHECK: declare i8* @strcpy(i8* noalias returned writeonly, i8* noalias nocapture readonly) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
-declare i8* @strcpy(i8*, i8*)
+; CHECK: declare ptr @strcpy(ptr noalias returned writeonly, ptr noalias nocapture readonly) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
+declare ptr @strcpy(ptr, ptr)
-; CHECK: declare i64 @strcspn(i8* nocapture, i8* nocapture) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY]]
-declare i64 @strcspn(i8*, i8*)
+; CHECK: declare i64 @strcspn(ptr nocapture, ptr nocapture) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY]]
+declare i64 @strcspn(ptr, ptr)
-; CHECK: declare noalias i8* @strdup(i8* nocapture readonly) [[INACCESSIBLEMEMORARGONLY_NOFREE_NOUNWIND_WILLRETURN_FAMILY_MALLOC:#[0-9]+]]
-declare i8* @strdup(i8*)
+; CHECK: declare noalias ptr @strdup(ptr nocapture readonly) [[INACCESSIBLEMEMORARGONLY_NOFREE_NOUNWIND_WILLRETURN_FAMILY_MALLOC:#[0-9]+]]
+declare ptr @strdup(ptr)
-; CHECK: declare i64 @strlen(i8* nocapture) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY]]
-declare i64 @strlen(i8*)
+; CHECK: declare i64 @strlen(ptr nocapture) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY]]
+declare i64 @strlen(ptr)
-; CHECK: declare i32 @strncasecmp(i8* nocapture, i8* nocapture, i64) [[NOFREE_NOUNWIND_READONLY_WILLRETURN]]
-declare i32 @strncasecmp(i8*, i8*, i64)
+; CHECK: declare i32 @strncasecmp(ptr nocapture, ptr nocapture, i64) [[NOFREE_NOUNWIND_READONLY_WILLRETURN]]
+declare i32 @strncasecmp(ptr, ptr, i64)
-; CHECK: declare i8* @strncat(i8* noalias returned, i8* noalias nocapture readonly, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
-declare i8* @strncat(i8*, i8*, i64)
+; CHECK: declare ptr @strncat(ptr noalias returned, ptr noalias nocapture readonly, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
+declare ptr @strncat(ptr, ptr, i64)
-; CHECK: declare i32 @strncmp(i8* nocapture, i8* nocapture, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY]]
-declare i32 @strncmp(i8*, i8*, i64)
+; CHECK: declare i32 @strncmp(ptr nocapture, ptr nocapture, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY]]
+declare i32 @strncmp(ptr, ptr, i64)
-; CHECK: declare i8* @strncpy(i8* noalias returned writeonly, i8* noalias nocapture readonly, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
-declare i8* @strncpy(i8*, i8*, i64)
+; CHECK: declare ptr @strncpy(ptr noalias returned writeonly, ptr noalias nocapture readonly, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
+declare ptr @strncpy(ptr, ptr, i64)
-; CHECK: declare noalias i8* @strndup(i8* nocapture readonly, i64 noundef) [[INACCESSIBLEMEMORARGONLY_NOFREE_NOUNWIND_WILLRETURN_FAMILY_MALLOC]]
-declare i8* @strndup(i8*, i64)
+; CHECK: declare noalias ptr @strndup(ptr nocapture readonly, i64 noundef) [[INACCESSIBLEMEMORARGONLY_NOFREE_NOUNWIND_WILLRETURN_FAMILY_MALLOC]]
+declare ptr @strndup(ptr, i64)
-; CHECK: declare i64 @strnlen(i8* nocapture, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY_WILLRETURN:#[0-9]+]]
-declare i64 @strnlen(i8*, i64)
+; CHECK: declare i64 @strnlen(ptr nocapture, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY_WILLRETURN:#[0-9]+]]
+declare i64 @strnlen(ptr, i64)
-; CHECK: declare i8* @strpbrk(i8*, i8* nocapture) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY_WILLRETURN]]
-declare i8* @strpbrk(i8*, i8*)
+; CHECK: declare ptr @strpbrk(ptr, ptr nocapture) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY_WILLRETURN]]
+declare ptr @strpbrk(ptr, ptr)
-; CHECK: declare i8* @strrchr(i8*, i32) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY]]
-declare i8* @strrchr(i8*, i32)
+; CHECK: declare ptr @strrchr(ptr, i32) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY]]
+declare ptr @strrchr(ptr, i32)
-; CHECK: declare i64 @strspn(i8* nocapture, i8* nocapture) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY]]
-declare i64 @strspn(i8*, i8*)
+; CHECK: declare i64 @strspn(ptr nocapture, ptr nocapture) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY]]
+declare i64 @strspn(ptr, ptr)
-; CHECK: declare i8* @strstr(i8*, i8* nocapture) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY_WILLRETURN]]
-declare i8* @strstr(i8*, i8*)
+; CHECK: declare ptr @strstr(ptr, ptr nocapture) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY_WILLRETURN]]
+declare ptr @strstr(ptr, ptr)
-; CHECK: declare double @strtod(i8* readonly, i8** nocapture) [[NOFREE_NOUNWIND_WILLRETURN]]
-declare double @strtod(i8*, i8**)
+; CHECK: declare double @strtod(ptr readonly, ptr nocapture) [[NOFREE_NOUNWIND_WILLRETURN]]
+declare double @strtod(ptr, ptr)
-; CHECK: declare float @strtof(i8* readonly, i8** nocapture) [[NOFREE_NOUNWIND_WILLRETURN]]
-declare float @strtof(i8*, i8**)
+; CHECK: declare float @strtof(ptr readonly, ptr nocapture) [[NOFREE_NOUNWIND_WILLRETURN]]
+declare float @strtof(ptr, ptr)
-; CHECK: declare i8* @strtok(i8*, i8* nocapture readonly) [[NOFREE_NOUNWIND_WILLRETURN]]
-declare i8* @strtok(i8*, i8*)
+; CHECK: declare ptr @strtok(ptr, ptr nocapture readonly) [[NOFREE_NOUNWIND_WILLRETURN]]
+declare ptr @strtok(ptr, ptr)
-; CHECK: declare i8* @strtok_r(i8*, i8* nocapture readonly, i8**) [[NOFREE_NOUNWIND_WILLRETURN]]
-declare i8* @strtok_r(i8*, i8*, i8**)
+; CHECK: declare ptr @strtok_r(ptr, ptr nocapture readonly, ptr) [[NOFREE_NOUNWIND_WILLRETURN]]
+declare ptr @strtok_r(ptr, ptr, ptr)
-; CHECK: declare i64 @strtol(i8* readonly, i8** nocapture, i32) [[NOFREE_NOUNWIND_WILLRETURN]]
-declare i64 @strtol(i8*, i8**, i32)
+; CHECK: declare i64 @strtol(ptr readonly, ptr nocapture, i32) [[NOFREE_NOUNWIND_WILLRETURN]]
+declare i64 @strtol(ptr, ptr, i32)
-; CHECK: declare x86_fp80 @strtold(i8* readonly, i8** nocapture) [[NOFREE_NOUNWIND_WILLRETURN]]
-declare x86_fp80 @strtold(i8*, i8**)
+; CHECK: declare x86_fp80 @strtold(ptr readonly, ptr nocapture) [[NOFREE_NOUNWIND_WILLRETURN]]
+declare x86_fp80 @strtold(ptr, ptr)
-; CHECK: declare i64 @strtoll(i8* readonly, i8** nocapture, i32) [[NOFREE_NOUNWIND_WILLRETURN]]
-declare i64 @strtoll(i8*, i8**, i32)
+; CHECK: declare i64 @strtoll(ptr readonly, ptr nocapture, i32) [[NOFREE_NOUNWIND_WILLRETURN]]
+declare i64 @strtoll(ptr, ptr, i32)
-; CHECK: declare i64 @strtoul(i8* readonly, i8** nocapture, i32) [[NOFREE_NOUNWIND_WILLRETURN]]
-declare i64 @strtoul(i8*, i8**, i32)
+; CHECK: declare i64 @strtoul(ptr readonly, ptr nocapture, i32) [[NOFREE_NOUNWIND_WILLRETURN]]
+declare i64 @strtoul(ptr, ptr, i32)
-; CHECK: declare i64 @strtoull(i8* readonly, i8** nocapture, i32) [[NOFREE_NOUNWIND_WILLRETURN]]
-declare i64 @strtoull(i8*, i8**, i32)
+; CHECK: declare i64 @strtoull(ptr readonly, ptr nocapture, i32) [[NOFREE_NOUNWIND_WILLRETURN]]
+declare i64 @strtoull(ptr, ptr, i32)
-; CHECK: declare i64 @strxfrm(i8* nocapture, i8* nocapture readonly, i64) [[NOFREE_NOUNWIND_WILLRETURN]]
-declare i64 @strxfrm(i8*, i8*, i64)
+; CHECK: declare i64 @strxfrm(ptr nocapture, ptr nocapture readonly, i64) [[NOFREE_NOUNWIND_WILLRETURN]]
+declare i64 @strxfrm(ptr, ptr, i64)
-; CHECK: declare noundef i32 @system(i8* nocapture noundef readonly) [[NOFREE]]
-declare i32 @system(i8*)
+; CHECK: declare noundef i32 @system(ptr nocapture noundef readonly) [[NOFREE]]
+declare i32 @system(ptr)
; CHECK: declare double @tan(double) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare double @tan(double)
@@ -1004,14 +1004,14 @@ declare x86_fp80 @tanhl(x86_fp80)
; CHECK: declare x86_fp80 @tanl(x86_fp80) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare x86_fp80 @tanl(x86_fp80)
-; CHECK: declare noundef i64 @times(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i64 @times(%opaque*)
+; CHECK: declare noundef i64 @times(ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i64 @times(ptr)
-; CHECK: declare noalias noundef %opaque* @tmpfile() [[NOFREE_NOUNWIND]]
-declare %opaque* @tmpfile()
+; CHECK: declare noalias noundef ptr @tmpfile() [[NOFREE_NOUNWIND]]
+declare ptr @tmpfile()
-; CHECK-LINUX: declare noalias noundef %opaque* @tmpfile64() [[NOFREE_NOUNWIND]]
-declare %opaque* @tmpfile64()
+; CHECK-LINUX: declare noalias noundef ptr @tmpfile64() [[NOFREE_NOUNWIND]]
+declare ptr @tmpfile64()
; CHECK: declare i32 @toascii(i32) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare i32 @toascii(i32)
@@ -1025,59 +1025,59 @@ declare float @truncf(float)
; CHECK: declare x86_fp80 @truncl(x86_fp80) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare x86_fp80 @truncl(x86_fp80)
-; CHECK: declare noundef i32 @uname(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @uname(%opaque*)
+; CHECK: declare noundef i32 @uname(ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @uname(ptr)
-; CHECK: declare noundef i32 @ungetc(i32 noundef, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-declare i32 @ungetc(i32, %opaque*)
+; CHECK: declare noundef i32 @ungetc(i32 noundef, ptr nocapture noundef) [[NOFREE_NOUNWIND]]
+declare i32 @ungetc(i32, ptr)
-; CHECK: declare noundef i32 @unlink(i8* nocapture noundef readonly) [[NOFREE_NOUNWIND]]
-declare i32 @unlink(i8*)
+; CHECK: declare noundef i32 @unlink(ptr nocapture noundef readonly) [[NOFREE_NOUNWIND]]
+declare i32 @unlink(ptr)
-; CHECK: declare noundef i32 @unsetenv(i8* nocapture noundef readonly) [[NOFREE_NOUNWIND]]
-declare i32 @unsetenv(i8*)
+; CHECK: declare noundef i32 @unsetenv(ptr nocapture noundef readonly) [[NOFREE_NOUNWIND]]
+declare i32 @unsetenv(ptr)
-; CHECK: declare noundef i32 @utime(i8* nocapture noundef readonly, %opaque* nocapture noundef readonly) [[NOFREE_NOUNWIND]]
-declare i32 @utime(i8*, %opaque*)
+; CHECK: declare noundef i32 @utime(ptr nocapture noundef readonly, ptr nocapture noundef readonly) [[NOFREE_NOUNWIND]]
+declare i32 @utime(ptr, ptr)
-; CHECK: declare noundef i32 @utimes(i8* nocapture noundef readonly, %opaque* nocapture noundef readonly) [[NOFREE_NOUNWIND]]
-declare i32 @utimes(i8*, %opaque*)
+; CHECK: declare noundef i32 @utimes(ptr nocapture noundef readonly, ptr nocapture noundef readonly) [[NOFREE_NOUNWIND]]
+declare i32 @utimes(ptr, ptr)
-; CHECK: declare noalias noundef i8* @valloc(i64 noundef) [[INACCESSIBLEMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCKIND_ALLOCUNINIT_ALLOCSIZE0_FAMILY_MALLOC]]
-declare i8* @valloc(i64)
+; CHECK: declare noalias noundef ptr @valloc(i64 noundef) [[INACCESSIBLEMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCKIND_ALLOCUNINIT_ALLOCSIZE0_FAMILY_MALLOC]]
+declare ptr @valloc(i64)
-; CHECK: declare noundef i32 @vfprintf(%opaque* nocapture noundef, i8* nocapture noundef readonly, %opaque* noundef) [[NOFREE_NOUNWIND]]
-declare i32 @vfprintf(%opaque*, i8*, %opaque*)
+; CHECK: declare noundef i32 @vfprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ptr noundef) [[NOFREE_NOUNWIND]]
+declare i32 @vfprintf(ptr, ptr, ptr)
-; CHECK: declare noundef i32 @vfscanf(%opaque* nocapture noundef, i8* nocapture noundef readonly, %opaque* noundef) [[NOFREE_NOUNWIND]]
-declare i32 @vfscanf(%opaque*, i8*, %opaque*)
+; CHECK: declare noundef i32 @vfscanf(ptr nocapture noundef, ptr nocapture noundef readonly, ptr noundef) [[NOFREE_NOUNWIND]]
+declare i32 @vfscanf(ptr, ptr, ptr)
-; CHECK: declare noundef i32 @vprintf(i8* nocapture noundef readonly, %opaque* noundef) [[NOFREE_NOUNWIND]]
-declare i32 @vprintf(i8*, %opaque*)
+; CHECK: declare noundef i32 @vprintf(ptr nocapture noundef readonly, ptr noundef) [[NOFREE_NOUNWIND]]
+declare i32 @vprintf(ptr, ptr)
-; CHECK: declare noundef i32 @vscanf(i8* nocapture noundef readonly, %opaque* noundef) [[NOFREE_NOUNWIND]]
-declare i32 @vscanf(i8*, %opaque*)
+; CHECK: declare noundef i32 @vscanf(ptr nocapture noundef readonly, ptr noundef) [[NOFREE_NOUNWIND]]
+declare i32 @vscanf(ptr, ptr)
-; CHECK: declare noundef i32 @vsnprintf(i8* nocapture noundef, i64 noundef, i8* nocapture noundef readonly, %opaque* noundef) [[NOFREE_NOUNWIND]]
-declare i32 @vsnprintf(i8*, i64, i8*, %opaque*)
+; CHECK: declare noundef i32 @vsnprintf(ptr nocapture noundef, i64 noundef, ptr nocapture noundef readonly, ptr noundef) [[NOFREE_NOUNWIND]]
+declare i32 @vsnprintf(ptr, i64, ptr, ptr)
-; CHECK: declare noundef i32 @vsprintf(i8* nocapture noundef, i8* nocapture noundef readonly, %opaque* noundef) [[NOFREE_NOUNWIND]]
-declare i32 @vsprintf(i8*, i8*, %opaque*)
+; CHECK: declare noundef i32 @vsprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ptr noundef) [[NOFREE_NOUNWIND]]
+declare i32 @vsprintf(ptr, ptr, ptr)
-; CHECK: declare noundef i32 @vsscanf(i8* nocapture noundef readonly, i8* nocapture noundef readonly, %opaque* noundef) [[NOFREE_NOUNWIND]]
-declare i32 @vsscanf(i8*, i8*, %opaque*)
+; CHECK: declare noundef i32 @vsscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ptr noundef) [[NOFREE_NOUNWIND]]
+declare i32 @vsscanf(ptr, ptr, ptr)
-; CHECK: declare noundef i64 @write(i32 noundef, i8* nocapture noundef readonly, i64 noundef) [[NOFREE]]
-declare i64 @write(i32, i8*, i64)
+; CHECK: declare noundef i64 @write(i32 noundef, ptr nocapture noundef readonly, i64 noundef) [[NOFREE]]
+declare i64 @write(i32, ptr, i64)
; memset_pattern{4,8,16} aren't available everywhere.
-; CHECK-DARWIN: declare void @memset_pattern4(i8* nocapture writeonly, i8* nocapture readonly, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
-declare void @memset_pattern4(i8*, i8*, i64)
-; CHECK-DARWIN: declare void @memset_pattern8(i8* nocapture writeonly, i8* nocapture readonly, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
-declare void @memset_pattern8(i8*, i8*, i64)
-; CHECK-DARWIN: declare void @memset_pattern16(i8* nocapture writeonly, i8* nocapture readonly, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
-declare void @memset_pattern16(i8*, i8*, i64)
+; CHECK-DARWIN: declare void @memset_pattern4(ptr nocapture writeonly, ptr nocapture readonly, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
+declare void @memset_pattern4(ptr, ptr, i64)
+; CHECK-DARWIN: declare void @memset_pattern8(ptr nocapture writeonly, ptr nocapture readonly, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
+declare void @memset_pattern8(ptr, ptr, i64)
+; CHECK-DARWIN: declare void @memset_pattern16(ptr nocapture writeonly, ptr nocapture readonly, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
+declare void @memset_pattern16(ptr, ptr, i64)
; CHECK-DAG: attributes [[NOFREE_NOUNWIND_WILLRETURN]] = { mustprogress nofree nounwind willreturn }
; CHECK-DAG: attributes [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]] = { mustprogress nofree nounwind willreturn memory(write) }
diff --git a/llvm/test/Transforms/InferFunctionAttrs/dereferenceable-inseltpoison.ll b/llvm/test/Transforms/InferFunctionAttrs/dereferenceable-inseltpoison.ll
index f6213e0b78a52..ea8d5ff175444 100644
--- a/llvm/test/Transforms/InferFunctionAttrs/dereferenceable-inseltpoison.ll
+++ b/llvm/test/Transforms/InferFunctionAttrs/dereferenceable-inseltpoison.ll
@@ -5,18 +5,18 @@
; Determine dereference-ability before unused loads get deleted:
; https://bugs.llvm.org/show_bug.cgi?id=21780
-define <4 x double> @PR21780(double* %ptr) {
-; CHECK-LABEL: @PR21780(double* %ptr)
+define <4 x double> @PR21780(ptr %ptr) {
+; CHECK-LABEL: @PR21780(ptr %ptr)
; GEP of index 0 is simplified away.
- %arrayidx1 = getelementptr inbounds double, double* %ptr, i64 1
- %arrayidx2 = getelementptr inbounds double, double* %ptr, i64 2
- %arrayidx3 = getelementptr inbounds double, double* %ptr, i64 3
+ %arrayidx1 = getelementptr inbounds double, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr inbounds double, ptr %ptr, i64 2
+ %arrayidx3 = getelementptr inbounds double, ptr %ptr, i64 3
- %t0 = load double, double* %ptr, align 8
- %t1 = load double, double* %arrayidx1, align 8
- %t2 = load double, double* %arrayidx2, align 8
- %t3 = load double, double* %arrayidx3, align 8
+ %t0 = load double, ptr %ptr, align 8
+ %t1 = load double, ptr %arrayidx1, align 8
+ %t2 = load double, ptr %arrayidx2, align 8
+ %t3 = load double, ptr %arrayidx3, align 8
%vecinit0 = insertelement <4 x double> poison, double %t0, i32 0
%vecinit1 = insertelement <4 x double> %vecinit0, double %t1, i32 1
@@ -27,97 +27,92 @@ define <4 x double> @PR21780(double* %ptr) {
}
-define double @PR21780_only_access3_with_inbounds(double* %ptr) {
-; CHECK-LABEL: @PR21780_only_access3_with_inbounds(double* %ptr)
+define double @PR21780_only_access3_with_inbounds(ptr %ptr) {
+; CHECK-LABEL: @PR21780_only_access3_with_inbounds(ptr %ptr)
- %arrayidx3 = getelementptr inbounds double, double* %ptr, i64 3
- %t3 = load double, double* %arrayidx3, align 8
+ %arrayidx3 = getelementptr inbounds double, ptr %ptr, i64 3
+ %t3 = load double, ptr %arrayidx3, align 8
ret double %t3
}
-define double @PR21780_only_access3_without_inbounds(double* %ptr) {
-; CHECK-LABEL: @PR21780_only_access3_without_inbounds(double* %ptr)
- %arrayidx3 = getelementptr double, double* %ptr, i64 3
- %t3 = load double, double* %arrayidx3, align 8
+define double @PR21780_only_access3_without_inbounds(ptr %ptr) {
+; CHECK-LABEL: @PR21780_only_access3_without_inbounds(ptr %ptr)
+ %arrayidx3 = getelementptr double, ptr %ptr, i64 3
+ %t3 = load double, ptr %arrayidx3, align 8
ret double %t3
}
-define double @PR21780_without_inbounds(double* %ptr) {
-; CHECK-LABEL: @PR21780_without_inbounds(double* %ptr)
+define double @PR21780_without_inbounds(ptr %ptr) {
+; CHECK-LABEL: @PR21780_without_inbounds(ptr %ptr)
- %arrayidx1 = getelementptr double, double* %ptr, i64 1
- %arrayidx2 = getelementptr double, double* %ptr, i64 2
- %arrayidx3 = getelementptr double, double* %ptr, i64 3
+ %arrayidx1 = getelementptr double, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr double, ptr %ptr, i64 2
+ %arrayidx3 = getelementptr double, ptr %ptr, i64 3
- %t0 = load double, double* %ptr, align 8
- %t1 = load double, double* %arrayidx1, align 8
- %t2 = load double, double* %arrayidx2, align 8
- %t3 = load double, double* %arrayidx3, align 8
+ %t0 = load double, ptr %ptr, align 8
+ %t1 = load double, ptr %arrayidx1, align 8
+ %t2 = load double, ptr %arrayidx2, align 8
+ %t3 = load double, ptr %arrayidx3, align 8
ret double %t3
}
; Unsimplified, but still valid. Also, throw in some bogus arguments.
-define void @gep0(i8* %unused, i8* %other, i8* %ptr) {
-; CHECK-LABEL: @gep0(i8* %unused, i8* %other, i8* %ptr)
- %arrayidx0 = getelementptr i8, i8* %ptr, i64 0
- %arrayidx1 = getelementptr i8, i8* %ptr, i64 1
- %arrayidx2 = getelementptr i8, i8* %ptr, i64 2
- %t0 = load i8, i8* %arrayidx0
- %t1 = load i8, i8* %arrayidx1
- %t2 = load i8, i8* %arrayidx2
- store i8 %t2, i8* %other
+define void @gep0(ptr %unused, ptr %other, ptr %ptr) {
+; CHECK-LABEL: @gep0(ptr %unused, ptr %other, ptr %ptr)
+ %arrayidx1 = getelementptr i8, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr i8, ptr %ptr, i64 2
+ %t0 = load i8, ptr %ptr
+ %t1 = load i8, ptr %arrayidx1
+ %t2 = load i8, ptr %arrayidx2
+ store i8 %t2, ptr %other
ret void
}
; Order of accesses does not change computation.
; Multiple arguments may be dereferenceable.
-define void @ordering(i8* %ptr1, i32* %ptr2) {
-; CHECK-LABEL: @ordering(i8* %ptr1, i32* %ptr2)
- %a20 = getelementptr i32, i32* %ptr2, i64 0
- %a12 = getelementptr i8, i8* %ptr1, i64 2
- %t12 = load i8, i8* %a12
- %a11 = getelementptr i8, i8* %ptr1, i64 1
- %t20 = load i32, i32* %a20
- %a10 = getelementptr i8, i8* %ptr1, i64 0
- %t10 = load i8, i8* %a10
- %t11 = load i8, i8* %a11
- %a21 = getelementptr i32, i32* %ptr2, i64 1
- %t21 = load i32, i32* %a21
+define void @ordering(ptr %ptr1, ptr %ptr2) {
+; CHECK-LABEL: @ordering(ptr %ptr1, ptr %ptr2)
+ %a12 = getelementptr i8, ptr %ptr1, i64 2
+ %t12 = load i8, ptr %a12
+ %a11 = getelementptr i8, ptr %ptr1, i64 1
+ %t20 = load i32, ptr %ptr2
+ %t10 = load i8, ptr %ptr1
+ %t11 = load i8, ptr %a11
+ %a21 = getelementptr i32, ptr %ptr2, i64 1
+ %t21 = load i32, ptr %a21
ret void
}
; Not in entry block.
-define void @not_entry_but_guaranteed_to_execute(i8* %ptr) {
-; CHECK-LABEL: @not_entry_but_guaranteed_to_execute(i8* %ptr)
+define void @not_entry_but_guaranteed_to_execute(ptr %ptr) {
+; CHECK-LABEL: @not_entry_but_guaranteed_to_execute(ptr %ptr)
entry:
br label %exit
exit:
- %arrayidx0 = getelementptr i8, i8* %ptr, i64 0
- %arrayidx1 = getelementptr i8, i8* %ptr, i64 1
- %arrayidx2 = getelementptr i8, i8* %ptr, i64 2
- %t0 = load i8, i8* %arrayidx0
- %t1 = load i8, i8* %arrayidx1
- %t2 = load i8, i8* %arrayidx2
+ %arrayidx1 = getelementptr i8, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr i8, ptr %ptr, i64 2
+ %t0 = load i8, ptr %ptr
+ %t1 = load i8, ptr %arrayidx1
+ %t2 = load i8, ptr %arrayidx2
ret void
}
; Not in entry block and not guaranteed to execute.
-define void @not_entry_not_guaranteed_to_execute(i8* %ptr, i1 %cond) {
-; CHECK-LABEL: @not_entry_not_guaranteed_to_execute(i8* %ptr, i1 %cond)
+define void @not_entry_not_guaranteed_to_execute(ptr %ptr, i1 %cond) {
+; CHECK-LABEL: @not_entry_not_guaranteed_to_execute(ptr %ptr, i1 %cond)
entry:
br i1 %cond, label %loads, label %exit
loads:
- %arrayidx0 = getelementptr i8, i8* %ptr, i64 0
- %arrayidx1 = getelementptr i8, i8* %ptr, i64 1
- %arrayidx2 = getelementptr i8, i8* %ptr, i64 2
- %t0 = load i8, i8* %arrayidx0
- %t1 = load i8, i8* %arrayidx1
- %t2 = load i8, i8* %arrayidx2
+ %arrayidx1 = getelementptr i8, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr i8, ptr %ptr, i64 2
+ %t0 = load i8, ptr %ptr
+ %t1 = load i8, ptr %arrayidx1
+ %t2 = load i8, ptr %arrayidx2
ret void
exit:
ret void
@@ -125,17 +120,16 @@ exit:
; The last load may not execute, so derefenceable bytes only covers the 1st two loads.
-define void @partial_in_entry(i16* %ptr, i1 %cond) {
-; CHECK-LABEL: @partial_in_entry(i16* %ptr, i1 %cond)
+define void @partial_in_entry(ptr %ptr, i1 %cond) {
+; CHECK-LABEL: @partial_in_entry(ptr %ptr, i1 %cond)
entry:
- %arrayidx0 = getelementptr i16, i16* %ptr, i64 0
- %arrayidx1 = getelementptr i16, i16* %ptr, i64 1
- %arrayidx2 = getelementptr i16, i16* %ptr, i64 2
- %t0 = load i16, i16* %arrayidx0
- %t1 = load i16, i16* %arrayidx1
+ %arrayidx1 = getelementptr i16, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr i16, ptr %ptr, i64 2
+ %t0 = load i16, ptr %ptr
+ %t1 = load i16, ptr %arrayidx1
br i1 %cond, label %loads, label %exit
loads:
- %t2 = load i16, i16* %arrayidx2
+ %t2 = load i16, ptr %arrayidx2
ret void
exit:
ret void
@@ -144,214 +138,191 @@ exit:
; The volatile load can't be used to prove a non-volatile access is allowed.
; The 2nd and 3rd loads may never execute.
-define void @volatile_is_not_dereferenceable(i16* %ptr) {
-; CHECK-LABEL: @volatile_is_not_dereferenceable(i16* %ptr)
- %arrayidx0 = getelementptr i16, i16* %ptr, i64 0
- %arrayidx1 = getelementptr i16, i16* %ptr, i64 1
- %arrayidx2 = getelementptr i16, i16* %ptr, i64 2
- %t0 = load volatile i16, i16* %arrayidx0
- %t1 = load i16, i16* %arrayidx1
- %t2 = load i16, i16* %arrayidx2
+define void @volatile_is_not_dereferenceable(ptr %ptr) {
+; CHECK-LABEL: @volatile_is_not_dereferenceable(ptr %ptr)
+ %arrayidx1 = getelementptr i16, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr i16, ptr %ptr, i64 2
+ %t0 = load volatile i16, ptr %ptr
+ %t1 = load i16, ptr %arrayidx1
+ %t2 = load i16, ptr %arrayidx2
ret void
}
; TODO: We should allow inference for atomic (but not volatile) ops.
-define void @atomic_is_alright(i16* %ptr) {
-; CHECK-LABEL: @atomic_is_alright(i16* %ptr)
- %arrayidx0 = getelementptr i16, i16* %ptr, i64 0
- %arrayidx1 = getelementptr i16, i16* %ptr, i64 1
- %arrayidx2 = getelementptr i16, i16* %ptr, i64 2
- %t0 = load atomic i16, i16* %arrayidx0 unordered, align 2
- %t1 = load i16, i16* %arrayidx1
- %t2 = load i16, i16* %arrayidx2
+define void @atomic_is_alright(ptr %ptr) {
+; CHECK-LABEL: @atomic_is_alright(ptr %ptr)
+ %arrayidx1 = getelementptr i16, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr i16, ptr %ptr, i64 2
+ %t0 = load atomic i16, ptr %ptr unordered, align 2
+ %t1 = load i16, ptr %arrayidx1
+ %t2 = load i16, ptr %arrayidx2
ret void
}
declare void @may_not_return()
-define void @not_guaranteed_to_transfer_execution(i16* %ptr) {
-; CHECK-LABEL: @not_guaranteed_to_transfer_execution(i16* %ptr)
- %arrayidx0 = getelementptr i16, i16* %ptr, i64 0
- %arrayidx1 = getelementptr i16, i16* %ptr, i64 1
- %arrayidx2 = getelementptr i16, i16* %ptr, i64 2
- %t0 = load i16, i16* %arrayidx0
+define void @not_guaranteed_to_transfer_execution(ptr %ptr) {
+; CHECK-LABEL: @not_guaranteed_to_transfer_execution(ptr %ptr)
+ %arrayidx1 = getelementptr i16, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr i16, ptr %ptr, i64 2
+ %t0 = load i16, ptr %ptr
call void @may_not_return()
- %t1 = load i16, i16* %arrayidx1
- %t2 = load i16, i16* %arrayidx2
+ %t1 = load i16, ptr %arrayidx1
+ %t2 = load i16, ptr %arrayidx2
ret void
}
; We must have consecutive accesses.
-define void @variable_gep_index(i8* %unused, i8* %ptr, i64 %variable_index) {
-; CHECK-LABEL: @variable_gep_index(i8* %unused, i8* %ptr, i64 %variable_index)
- %arrayidx1 = getelementptr i8, i8* %ptr, i64 %variable_index
- %arrayidx2 = getelementptr i8, i8* %ptr, i64 2
- %t0 = load i8, i8* %ptr
- %t1 = load i8, i8* %arrayidx1
- %t2 = load i8, i8* %arrayidx2
+define void @variable_gep_index(ptr %unused, ptr %ptr, i64 %variable_index) {
+; CHECK-LABEL: @variable_gep_index(ptr %unused, ptr %ptr, i64 %variable_index)
+ %arrayidx1 = getelementptr i8, ptr %ptr, i64 %variable_index
+ %arrayidx2 = getelementptr i8, ptr %ptr, i64 2
+ %t0 = load i8, ptr %ptr
+ %t1 = load i8, ptr %arrayidx1
+ %t2 = load i8, ptr %arrayidx2
ret void
}
; Deal with >1 GEP index.
-define void @multi_index_gep(<4 x i8>* %ptr) {
-; CHECK-LABEL: @multi_index_gep(<4 x i8>* %ptr)
+define void @multi_index_gep(ptr %ptr) {
+; CHECK-LABEL: @multi_index_gep(ptr %ptr)
; FIXME: %ptr should be dereferenceable(4)
- %arrayidx00 = getelementptr <4 x i8>, <4 x i8>* %ptr, i64 0, i64 0
- %t0 = load i8, i8* %arrayidx00
+ %t0 = load i8, ptr %ptr
ret void
}
; Could round weird bitwidths down?
-define void @not_byte_multiple(i9* %ptr) {
-; CHECK-LABEL: @not_byte_multiple(i9* %ptr)
- %arrayidx0 = getelementptr i9, i9* %ptr, i64 0
- %t0 = load i9, i9* %arrayidx0
+define void @not_byte_multiple(ptr %ptr) {
+; CHECK-LABEL: @not_byte_multiple(ptr %ptr)
+ %t0 = load i9, ptr %ptr
ret void
}
; Missing direct access from the pointer.
-define void @no_pointer_deref(i16* %ptr) {
-; CHECK-LABEL: @no_pointer_deref(i16* %ptr)
- %arrayidx1 = getelementptr i16, i16* %ptr, i64 1
- %arrayidx2 = getelementptr i16, i16* %ptr, i64 2
- %t1 = load i16, i16* %arrayidx1
- %t2 = load i16, i16* %arrayidx2
+define void @no_pointer_deref(ptr %ptr) {
+; CHECK-LABEL: @no_pointer_deref(ptr %ptr)
+ %arrayidx1 = getelementptr i16, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr i16, ptr %ptr, i64 2
+ %t1 = load i16, ptr %arrayidx1
+ %t2 = load i16, ptr %arrayidx2
ret void
}
; Out-of-order is ok, but missing access concludes dereferenceable range.
-define void @non_consecutive(i32* %ptr) {
-; CHECK-LABEL: @non_consecutive(i32* %ptr)
- %arrayidx1 = getelementptr i32, i32* %ptr, i64 1
- %arrayidx0 = getelementptr i32, i32* %ptr, i64 0
- %arrayidx3 = getelementptr i32, i32* %ptr, i64 3
- %t1 = load i32, i32* %arrayidx1
- %t0 = load i32, i32* %arrayidx0
- %t3 = load i32, i32* %arrayidx3
+define void @non_consecutive(ptr %ptr) {
+; CHECK-LABEL: @non_consecutive(ptr %ptr)
+ %arrayidx1 = getelementptr i32, ptr %ptr, i64 1
+ %arrayidx3 = getelementptr i32, ptr %ptr, i64 3
+ %t1 = load i32, ptr %arrayidx1
+ %t0 = load i32, ptr %ptr
+ %t3 = load i32, ptr %arrayidx3
ret void
}
; Improve on existing dereferenceable attribute.
-define void @more_bytes(i32* dereferenceable(8) %ptr) {
-; CHECK-LABEL: @more_bytes(i32* dereferenceable(8) %ptr)
- %arrayidx3 = getelementptr i32, i32* %ptr, i64 3
- %arrayidx1 = getelementptr i32, i32* %ptr, i64 1
- %arrayidx0 = getelementptr i32, i32* %ptr, i64 0
- %arrayidx2 = getelementptr i32, i32* %ptr, i64 2
- %t3 = load i32, i32* %arrayidx3
- %t1 = load i32, i32* %arrayidx1
- %t2 = load i32, i32* %arrayidx2
- %t0 = load i32, i32* %arrayidx0
+define void @more_bytes(ptr dereferenceable(8) %ptr) {
+; CHECK-LABEL: @more_bytes(ptr dereferenceable(8) %ptr)
+ %arrayidx3 = getelementptr i32, ptr %ptr, i64 3
+ %arrayidx1 = getelementptr i32, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr i32, ptr %ptr, i64 2
+ %t3 = load i32, ptr %arrayidx3
+ %t1 = load i32, ptr %arrayidx1
+ %t2 = load i32, ptr %arrayidx2
+ %t0 = load i32, ptr %ptr
ret void
}
; Improve on existing dereferenceable_or_null attribute.
-define void @more_bytes_and_not_null(i32* dereferenceable_or_null(8) %ptr) {
-; CHECK-LABEL: @more_bytes_and_not_null(i32* dereferenceable_or_null(8) %ptr)
- %arrayidx3 = getelementptr i32, i32* %ptr, i64 3
- %arrayidx1 = getelementptr i32, i32* %ptr, i64 1
- %arrayidx0 = getelementptr i32, i32* %ptr, i64 0
- %arrayidx2 = getelementptr i32, i32* %ptr, i64 2
- %t3 = load i32, i32* %arrayidx3
- %t1 = load i32, i32* %arrayidx1
- %t2 = load i32, i32* %arrayidx2
- %t0 = load i32, i32* %arrayidx0
+define void @more_bytes_and_not_null(ptr dereferenceable_or_null(8) %ptr) {
+; CHECK-LABEL: @more_bytes_and_not_null(ptr dereferenceable_or_null(8) %ptr)
+ %arrayidx3 = getelementptr i32, ptr %ptr, i64 3
+ %arrayidx1 = getelementptr i32, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr i32, ptr %ptr, i64 2
+ %t3 = load i32, ptr %arrayidx3
+ %t1 = load i32, ptr %arrayidx1
+ %t2 = load i32, ptr %arrayidx2
+ %t0 = load i32, ptr %ptr
ret void
}
; But don't pessimize existing dereferenceable attribute.
-define void @better_bytes(i32* dereferenceable(100) %ptr) {
-; CHECK-LABEL: @better_bytes(i32* dereferenceable(100) %ptr)
- %arrayidx3 = getelementptr i32, i32* %ptr, i64 3
- %arrayidx1 = getelementptr i32, i32* %ptr, i64 1
- %arrayidx0 = getelementptr i32, i32* %ptr, i64 0
- %arrayidx2 = getelementptr i32, i32* %ptr, i64 2
- %t3 = load i32, i32* %arrayidx3
- %t1 = load i32, i32* %arrayidx1
- %t2 = load i32, i32* %arrayidx2
- %t0 = load i32, i32* %arrayidx0
+define void @better_bytes(ptr dereferenceable(100) %ptr) {
+; CHECK-LABEL: @better_bytes(ptr dereferenceable(100) %ptr)
+ %arrayidx3 = getelementptr i32, ptr %ptr, i64 3
+ %arrayidx1 = getelementptr i32, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr i32, ptr %ptr, i64 2
+ %t3 = load i32, ptr %arrayidx3
+ %t1 = load i32, ptr %arrayidx1
+ %t2 = load i32, ptr %arrayidx2
+ %t0 = load i32, ptr %ptr
ret void
}
-define void @bitcast(i32* %arg) {
-; CHECK-LABEL: @bitcast(i32* %arg)
- %ptr = bitcast i32* %arg to float*
- %arrayidx0 = getelementptr float, float* %ptr, i64 0
- %arrayidx1 = getelementptr float, float* %ptr, i64 1
- %t0 = load float, float* %arrayidx0
- %t1 = load float, float* %arrayidx1
+define void @bitcast(ptr %arg) {
+; CHECK-LABEL: @bitcast(ptr %arg)
+ %arrayidx1 = getelementptr float, ptr %arg, i64 1
+ %t0 = load float, ptr %arg
+ %t1 = load float, ptr %arrayidx1
ret void
}
-define void @bitcast_
diff erent_sizes(double* %arg1, i8* %arg2) {
-; CHECK-LABEL: @bitcast_
diff erent_sizes(double* %arg1, i8* %arg2)
- %ptr1 = bitcast double* %arg1 to float*
- %a10 = getelementptr float, float* %ptr1, i64 0
- %a11 = getelementptr float, float* %ptr1, i64 1
- %a12 = getelementptr float, float* %ptr1, i64 2
- %ld10 = load float, float* %a10
- %ld11 = load float, float* %a11
- %ld12 = load float, float* %a12
-
- %ptr2 = bitcast i8* %arg2 to i64*
- %a20 = getelementptr i64, i64* %ptr2, i64 0
- %a21 = getelementptr i64, i64* %ptr2, i64 1
- %ld20 = load i64, i64* %a20
- %ld21 = load i64, i64* %a21
+define void @bitcast_
diff erent_sizes(ptr %arg1, ptr %arg2) {
+; CHECK-LABEL: @bitcast_
diff erent_sizes(ptr %arg1, ptr %arg2)
+ %a11 = getelementptr float, ptr %arg1, i64 1
+ %a12 = getelementptr float, ptr %arg1, i64 2
+ %ld10 = load float, ptr %arg1
+ %ld11 = load float, ptr %a11
+ %ld12 = load float, ptr %a12
+
+ %a21 = getelementptr i64, ptr %arg2, i64 1
+ %ld20 = load i64, ptr %arg2
+ %ld21 = load i64, ptr %a21
ret void
}
-define void @negative_offset(i32* %arg) {
-; CHECK-LABEL: @negative_offset(i32* %arg)
- %ptr = bitcast i32* %arg to float*
- %arrayidx0 = getelementptr float, float* %ptr, i64 0
- %arrayidx1 = getelementptr float, float* %ptr, i64 -1
- %t0 = load float, float* %arrayidx0
- %t1 = load float, float* %arrayidx1
+define void @negative_offset(ptr %arg) {
+; CHECK-LABEL: @negative_offset(ptr %arg)
+ %arrayidx1 = getelementptr float, ptr %arg, i64 -1
+ %t0 = load float, ptr %arg
+ %t1 = load float, ptr %arrayidx1
ret void
}
-define void @stores(i32* %arg) {
-; CHECK-LABEL: @stores(i32* %arg)
- %ptr = bitcast i32* %arg to float*
- %arrayidx0 = getelementptr float, float* %ptr, i64 0
- %arrayidx1 = getelementptr float, float* %ptr, i64 1
- store float 1.0, float* %arrayidx0
- store float 2.0, float* %arrayidx1
+define void @stores(ptr %arg) {
+; CHECK-LABEL: @stores(ptr %arg)
+ %arrayidx1 = getelementptr float, ptr %arg, i64 1
+ store float 1.0, ptr %arg
+ store float 2.0, ptr %arrayidx1
ret void
}
-define void @load_store(i32* %arg) {
-; CHECK-LABEL: @load_store(i32* %arg)
- %ptr = bitcast i32* %arg to float*
- %arrayidx0 = getelementptr float, float* %ptr, i64 0
- %arrayidx1 = getelementptr float, float* %ptr, i64 1
- %t1 = load float, float* %arrayidx0
- store float 2.0, float* %arrayidx1
+define void @load_store(ptr %arg) {
+; CHECK-LABEL: @load_store(ptr %arg)
+ %arrayidx1 = getelementptr float, ptr %arg, i64 1
+ %t1 = load float, ptr %arg
+ store float 2.0, ptr %arrayidx1
ret void
}
-define void @
diff erent_size1(i32* %arg) {
-; CHECK-LABEL: @
diff erent_size1(i32* %arg)
- %arg-cast = bitcast i32* %arg to double*
- store double 0.000000e+00, double* %arg-cast
- store i32 0, i32* %arg
+define void @
diff erent_size1(ptr %arg) {
+; CHECK-LABEL: @
diff erent_size1(ptr %arg)
+ store double 0.000000e+00, ptr %arg
+ store i32 0, ptr %arg
ret void
}
-define void @
diff erent_size2(i32* %arg) {
-; CHECK-LABEL: @
diff erent_size2(i32* %arg)
- store i32 0, i32* %arg
- %arg-cast = bitcast i32* %arg to double*
- store double 0.000000e+00, double* %arg-cast
+define void @
diff erent_size2(ptr %arg) {
+; CHECK-LABEL: @
diff erent_size2(ptr %arg)
+ store i32 0, ptr %arg
+ store double 0.000000e+00, ptr %arg
ret void
}
diff --git a/llvm/test/Transforms/InferFunctionAttrs/dereferenceable.ll b/llvm/test/Transforms/InferFunctionAttrs/dereferenceable.ll
index d79572d3d277a..a42cebda1e993 100644
--- a/llvm/test/Transforms/InferFunctionAttrs/dereferenceable.ll
+++ b/llvm/test/Transforms/InferFunctionAttrs/dereferenceable.ll
@@ -5,18 +5,18 @@
; Determine dereference-ability before unused loads get deleted:
; https://bugs.llvm.org/show_bug.cgi?id=21780
-define <4 x double> @PR21780(double* %ptr) {
-; CHECK-LABEL: @PR21780(double* %ptr)
+define <4 x double> @PR21780(ptr %ptr) {
+; CHECK-LABEL: @PR21780(ptr %ptr)
; GEP of index 0 is simplified away.
- %arrayidx1 = getelementptr inbounds double, double* %ptr, i64 1
- %arrayidx2 = getelementptr inbounds double, double* %ptr, i64 2
- %arrayidx3 = getelementptr inbounds double, double* %ptr, i64 3
+ %arrayidx1 = getelementptr inbounds double, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr inbounds double, ptr %ptr, i64 2
+ %arrayidx3 = getelementptr inbounds double, ptr %ptr, i64 3
- %t0 = load double, double* %ptr, align 8
- %t1 = load double, double* %arrayidx1, align 8
- %t2 = load double, double* %arrayidx2, align 8
- %t3 = load double, double* %arrayidx3, align 8
+ %t0 = load double, ptr %ptr, align 8
+ %t1 = load double, ptr %arrayidx1, align 8
+ %t2 = load double, ptr %arrayidx2, align 8
+ %t3 = load double, ptr %arrayidx3, align 8
%vecinit0 = insertelement <4 x double> undef, double %t0, i32 0
%vecinit1 = insertelement <4 x double> %vecinit0, double %t1, i32 1
@@ -27,97 +27,92 @@ define <4 x double> @PR21780(double* %ptr) {
}
-define double @PR21780_only_access3_with_inbounds(double* %ptr) {
-; CHECK-LABEL: @PR21780_only_access3_with_inbounds(double* %ptr)
+define double @PR21780_only_access3_with_inbounds(ptr %ptr) {
+; CHECK-LABEL: @PR21780_only_access3_with_inbounds(ptr %ptr)
- %arrayidx3 = getelementptr inbounds double, double* %ptr, i64 3
- %t3 = load double, double* %arrayidx3, align 8
+ %arrayidx3 = getelementptr inbounds double, ptr %ptr, i64 3
+ %t3 = load double, ptr %arrayidx3, align 8
ret double %t3
}
-define double @PR21780_only_access3_without_inbounds(double* %ptr) {
-; CHECK-LABEL: @PR21780_only_access3_without_inbounds(double* %ptr)
- %arrayidx3 = getelementptr double, double* %ptr, i64 3
- %t3 = load double, double* %arrayidx3, align 8
+define double @PR21780_only_access3_without_inbounds(ptr %ptr) {
+; CHECK-LABEL: @PR21780_only_access3_without_inbounds(ptr %ptr)
+ %arrayidx3 = getelementptr double, ptr %ptr, i64 3
+ %t3 = load double, ptr %arrayidx3, align 8
ret double %t3
}
-define double @PR21780_without_inbounds(double* %ptr) {
-; CHECK-LABEL: @PR21780_without_inbounds(double* %ptr)
+define double @PR21780_without_inbounds(ptr %ptr) {
+; CHECK-LABEL: @PR21780_without_inbounds(ptr %ptr)
- %arrayidx1 = getelementptr double, double* %ptr, i64 1
- %arrayidx2 = getelementptr double, double* %ptr, i64 2
- %arrayidx3 = getelementptr double, double* %ptr, i64 3
+ %arrayidx1 = getelementptr double, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr double, ptr %ptr, i64 2
+ %arrayidx3 = getelementptr double, ptr %ptr, i64 3
- %t0 = load double, double* %ptr, align 8
- %t1 = load double, double* %arrayidx1, align 8
- %t2 = load double, double* %arrayidx2, align 8
- %t3 = load double, double* %arrayidx3, align 8
+ %t0 = load double, ptr %ptr, align 8
+ %t1 = load double, ptr %arrayidx1, align 8
+ %t2 = load double, ptr %arrayidx2, align 8
+ %t3 = load double, ptr %arrayidx3, align 8
ret double %t3
}
; Unsimplified, but still valid. Also, throw in some bogus arguments.
-define void @gep0(i8* %unused, i8* %other, i8* %ptr) {
-; CHECK-LABEL: @gep0(i8* %unused, i8* %other, i8* %ptr)
- %arrayidx0 = getelementptr i8, i8* %ptr, i64 0
- %arrayidx1 = getelementptr i8, i8* %ptr, i64 1
- %arrayidx2 = getelementptr i8, i8* %ptr, i64 2
- %t0 = load i8, i8* %arrayidx0
- %t1 = load i8, i8* %arrayidx1
- %t2 = load i8, i8* %arrayidx2
- store i8 %t2, i8* %other
+define void @gep0(ptr %unused, ptr %other, ptr %ptr) {
+; CHECK-LABEL: @gep0(ptr %unused, ptr %other, ptr %ptr)
+ %arrayidx1 = getelementptr i8, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr i8, ptr %ptr, i64 2
+ %t0 = load i8, ptr %ptr
+ %t1 = load i8, ptr %arrayidx1
+ %t2 = load i8, ptr %arrayidx2
+ store i8 %t2, ptr %other
ret void
}
; Order of accesses does not change computation.
; Multiple arguments may be dereferenceable.
-define void @ordering(i8* %ptr1, i32* %ptr2) {
-; CHECK-LABEL: @ordering(i8* %ptr1, i32* %ptr2)
- %a20 = getelementptr i32, i32* %ptr2, i64 0
- %a12 = getelementptr i8, i8* %ptr1, i64 2
- %t12 = load i8, i8* %a12
- %a11 = getelementptr i8, i8* %ptr1, i64 1
- %t20 = load i32, i32* %a20
- %a10 = getelementptr i8, i8* %ptr1, i64 0
- %t10 = load i8, i8* %a10
- %t11 = load i8, i8* %a11
- %a21 = getelementptr i32, i32* %ptr2, i64 1
- %t21 = load i32, i32* %a21
+define void @ordering(ptr %ptr1, ptr %ptr2) {
+; CHECK-LABEL: @ordering(ptr %ptr1, ptr %ptr2)
+ %a12 = getelementptr i8, ptr %ptr1, i64 2
+ %t12 = load i8, ptr %a12
+ %a11 = getelementptr i8, ptr %ptr1, i64 1
+ %t20 = load i32, ptr %ptr2
+ %t10 = load i8, ptr %ptr1
+ %t11 = load i8, ptr %a11
+ %a21 = getelementptr i32, ptr %ptr2, i64 1
+ %t21 = load i32, ptr %a21
ret void
}
; Not in entry block.
-define void @not_entry_but_guaranteed_to_execute(i8* %ptr) {
-; CHECK-LABEL: @not_entry_but_guaranteed_to_execute(i8* %ptr)
+define void @not_entry_but_guaranteed_to_execute(ptr %ptr) {
+; CHECK-LABEL: @not_entry_but_guaranteed_to_execute(ptr %ptr)
entry:
br label %exit
exit:
- %arrayidx0 = getelementptr i8, i8* %ptr, i64 0
- %arrayidx1 = getelementptr i8, i8* %ptr, i64 1
- %arrayidx2 = getelementptr i8, i8* %ptr, i64 2
- %t0 = load i8, i8* %arrayidx0
- %t1 = load i8, i8* %arrayidx1
- %t2 = load i8, i8* %arrayidx2
+ %arrayidx1 = getelementptr i8, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr i8, ptr %ptr, i64 2
+ %t0 = load i8, ptr %ptr
+ %t1 = load i8, ptr %arrayidx1
+ %t2 = load i8, ptr %arrayidx2
ret void
}
; Not in entry block and not guaranteed to execute.
-define void @not_entry_not_guaranteed_to_execute(i8* %ptr, i1 %cond) {
-; CHECK-LABEL: @not_entry_not_guaranteed_to_execute(i8* %ptr, i1 %cond)
+define void @not_entry_not_guaranteed_to_execute(ptr %ptr, i1 %cond) {
+; CHECK-LABEL: @not_entry_not_guaranteed_to_execute(ptr %ptr, i1 %cond)
entry:
br i1 %cond, label %loads, label %exit
loads:
- %arrayidx0 = getelementptr i8, i8* %ptr, i64 0
- %arrayidx1 = getelementptr i8, i8* %ptr, i64 1
- %arrayidx2 = getelementptr i8, i8* %ptr, i64 2
- %t0 = load i8, i8* %arrayidx0
- %t1 = load i8, i8* %arrayidx1
- %t2 = load i8, i8* %arrayidx2
+ %arrayidx1 = getelementptr i8, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr i8, ptr %ptr, i64 2
+ %t0 = load i8, ptr %ptr
+ %t1 = load i8, ptr %arrayidx1
+ %t2 = load i8, ptr %arrayidx2
ret void
exit:
ret void
@@ -125,17 +120,16 @@ exit:
; The last load may not execute, so derefenceable bytes only covers the 1st two loads.
-define void @partial_in_entry(i16* %ptr, i1 %cond) {
-; CHECK-LABEL: @partial_in_entry(i16* %ptr, i1 %cond)
+define void @partial_in_entry(ptr %ptr, i1 %cond) {
+; CHECK-LABEL: @partial_in_entry(ptr %ptr, i1 %cond)
entry:
- %arrayidx0 = getelementptr i16, i16* %ptr, i64 0
- %arrayidx1 = getelementptr i16, i16* %ptr, i64 1
- %arrayidx2 = getelementptr i16, i16* %ptr, i64 2
- %t0 = load i16, i16* %arrayidx0
- %t1 = load i16, i16* %arrayidx1
+ %arrayidx1 = getelementptr i16, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr i16, ptr %ptr, i64 2
+ %t0 = load i16, ptr %ptr
+ %t1 = load i16, ptr %arrayidx1
br i1 %cond, label %loads, label %exit
loads:
- %t2 = load i16, i16* %arrayidx2
+ %t2 = load i16, ptr %arrayidx2
ret void
exit:
ret void
@@ -144,214 +138,191 @@ exit:
; The volatile load can't be used to prove a non-volatile access is allowed.
; The 2nd and 3rd loads may never execute.
-define void @volatile_is_not_dereferenceable(i16* %ptr) {
-; CHECK-LABEL: @volatile_is_not_dereferenceable(i16* %ptr)
- %arrayidx0 = getelementptr i16, i16* %ptr, i64 0
- %arrayidx1 = getelementptr i16, i16* %ptr, i64 1
- %arrayidx2 = getelementptr i16, i16* %ptr, i64 2
- %t0 = load volatile i16, i16* %arrayidx0
- %t1 = load i16, i16* %arrayidx1
- %t2 = load i16, i16* %arrayidx2
+define void @volatile_is_not_dereferenceable(ptr %ptr) {
+; CHECK-LABEL: @volatile_is_not_dereferenceable(ptr %ptr)
+ %arrayidx1 = getelementptr i16, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr i16, ptr %ptr, i64 2
+ %t0 = load volatile i16, ptr %ptr
+ %t1 = load i16, ptr %arrayidx1
+ %t2 = load i16, ptr %arrayidx2
ret void
}
; TODO: We should allow inference for atomic (but not volatile) ops.
-define void @atomic_is_alright(i16* %ptr) {
-; CHECK-LABEL: @atomic_is_alright(i16* %ptr)
- %arrayidx0 = getelementptr i16, i16* %ptr, i64 0
- %arrayidx1 = getelementptr i16, i16* %ptr, i64 1
- %arrayidx2 = getelementptr i16, i16* %ptr, i64 2
- %t0 = load atomic i16, i16* %arrayidx0 unordered, align 2
- %t1 = load i16, i16* %arrayidx1
- %t2 = load i16, i16* %arrayidx2
+define void @atomic_is_alright(ptr %ptr) {
+; CHECK-LABEL: @atomic_is_alright(ptr %ptr)
+ %arrayidx1 = getelementptr i16, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr i16, ptr %ptr, i64 2
+ %t0 = load atomic i16, ptr %ptr unordered, align 2
+ %t1 = load i16, ptr %arrayidx1
+ %t2 = load i16, ptr %arrayidx2
ret void
}
declare void @may_not_return()
-define void @not_guaranteed_to_transfer_execution(i16* %ptr) {
-; CHECK-LABEL: @not_guaranteed_to_transfer_execution(i16* %ptr)
- %arrayidx0 = getelementptr i16, i16* %ptr, i64 0
- %arrayidx1 = getelementptr i16, i16* %ptr, i64 1
- %arrayidx2 = getelementptr i16, i16* %ptr, i64 2
- %t0 = load i16, i16* %arrayidx0
+define void @not_guaranteed_to_transfer_execution(ptr %ptr) {
+; CHECK-LABEL: @not_guaranteed_to_transfer_execution(ptr %ptr)
+ %arrayidx1 = getelementptr i16, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr i16, ptr %ptr, i64 2
+ %t0 = load i16, ptr %ptr
call void @may_not_return()
- %t1 = load i16, i16* %arrayidx1
- %t2 = load i16, i16* %arrayidx2
+ %t1 = load i16, ptr %arrayidx1
+ %t2 = load i16, ptr %arrayidx2
ret void
}
; We must have consecutive accesses.
-define void @variable_gep_index(i8* %unused, i8* %ptr, i64 %variable_index) {
-; CHECK-LABEL: @variable_gep_index(i8* %unused, i8* %ptr, i64 %variable_index)
- %arrayidx1 = getelementptr i8, i8* %ptr, i64 %variable_index
- %arrayidx2 = getelementptr i8, i8* %ptr, i64 2
- %t0 = load i8, i8* %ptr
- %t1 = load i8, i8* %arrayidx1
- %t2 = load i8, i8* %arrayidx2
+define void @variable_gep_index(ptr %unused, ptr %ptr, i64 %variable_index) {
+; CHECK-LABEL: @variable_gep_index(ptr %unused, ptr %ptr, i64 %variable_index)
+ %arrayidx1 = getelementptr i8, ptr %ptr, i64 %variable_index
+ %arrayidx2 = getelementptr i8, ptr %ptr, i64 2
+ %t0 = load i8, ptr %ptr
+ %t1 = load i8, ptr %arrayidx1
+ %t2 = load i8, ptr %arrayidx2
ret void
}
; Deal with >1 GEP index.
-define void @multi_index_gep(<4 x i8>* %ptr) {
-; CHECK-LABEL: @multi_index_gep(<4 x i8>* %ptr)
+define void @multi_index_gep(ptr %ptr) {
+; CHECK-LABEL: @multi_index_gep(ptr %ptr)
; FIXME: %ptr should be dereferenceable(4)
- %arrayidx00 = getelementptr <4 x i8>, <4 x i8>* %ptr, i64 0, i64 0
- %t0 = load i8, i8* %arrayidx00
+ %t0 = load i8, ptr %ptr
ret void
}
; Could round weird bitwidths down?
-define void @not_byte_multiple(i9* %ptr) {
-; CHECK-LABEL: @not_byte_multiple(i9* %ptr)
- %arrayidx0 = getelementptr i9, i9* %ptr, i64 0
- %t0 = load i9, i9* %arrayidx0
+define void @not_byte_multiple(ptr %ptr) {
+; CHECK-LABEL: @not_byte_multiple(ptr %ptr)
+ %t0 = load i9, ptr %ptr
ret void
}
; Missing direct access from the pointer.
-define void @no_pointer_deref(i16* %ptr) {
-; CHECK-LABEL: @no_pointer_deref(i16* %ptr)
- %arrayidx1 = getelementptr i16, i16* %ptr, i64 1
- %arrayidx2 = getelementptr i16, i16* %ptr, i64 2
- %t1 = load i16, i16* %arrayidx1
- %t2 = load i16, i16* %arrayidx2
+define void @no_pointer_deref(ptr %ptr) {
+; CHECK-LABEL: @no_pointer_deref(ptr %ptr)
+ %arrayidx1 = getelementptr i16, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr i16, ptr %ptr, i64 2
+ %t1 = load i16, ptr %arrayidx1
+ %t2 = load i16, ptr %arrayidx2
ret void
}
; Out-of-order is ok, but missing access concludes dereferenceable range.
-define void @non_consecutive(i32* %ptr) {
-; CHECK-LABEL: @non_consecutive(i32* %ptr)
- %arrayidx1 = getelementptr i32, i32* %ptr, i64 1
- %arrayidx0 = getelementptr i32, i32* %ptr, i64 0
- %arrayidx3 = getelementptr i32, i32* %ptr, i64 3
- %t1 = load i32, i32* %arrayidx1
- %t0 = load i32, i32* %arrayidx0
- %t3 = load i32, i32* %arrayidx3
+define void @non_consecutive(ptr %ptr) {
+; CHECK-LABEL: @non_consecutive(ptr %ptr)
+ %arrayidx1 = getelementptr i32, ptr %ptr, i64 1
+ %arrayidx3 = getelementptr i32, ptr %ptr, i64 3
+ %t1 = load i32, ptr %arrayidx1
+ %t0 = load i32, ptr %ptr
+ %t3 = load i32, ptr %arrayidx3
ret void
}
; Improve on existing dereferenceable attribute.
-define void @more_bytes(i32* dereferenceable(8) %ptr) {
-; CHECK-LABEL: @more_bytes(i32* dereferenceable(8) %ptr)
- %arrayidx3 = getelementptr i32, i32* %ptr, i64 3
- %arrayidx1 = getelementptr i32, i32* %ptr, i64 1
- %arrayidx0 = getelementptr i32, i32* %ptr, i64 0
- %arrayidx2 = getelementptr i32, i32* %ptr, i64 2
- %t3 = load i32, i32* %arrayidx3
- %t1 = load i32, i32* %arrayidx1
- %t2 = load i32, i32* %arrayidx2
- %t0 = load i32, i32* %arrayidx0
+define void @more_bytes(ptr dereferenceable(8) %ptr) {
+; CHECK-LABEL: @more_bytes(ptr dereferenceable(8) %ptr)
+ %arrayidx3 = getelementptr i32, ptr %ptr, i64 3
+ %arrayidx1 = getelementptr i32, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr i32, ptr %ptr, i64 2
+ %t3 = load i32, ptr %arrayidx3
+ %t1 = load i32, ptr %arrayidx1
+ %t2 = load i32, ptr %arrayidx2
+ %t0 = load i32, ptr %ptr
ret void
}
; Improve on existing dereferenceable_or_null attribute.
-define void @more_bytes_and_not_null(i32* dereferenceable_or_null(8) %ptr) {
-; CHECK-LABEL: @more_bytes_and_not_null(i32* dereferenceable_or_null(8) %ptr)
- %arrayidx3 = getelementptr i32, i32* %ptr, i64 3
- %arrayidx1 = getelementptr i32, i32* %ptr, i64 1
- %arrayidx0 = getelementptr i32, i32* %ptr, i64 0
- %arrayidx2 = getelementptr i32, i32* %ptr, i64 2
- %t3 = load i32, i32* %arrayidx3
- %t1 = load i32, i32* %arrayidx1
- %t2 = load i32, i32* %arrayidx2
- %t0 = load i32, i32* %arrayidx0
+define void @more_bytes_and_not_null(ptr dereferenceable_or_null(8) %ptr) {
+; CHECK-LABEL: @more_bytes_and_not_null(ptr dereferenceable_or_null(8) %ptr)
+ %arrayidx3 = getelementptr i32, ptr %ptr, i64 3
+ %arrayidx1 = getelementptr i32, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr i32, ptr %ptr, i64 2
+ %t3 = load i32, ptr %arrayidx3
+ %t1 = load i32, ptr %arrayidx1
+ %t2 = load i32, ptr %arrayidx2
+ %t0 = load i32, ptr %ptr
ret void
}
; But don't pessimize existing dereferenceable attribute.
-define void @better_bytes(i32* dereferenceable(100) %ptr) {
-; CHECK-LABEL: @better_bytes(i32* dereferenceable(100) %ptr)
- %arrayidx3 = getelementptr i32, i32* %ptr, i64 3
- %arrayidx1 = getelementptr i32, i32* %ptr, i64 1
- %arrayidx0 = getelementptr i32, i32* %ptr, i64 0
- %arrayidx2 = getelementptr i32, i32* %ptr, i64 2
- %t3 = load i32, i32* %arrayidx3
- %t1 = load i32, i32* %arrayidx1
- %t2 = load i32, i32* %arrayidx2
- %t0 = load i32, i32* %arrayidx0
+define void @better_bytes(ptr dereferenceable(100) %ptr) {
+; CHECK-LABEL: @better_bytes(ptr dereferenceable(100) %ptr)
+ %arrayidx3 = getelementptr i32, ptr %ptr, i64 3
+ %arrayidx1 = getelementptr i32, ptr %ptr, i64 1
+ %arrayidx2 = getelementptr i32, ptr %ptr, i64 2
+ %t3 = load i32, ptr %arrayidx3
+ %t1 = load i32, ptr %arrayidx1
+ %t2 = load i32, ptr %arrayidx2
+ %t0 = load i32, ptr %ptr
ret void
}
-define void @bitcast(i32* %arg) {
-; CHECK-LABEL: @bitcast(i32* %arg)
- %ptr = bitcast i32* %arg to float*
- %arrayidx0 = getelementptr float, float* %ptr, i64 0
- %arrayidx1 = getelementptr float, float* %ptr, i64 1
- %t0 = load float, float* %arrayidx0
- %t1 = load float, float* %arrayidx1
+define void @bitcast(ptr %arg) {
+; CHECK-LABEL: @bitcast(ptr %arg)
+ %arrayidx1 = getelementptr float, ptr %arg, i64 1
+ %t0 = load float, ptr %arg
+ %t1 = load float, ptr %arrayidx1
ret void
}
-define void @bitcast_
diff erent_sizes(double* %arg1, i8* %arg2) {
-; CHECK-LABEL: @bitcast_
diff erent_sizes(double* %arg1, i8* %arg2)
- %ptr1 = bitcast double* %arg1 to float*
- %a10 = getelementptr float, float* %ptr1, i64 0
- %a11 = getelementptr float, float* %ptr1, i64 1
- %a12 = getelementptr float, float* %ptr1, i64 2
- %ld10 = load float, float* %a10
- %ld11 = load float, float* %a11
- %ld12 = load float, float* %a12
-
- %ptr2 = bitcast i8* %arg2 to i64*
- %a20 = getelementptr i64, i64* %ptr2, i64 0
- %a21 = getelementptr i64, i64* %ptr2, i64 1
- %ld20 = load i64, i64* %a20
- %ld21 = load i64, i64* %a21
+define void @bitcast_
diff erent_sizes(ptr %arg1, ptr %arg2) {
+; CHECK-LABEL: @bitcast_
diff erent_sizes(ptr %arg1, ptr %arg2)
+ %a11 = getelementptr float, ptr %arg1, i64 1
+ %a12 = getelementptr float, ptr %arg1, i64 2
+ %ld10 = load float, ptr %arg1
+ %ld11 = load float, ptr %a11
+ %ld12 = load float, ptr %a12
+
+ %a21 = getelementptr i64, ptr %arg2, i64 1
+ %ld20 = load i64, ptr %arg2
+ %ld21 = load i64, ptr %a21
ret void
}
-define void @negative_offset(i32* %arg) {
-; CHECK-LABEL: @negative_offset(i32* %arg)
- %ptr = bitcast i32* %arg to float*
- %arrayidx0 = getelementptr float, float* %ptr, i64 0
- %arrayidx1 = getelementptr float, float* %ptr, i64 -1
- %t0 = load float, float* %arrayidx0
- %t1 = load float, float* %arrayidx1
+define void @negative_offset(ptr %arg) {
+; CHECK-LABEL: @negative_offset(ptr %arg)
+ %arrayidx1 = getelementptr float, ptr %arg, i64 -1
+ %t0 = load float, ptr %arg
+ %t1 = load float, ptr %arrayidx1
ret void
}
-define void @stores(i32* %arg) {
-; CHECK-LABEL: @stores(i32* %arg)
- %ptr = bitcast i32* %arg to float*
- %arrayidx0 = getelementptr float, float* %ptr, i64 0
- %arrayidx1 = getelementptr float, float* %ptr, i64 1
- store float 1.0, float* %arrayidx0
- store float 2.0, float* %arrayidx1
+define void @stores(ptr %arg) {
+; CHECK-LABEL: @stores(ptr %arg)
+ %arrayidx1 = getelementptr float, ptr %arg, i64 1
+ store float 1.0, ptr %arg
+ store float 2.0, ptr %arrayidx1
ret void
}
-define void @load_store(i32* %arg) {
-; CHECK-LABEL: @load_store(i32* %arg)
- %ptr = bitcast i32* %arg to float*
- %arrayidx0 = getelementptr float, float* %ptr, i64 0
- %arrayidx1 = getelementptr float, float* %ptr, i64 1
- %t1 = load float, float* %arrayidx0
- store float 2.0, float* %arrayidx1
+define void @load_store(ptr %arg) {
+; CHECK-LABEL: @load_store(ptr %arg)
+ %arrayidx1 = getelementptr float, ptr %arg, i64 1
+ %t1 = load float, ptr %arg
+ store float 2.0, ptr %arrayidx1
ret void
}
-define void @
diff erent_size1(i32* %arg) {
-; CHECK-LABEL: @
diff erent_size1(i32* %arg)
- %arg-cast = bitcast i32* %arg to double*
- store double 0.000000e+00, double* %arg-cast
- store i32 0, i32* %arg
+define void @
diff erent_size1(ptr %arg) {
+; CHECK-LABEL: @
diff erent_size1(ptr %arg)
+ store double 0.000000e+00, ptr %arg
+ store i32 0, ptr %arg
ret void
}
-define void @
diff erent_size2(i32* %arg) {
-; CHECK-LABEL: @
diff erent_size2(i32* %arg)
- store i32 0, i32* %arg
- %arg-cast = bitcast i32* %arg to double*
- store double 0.000000e+00, double* %arg-cast
+define void @
diff erent_size2(ptr %arg) {
+; CHECK-LABEL: @
diff erent_size2(ptr %arg)
+ store i32 0, ptr %arg
+ store double 0.000000e+00, ptr %arg
ret void
}
diff --git a/llvm/test/Transforms/InferFunctionAttrs/nobuiltin.ll b/llvm/test/Transforms/InferFunctionAttrs/nobuiltin.ll
index 3c299f0d31636..337e1c9723d23 100644
--- a/llvm/test/Transforms/InferFunctionAttrs/nobuiltin.ll
+++ b/llvm/test/Transforms/InferFunctionAttrs/nobuiltin.ll
@@ -1,5 +1,5 @@
; RUN: opt -S -passes=inferattrs < %s | FileCheck %s
; CHECK: Function Attrs: nobuiltin allocsize(0){{$}}
-; CHECK: declare i8* @_Znwm(i32)
-declare i8* @_Znwm(i32) nobuiltin allocsize(0)
+; CHECK: declare ptr @_Znwm(i32)
+declare ptr @_Znwm(i32) nobuiltin allocsize(0)
diff --git a/llvm/test/Transforms/InferFunctionAttrs/norecurse_debug.ll b/llvm/test/Transforms/InferFunctionAttrs/norecurse_debug.ll
index 12a59ea02cc88..c8568272d320f 100644
--- a/llvm/test/Transforms/InferFunctionAttrs/norecurse_debug.ll
+++ b/llvm/test/Transforms/InferFunctionAttrs/norecurse_debug.ll
@@ -3,17 +3,17 @@
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "armv4t-none-unknown-eabi"
- at foo.coefficient1 = internal unnamed_addr global i32* null, align 4, !dbg !0
- at iirLow1 = external dso_local local_unnamed_addr global i32*, align 4
+ at foo.coefficient1 = internal unnamed_addr global ptr null, align 4, !dbg !0
+ at iirLow1 = external dso_local local_unnamed_addr global ptr, align 4
; Function Attrs: nounwind
define dso_local void @foo(i32 %i2) local_unnamed_addr #0 !dbg !2 {
entry:
call void @llvm.dbg.value(metadata i32 %i2, metadata !11, metadata !DIExpression()), !dbg !18
- %0 = load i32*, i32** @iirLow1, align 4, !dbg !19
- store i32 0, i32* %0, align 4, !dbg !24
- %1 = ptrtoint i32* %0 to i32, !dbg !27
- store i32 %1, i32* bitcast (i32** @foo.coefficient1 to i32*), align 4, !dbg !28
+ %0 = load ptr, ptr @iirLow1, align 4, !dbg !19
+ store i32 0, ptr %0, align 4, !dbg !24
+ %1 = ptrtoint ptr %0 to i32, !dbg !27
+ store i32 %1, ptr @foo.coefficient1, align 4, !dbg !28
ret void, !dbg !29
}
diff --git a/llvm/test/Transforms/InferFunctionAttrs/pr30455.ll b/llvm/test/Transforms/InferFunctionAttrs/pr30455.ll
index c8a958fb36b6e..7fa68f94dc71c 100644
--- a/llvm/test/Transforms/InferFunctionAttrs/pr30455.ll
+++ b/llvm/test/Transforms/InferFunctionAttrs/pr30455.ll
@@ -5,9 +5,8 @@
define i32 @foo() {
entry:
%st = alloca %struct.statvfs64, align 4
- %0 = bitcast %struct.statvfs64* %st to i8*
ret i32 0
}
-; CHECK: declare i32 @statvfs64(%struct.statvfs64*){{$}}
-declare i32 @statvfs64(%struct.statvfs64*)
+; CHECK: declare i32 @statvfs64(ptr){{$}}
+declare i32 @statvfs64(ptr)
More information about the llvm-commits
mailing list