Skip to content

frontend: Emit ordered comparison predicates for floats#2246

Merged
copybara-service[bot] merged 1 commit intogoogle:mainfrom
Time0o:Time0o-fix-float-binop-emission
Sep 22, 2025
Merged

frontend: Emit ordered comparison predicates for floats#2246
copybara-service[bot] merged 1 commit intogoogle:mainfrom
Time0o:Time0o-fix-float-binop-emission

Conversation

@Time0o
Copy link
Contributor

@Time0o Time0o commented Sep 22, 2025

Floating point comparison predicates in the arith dialect differ from integer ones. This inserts the ordered variants fixing erroneous outputs such as arith.cmpf slt -> arith.cmpf olt.

This is another issue I had while experimenting with the Python frontend and here I'm a bit more confident that this is indeed a bug.

Floating point comparison predicates in the arith dialect differ from integer
ones. This inserts the ordered variants fixing erroneous outputs such as
`arith.cmpf slt` -> `arith.cmpf olt`.
Copy link
Collaborator

@AlexanderViand AlexanderViand left a comment

Choose a reason for hiding this comment

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

Great catch! If you ran into this "in the wild", you probably have examples that triggered this? If yes, it'd be great if you could add one as a unit test :)

@AlexanderViand AlexanderViand added the python frontend Issues related to the python frontend label Sep 22, 2025
@j2kun j2kun added the pull_ready Indicates whether a PR is ready to pull. The copybara worker will import for internal testing label Sep 22, 2025
@copybara-service copybara-service bot merged commit f859091 into google:main Sep 22, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pull_ready Indicates whether a PR is ready to pull. The copybara worker will import for internal testing python frontend Issues related to the python frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants