Skip to content

Conversation

tomeksowi
Copy link
Member

@tomeksowi tomeksowi commented Jan 20, 2025

There are ways to generate better code for equals-or-unordered and not-equals-and-ordered. However, there are no IL opcodes for them (ceq.un, beq.un, bne) so these code gens can't happen.

As a bonus, flip the comparison result with one instruction.

Part of #84834, cc @dotnet/samsung

@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jan 20, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jan 20, 2025
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@risc-vv
Copy link

risc-vv commented Jan 20, 2025

41d470bf is being scheduled for building and testing

GIT: 41d470bf4390b89f83968adb94cd90371be05ecb
REPO: dotnet/runtime
BRANCH: main

Release-build FAILED

buildinfo.json

Compilation failed during core build```

</details>

@risc-vv
Copy link

risc-vv commented Jan 20, 2025

a711137 is being scheduled for building and testing

GIT: a711137381bf85fbcd063a60990604c2f9ffd2e4
REPO: dotnet/runtime
BRANCH: main

Release-build FAILED

buildinfo.json

Compilation failed during core build```

</details>

@tomeksowi
Copy link
Member Author

@dotnet/jit-contrib PTAL

@tannergooding
Copy link
Member

There are ways to generate better code for equals-or-unordered and not-equals-and-ordered. However, there are no IL opcodes for them (ceq.un, beq.un, bne) so these code gens can't happen.

IL opcodes aren't required to generate such code. You can recognize patterns such as x == cns or various helpers like T.IsNaN, T.IsFinite, etc.

@risc-vv
Copy link

risc-vv commented Jan 31, 2025

f67b60a is being scheduled for building and testing

GIT: f67b60a9332dff5310247852c613d9661dcbe8d7
REPO: dotnet/runtime
BRANCH: main

Release-build FAILED

buildinfo.json

Cloning into '/godata/pipelines/Release-build/runtime'...
error: RPC failed; curl 92 HTTP/2 stream 5 was not closed cleanly: CANCEL (err 8)
error: 4702 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output

@tomeksowi
Copy link
Member Author

IL opcodes aren't required to generate such code. You can recognize patterns such as x == cns or various helpers like T.IsNaN, T.IsFinite, etc.

True, we can add them when these patterns are recognized and these code gens can be tested.

@JulieLeeMSFT
Copy link
Member

@jakobbotsch, please take a look at this stale PR.

@jakobbotsch jakobbotsch closed this Mar 3, 2025
@jakobbotsch jakobbotsch reopened this Mar 3, 2025
@jakobbotsch
Copy link
Member

/ba-g Everything is green

@jakobbotsch jakobbotsch merged commit e975cfe into dotnet:main Mar 4, 2025
121 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-riscv Related to the RISC-V architecture area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants