Skip to content
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

ISLE: Add proper bool type #9593

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Kmeakin
Copy link
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
Copy link

Subscribe to Label Action

cc @cfallin, @fitzgen

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
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.

cranelift/isle/veri/README.md Outdated Show resolved Hide resolved
@@ -80,9 +80,36 @@ pub struct TypeEnv {
pub errors: Vec<Error>,
}

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

Copyright (c) 2024, Arm Limited.

Signed-off-by: Karl Meakin <[email protected]>
Copyright (c) 2024, Arm Limited.

Signed-off-by: Karl Meakin <[email protected]>
Copyright (c) 2024, Arm Limited.

Signed-off-by: Karl Meakin <[email protected]>
Copyright (c) 2024, Arm Limited.

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

Signed-off-by: Karl Meakin <[email protected]>
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 <[email protected]>
Copyright (c) 2024, Arm Limited.

Signed-off-by: Karl Meakin <[email protected]>
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