Skip to content

Commit 79bc1be

Browse files
dtcxzywyuxuanchen1997
authored andcommitted
[InferAttrs] Set attributes for remainder (#99521)
Summary: Fixes one of the issues in #99497. Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60250797
1 parent 6f43bbd commit 79bc1be

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

llvm/lib/Transforms/Utils/BuildLibCalls.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,6 +1195,9 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
11951195
case LibFunc_pow:
11961196
case LibFunc_powf:
11971197
case LibFunc_powl:
1198+
case LibFunc_remainder:
1199+
case LibFunc_remainderf:
1200+
case LibFunc_remainderl:
11981201
case LibFunc_rint:
11991202
case LibFunc_rintf:
12001203
case LibFunc_rintl:

llvm/test/Transforms/InferFunctionAttrs/annotate.ll

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,15 @@ declare ptr @vec_realloc(ptr, i64)
800800
; CHECK: declare noundef ptr @realpath(ptr nocapture noundef readonly, ptr noundef) [[NOFREE_NOUNWIND]]
801801
declare ptr @realpath(ptr, ptr)
802802

803+
; CHECK: declare double @remainder(double, double) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
804+
declare double @remainder(double, double)
805+
806+
; CHECK: declare float @remainderf(float, float) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
807+
declare float @remainderf(float, float)
808+
809+
; CHECK: declare x86_fp80 @remainderl(x86_fp80, x86_fp80) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]]
810+
declare x86_fp80 @remainderl(x86_fp80, x86_fp80)
811+
803812
; CHECK: declare noundef i32 @remove(ptr nocapture noundef readonly) [[NOFREE_NOUNWIND]]
804813
declare i32 @remove(ptr)
805814

0 commit comments

Comments
 (0)