Skip to content

Enable more general BITCAST folding in local morph #84144

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

Merged
merged 3 commits into from
Apr 11, 2023

Conversation

SingleAccretion
Copy link
Contributor

@SingleAccretion SingleAccretion commented Mar 30, 2023

And fix a few issues with the support already present in lowering, in particular, start containing things under user-produced BITCASTs.

Regressions:

  1. CSE.
  2. Containment of operands of user bitcasts can sometimes interact with their containment under local stores in unfavorable ways - see the second commit's description.

Fixes #71839.

Correctness fixes:
1) The hacky way which contained indirections were handled
   will not work for targets where address containment has
   special rules that depends on the type being loaded.
2) Small-typed sources were not handled correctly.
3) Interference checks. This has some regressions attached
   to it because we now contain locals with optimizations
   disabled and that can lead to using double stores instead
   of integer ones when the user is a store itself.
@ghost ghost added 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 labels Mar 30, 2023
@ghost
Copy link

ghost commented Mar 30, 2023

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

Issue Details

And fix a few issues with the support already present in lowering, in particular, start containing things under user-produced BITCASTs.

Regressions:

  1. CSE.
  2. Containment of operands of user bitcasts can sometimes interact with their containment under local stores in unfavorable ways, in particular (see the second commit's description).

Fixes #71839.

Author: SingleAccretion
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@EgorBo
Copy link
Member

EgorBo commented Mar 30, 2023

Optional: add constant folding for GT_BITCAST in importer (gtFoldConstExpr)

@SingleAccretion
Copy link
Contributor Author

add constant folding for GT_BITCAST in importer (gtFoldConstExpr)

I'll let that wait until the support for double<->long bitcasts on 32 bit is added as otherwise importer code is not simplifiable.

Diffs.

@dotnet/jit-contrib

@SingleAccretion SingleAccretion marked this pull request as ready for review March 31, 2023 16:29
@AndyAyersMS
Copy link
Member

@SingleAccretion can you resolve conflicts -- sorry it took us so long to look at this one.

@jakobbotsch jakobbotsch merged commit 17ed091 into dotnet:main Apr 11, 2023
@SingleAccretion SingleAccretion deleted the BitCast branch April 11, 2023 16:23
@ghost ghost locked as resolved and limited conversation to collaborators May 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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.

Updating lclmorph to support bitcast
4 participants