Skip to content

Commit a716731

Browse files
committed
recognize rint/nearbyint c lib fns
1 parent ed3504d commit a716731

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

llvm_util/known_fns.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,16 @@ known_call(llvm::CallInst &i, const llvm::TargetLibraryInfo &TLI,
165165
RETURN_VAL(make_unique<FpUnaryOp>(*ty, value_name(i), *args[0],
166166
FpUnaryOp::Floor, parse_fmath(i)));
167167

168+
case llvm::LibFunc_nearbyint:
169+
case llvm::LibFunc_nearbyintf:
170+
RETURN_VAL(make_unique<FpUnaryOp>(*ty, value_name(i), *args[0],
171+
FpUnaryOp::NearbyInt, parse_fmath(i)));
172+
173+
case llvm::LibFunc_rint:
174+
case llvm::LibFunc_rintf:
175+
RETURN_VAL(make_unique<FpUnaryOp>(*ty, value_name(i), *args[0],
176+
FpUnaryOp::RInt, parse_fmath(i)));
177+
168178
case llvm::LibFunc_round:
169179
case llvm::LibFunc_roundf:
170180
RETURN_VAL(make_unique<FpUnaryOp>(*ty, value_name(i), *args[0],

0 commit comments

Comments
 (0)