This is an archive of the discontinued LLVM Phabricator instance.

[mlir][llvm] Add rounding intrinsics
ClosedPublic

Authored by LukasSommerTu on May 26 2023, 6:04 AM.

Details

Summary

Add some of the missing libm rounding intrinsics to the LLVM dialect:

  • llvm.rint
  • llvm.nearbyint
  • llvm.lround
  • llvm.llround
  • llvm.lrint
  • llvm.llrint

Signed-off-by: Lukas Sommer <lukas.sommer@codeplay.com>

Diff Detail

Event Timeline

LukasSommerTu created this revision.May 26 2023, 6:04 AM
Herald added a reviewer: dcaballe. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
LukasSommerTu requested review of this revision.May 26 2023, 6:04 AM
zero9178 accepted this revision.May 26 2023, 7:07 AM

LGTM!

This revision is now accepted and ready to land.May 26 2023, 7:07 AM
gysit accepted this revision.May 27 2023, 11:48 AM

Thanks,

LGTM modulo some nit comments!

mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
133

nit: I know I did not do it consistently myself but can you postfix the intrinsic names with Op, e.g.:

LLVM_RIntOp
LLVM_NearbyIntOp

etc?

mlir/test/Target/LLVMIR/Import/intrinsic.ll
133

nit: Can you put a CHECK-LABEL as well for consistency

mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir
163

nit; Can you put a CHECK-LABEL for consistency here and below.

Add postfix to name and missing CHECK-LABEL

LukasSommerTu marked 3 inline comments as done.May 29 2023, 1:55 AM

@zero9178 @gysit Thanks for your reviews!

I addressed the comments in the latest update.

I do not have commit access, so if you are happy with the latest update, could someone please commit this for me? Thanks!

This revision was automatically updated to reflect the committed changes.