Skip to content

egraphs: Const propagate bitwise float operations#8625

Merged
afonso360 merged 2 commits into
bytecodealliance:mainfrom
afonso360:cprop-float
May 15, 2024
Merged

egraphs: Const propagate bitwise float operations#8625
afonso360 merged 2 commits into
bytecodealliance:mainfrom
afonso360:cprop-float

Conversation

@afonso360
Copy link
Copy Markdown
Contributor

👋 Hey,

This PR adds constant propagation for the few bitwise floating point operations that we have (fneg / fabs / fcopysign). Since these operations are guaranteed to be done in a bitwise manner it should be safe to constant propagate them.

@afonso360 afonso360 requested a review from a team as a code owner May 15, 2024 14:28
@afonso360 afonso360 requested review from fitzgen and removed request for a team May 15, 2024 14:29
@alexcrichton alexcrichton added this pull request to the merge queue May 15, 2024
Copy link
Copy Markdown
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

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

Thanks! One nitpick below :)

Comment thread cranelift/codegen/src/opts/cprop.isle Outdated
Comment on lines +299 to +310
(decl pure f32_neg (Ieee32) Ieee32)
(extern constructor f32_neg f32_neg)
(decl pure f32_abs (Ieee32) Ieee32)
(extern constructor f32_abs f32_abs)
(decl pure f32_copysign (Ieee32 Ieee32) Ieee32)
(extern constructor f32_copysign f32_copysign)
(decl pure f64_neg (Ieee64) Ieee64)
(extern constructor f64_neg f64_neg)
(decl pure f64_abs (Ieee64) Ieee64)
(extern constructor f64_abs f64_abs)
(decl pure f64_copysign (Ieee64 Ieee64) Ieee64)
(extern constructor f64_copysign f64_copysign)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we move these to prelude.isle?

@fitzgen fitzgen removed this pull request from the merge queue due to a manual request May 15, 2024
@github-actions github-actions Bot added cranelift Issues related to the Cranelift code generator isle Related to the ISLE domain-specific language labels May 15, 2024
@github-actions
Copy link
Copy Markdown

Subscribe to Label Action

cc @cfallin, @fitzgen

Details This issue or pull request has been labeled: "cranelift", "isle"

Thus the following users have been cc'd because of the following labels:

  • cfallin: isle
  • fitzgen: isle

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@afonso360 afonso360 added this pull request to the merge queue May 15, 2024
Merged via the queue into bytecodealliance:main with commit 5b7f8b8 May 15, 2024
@afonso360 afonso360 deleted the cprop-float branch May 15, 2024 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift Issues related to the Cranelift code generator isle Related to the ISLE domain-specific language

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants