Skip to content
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

[flang][OpenMP] Change the lowering of max and min reduction operator #62

Closed
wants to merge 2 commits into from

Conversation

jsjodin
Copy link

@jsjodin jsjodin commented Apr 18, 2024

This patch changes the lowering of max and min to be lowered to arith::MaxNumFop and arith::MinNumFOp instead of using arith::MaximumFOp and arith::MinimumFOp. The arith::MaximumFOp and arith::MinimumFOp map to the corresponding intrinsics llvm.maximum.* and llvm.minimum.* intrinsics which conform to the semantics specified in the draft of IEEE 754-2019. which is not supported by all hardware. Instead using arith::MaximumFOp and arith::MinimumFOp will allow code generation for more targets and match the code generated by clang OpenMP.

This patch changes the lowering of max and min to be lowered to
arith::MaxNumFop and arith::MinNumFOp instead of using arith::MaximumFOp and
arith::MinimumFOp to match the code generated in clang. The arith::MaximumFOp
and arith::MinimumFOp map to the corresponding intrinsics llvm.maximum.* and
llvm.minimum.* intrinsics which conform to the semantics specified in the draft
of IEEE 754-2019. which is not supported by all hardware. Instead using
arith::MaximumFOp and arith::MinimumFOp will allow code generation for more
targets and match the code generated by clang OpenMP.
Copy link

@agozillon agozillon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link

@skatrak skatrak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

samjwu pushed a commit that referenced this pull request Apr 25, 2024
@jsjodin
Copy link
Author

jsjodin commented Apr 29, 2024

This was upstreamed.

@jsjodin jsjodin closed this Apr 29, 2024
@jsjodin jsjodin deleted the jleyonberg/minmax branch May 7, 2024 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants