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

[SMTToLLVM] Add support for most expressions #6905

Merged
merged 1 commit into from Apr 20, 2024
Merged

Conversation

maerhart
Copy link
Member

@maerhart maerhart commented Apr 8, 2024

Only the quantifier operations are still missing.

Copy link
Contributor

@fabianschuiki fabianschuiki left a comment

Choose a reason for hiding this comment

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

Very nice stuff. LGTM 😎

Comment on lines +890 to +900
/// Lower `smt.int.constant` operations to one of the following two Z3 API
/// function calls depending on whether the storage APInt has a bit-width that
/// fits in a `uint64_t`.
/// ```
/// Z3_sort Z3_API Z3_mk_int_sort(Z3_context c);
///
/// Z3_ast Z3_API Z3_mk_int64(Z3_context c, int64_t v, Z3_sort ty);
///
/// Z3_ast Z3_API Z3_mk_numeral(Z3_context c, Z3_string numeral, Z3_sort ty);
/// Z3_ast Z3_API Z3_mk_unary_minus(Z3_context c, Z3_ast arg);
/// ```
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

Comment on lines +1036 to +1041

#define ADD_ONE_TO_ONE_PATTERN(OP, APINAME, NUM_ARGS) \
patterns.add<OneToOneSMTPattern<OP>>(/*NOLINT(bugprone-macro-parentheses)*/ \
converter, patterns.getContext(), \
globals, options, APINAME, NUM_ARGS);

Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as in #6902 about potentially making these templated lambdas to avoid a macro.

Copy link
Member Author

Choose a reason for hiding this comment

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

AFAIK templated lambdas are a C++20 feature. If there is something similar we can use in C++17, let me know!

Base automatically changed from maerhart-smt-to-llvm-0 to main April 20, 2024 08:11
@maerhart maerhart merged commit da900a2 into main Apr 20, 2024
4 checks passed
@maerhart maerhart deleted the maerhart-smt-to-llvm-1 branch April 20, 2024 09:22
cepheus69 pushed a commit to cepheus69/circt that referenced this pull request Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants