Skip to content

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
Member

@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
searlmc1 pushed a commit that referenced this pull request Aug 25, 2025
llvm#137975)

An authenticated pointer can be explicitly checked by the compiler via a
sequence of instructions that executes BRK on failure. It is important
to recognize such BRK instruction as checking every register (as it is
expected to immediately trigger an abnormal program termination) to
prevent false positive reports about authentication oracles:

      autia   x2, x3
      autia   x0, x1
      ; neither x0 nor x2 are checked at this point
      eor     x16, x0, x0, lsl #1
      tbz     x16, #62, on_success ; marks x0 as checked
      ; end of BB: for x2 to be checked here, it must be checked in both
      ; successor basic blocks
    on_failure:
      brk     0xc470
    on_success:
      ; x2 is checked
      ldr     x1, [x2] ; marks x2 as checked
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