Skip to content

ISLE: Add proper bool type#9593

Merged
cfallin merged 6 commits intobytecodealliance:mainfrom
Kmeakin:km/isle/booleans
Nov 14, 2024
Merged

ISLE: Add proper bool type#9593
cfallin merged 6 commits intobytecodealliance:mainfrom
Kmeakin:km/isle/booleans

Conversation

@Kmeakin
Copy link
Copy Markdown
Contributor

@Kmeakin Kmeakin commented Nov 11, 2024

Partially solves #3573

@Kmeakin Kmeakin requested a review from a team as a code owner November 11, 2024 19:16
@Kmeakin Kmeakin requested review from abrown and removed request for a team November 11, 2024 19:16
@Kmeakin Kmeakin changed the title Km/isle/booleans ISLE: Add proper bool type Nov 11, 2024
@Kmeakin Kmeakin force-pushed the km/isle/booleans branch 3 times, most recently from 2db83b3 to 7d0993f Compare November 11, 2024 20:23
@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:area:aarch64 Issues related to AArch64 backend. cranelift:area:x64 Issues related to x64 codegen isle Related to the ISLE domain-specific language labels Nov 11, 2024
@github-actions
Copy link
Copy Markdown

Subscribe to Label Action

cc @cfallin, @fitzgen

Details This issue or pull request has been labeled: "cranelift", "cranelift:area:aarch64", "cranelift:area:x64", "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.

Copy link
Copy Markdown
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

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

Thanks for working on this -- it's nice to see motion on the "nice-to-have" upgrades we've had in our backlog for a while!

Mostly looks fine; my main thought is about the BuiltinType abstraction and whether we can separate the change out.


/// A built-in type.
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum BuiltinType {
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.

I'm not sure I understand the reason for having a notion of "built-in types" for bool but not for other types that we have constants for (namely integers) -- while on the other hand it adds some complication to the IR. Maybe we could separate out this part into another PR and discuss separately?

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.

(To make it more explicit: I think we probably should have this eventually; but for integers too, and then we should check that integer literals are used only in contexts that expect them.)

Copy link
Copy Markdown
Contributor Author

@Kmeakin Kmeakin Nov 12, 2024

Choose a reason for hiding this comment

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

The intention is to extend BuiltinType to include other types (like u{8,16,32,64,size}, i{8,16,32,64,size} or str) in future PRs

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.

OK, yeah, on further thought I suppose it's totally fine to migrate integers over as a second step -- as long as the intention is there to finish out the refactor. Thanks!

Copyright (c) 2024, Arm Limited.

Signed-off-by: Karl Meakin <karl.meakin@arm.com>
Copyright (c) 2024, Arm Limited.

Signed-off-by: Karl Meakin <karl.meakin@arm.com>
Copyright (c) 2024, Arm Limited.

Signed-off-by: Karl Meakin <karl.meakin@arm.com>
Copyright (c) 2024, Arm Limited.

Replace all occurences of `$true` and `$false` with `true` and `false`.

Signed-off-by: Karl Meakin <karl.meakin@arm.com>
Instead of threading `on_lhs` through all the calls to `translate_expr`,
we can just set `is_partial` and `is_pure` on `root_flags` to true.

Copyright (c) 2024, Arm Limited.

Signed-off-by: Karl Meakin <karl.meakin@arm.com>
Copyright (c) 2024, Arm Limited.

Signed-off-by: Karl Meakin <karl.meakin@arm.com>
@cfallin cfallin added this pull request to the merge queue Nov 14, 2024
Merged via the queue into bytecodealliance:main with commit bb886ff Nov 14, 2024
@Kmeakin Kmeakin deleted the km/isle/booleans branch November 14, 2024 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift:area:aarch64 Issues related to AArch64 backend. cranelift:area:x64 Issues related to x64 codegen 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.

2 participants