Skip to content

[mlir][vector][llvm] Improve LLVM lowering of fmin/fmax reductions #63969

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dcaballe opened this issue Jul 20, 2023 · 3 comments
Closed

[mlir][vector][llvm] Improve LLVM lowering of fmin/fmax reductions #63969

dcaballe opened this issue Jul 20, 2023 · 3 comments

Comments

@dcaballe
Copy link
Contributor

We currently generate llvm reduce_fmin/reduce_fmax intrinsics whose semantics don't match the NaN handling of arith.fmin/arith.fmax operations in MLIR. We should generate llvm reduce_fminimum/reduce_fmaximum intrinsics instead, which have been recently added to LLVM.

@llvmbot
Copy link
Member

llvmbot commented Jul 20, 2023

@llvm/issue-subscribers-mlir-vectorops

@llvmbot
Copy link
Member

llvmbot commented Jul 20, 2023

@llvm/issue-subscribers-mlir-llvm

@unterumarmung
Copy link
Contributor

unterumarmung added a commit that referenced this issue Jul 22, 2023
This patch adds supports for the reduction intrinsic
for floating point minimum and maximum that have
been added to LLVM by https://reviews.llvm.org/D152370.

Related to: #63969

Reviewed By: dcaballe

Differential Revision: https://reviews.llvm.org/D155869
doru1004 pushed a commit to doru1004/llvm-project that referenced this issue Aug 3, 2023
This patch improves the lowering by changing target LLVM intrinsics from
`reduce.fmax` and `reduce.fmin`,
which have different semantic for handling NaN,
to `reduce.fmaximum` and `reduce.fminimum` ones.

Fixes llvm#63969

Depends on D155869

Reviewed By: dcaballe

Differential Revision: https://reviews.llvm.org/D155877
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants