Skip to content

Commit

Permalink
[InferAttrs] Set attributes for remainder (#99521)
Browse files Browse the repository at this point in the history
Summary:
Fixes one of the issues in
#99497.

Test Plan: 

Reviewers: 

Subscribers: 

Tasks: 

Tags: 


Differential Revision: https://phabricator.intern.facebook.com/D60250797
  • Loading branch information
dtcxzyw authored and yuxuanchen1997 committed Jul 25, 2024
1 parent 6f43bbd commit 79bc1be
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions llvm/lib/Transforms/Utils/BuildLibCalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1195,6 +1195,9 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
case LibFunc_pow:
case LibFunc_powf:
case LibFunc_powl:
case LibFunc_remainder:
case LibFunc_remainderf:
case LibFunc_remainderl:
case LibFunc_rint:
case LibFunc_rintf:
case LibFunc_rintl:
Expand Down
9 changes: 9 additions & 0 deletions llvm/test/Transforms/InferFunctionAttrs/annotate.ll
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,15 @@ declare ptr @vec_realloc(ptr, i64)
; CHECK: declare noundef ptr @realpath(ptr nocapture noundef readonly, ptr noundef) [[NOFREE_NOUNWIND]]
declare ptr @realpath(ptr, ptr)

; CHECK: declare double @remainder(double, double) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare double @remainder(double, double)

; CHECK: declare float @remainderf(float, float) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare float @remainderf(float, float)

; CHECK: declare x86_fp80 @remainderl(x86_fp80, x86_fp80) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
declare x86_fp80 @remainderl(x86_fp80, x86_fp80)

; CHECK: declare noundef i32 @remove(ptr nocapture noundef readonly) [[NOFREE_NOUNWIND]]
declare i32 @remove(ptr)

Expand Down

0 comments on commit 79bc1be

Please sign in to comment.