[PATCH] D123087: tests: add attributes that would normally come from inferattrs

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 7 13:16:55 PDT 2022


nikic added a comment.

This looks good, just wondering whether we can reduce to only allocsize for some of these?



================
Comment at: llvm/test/Instrumentation/BoundsChecking/simple.ll:11
+declare noalias i8* @calloc(i64, i64) nounwind allockind("alloc,zeroed") allocsize(0,1)
+declare noalias i8* @realloc(i8* nocapture allocptr, i64) nounwind allockind("realloc") allocsize(1)
 
----------------
Do we need more than allocsize for this test?


================
Comment at: llvm/test/Transforms/InstCombine/objsize-64.ll:5
 
-declare noalias i8* @malloc(i64) nounwind
+declare noalias i8* @malloc(i64) nounwind allockind("alloc,uninitialized") allocsize(0)
 declare noalias nonnull i8* @_Znwm(i64)  ; new(unsigned long)
----------------
Does this and the following test need more than allocsize?


================
Comment at: llvm/test/Transforms/LowerConstantIntrinsics/builtin-object-size-phi.ll:8
 
-declare dso_local noalias noundef i8* @malloc(i64 noundef) local_unnamed_addr
+declare dso_local noalias noundef i8* @malloc(i64 noundef) local_unnamed_addr allockind("alloc,uninitialized") allocsize(0)
 declare i64 @llvm.objectsize.i64.p0i8(i8*, i1 immarg, i1 immarg, i1 immarg)
----------------
Does this need more than just allocsize(0)?


================
Comment at: llvm/test/Transforms/MemCpyOpt/memcpy.ll:331
 
-declare noalias i8* @malloc(i32) willreturn
+declare noalias i8* @malloc(i32) willreturn allockind("alloc,uninitialized") allocsize(0)
 
----------------
Still don't understand why this one would need extra attributes.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123087/new/

https://reviews.llvm.org/D123087



More information about the llvm-commits mailing list