Skip to content

Make shuffle_vector_exprt available to other frontends #6297

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

Closed
tedinski opened this issue Aug 13, 2021 · 1 comment · Fixed by #6645
Closed

Make shuffle_vector_exprt available to other frontends #6297

tedinski opened this issue Aug 13, 2021 · 1 comment · Fixed by #6645
Labels
aws Bugs or features of importance to AWS CBMC users aws-medium pending merge

Comments

@tedinski
Copy link

CBMC version: HEAD (cbmc-5.36.0-72-gf917b98e8)
Operating system: Various
Exact command line resulting in the issue: N/A
What behaviour did you expect: N/A
What happened instead: N/A

CBMC has a shuffle_vector_exprt construct that's used from it's C front-end, but this construct is immediately lowered by the front-end, and is not understood by the back-end. As a result, from RMC (the Rust Model Checker, which is basically generating a JSON symbol table as input to CBMC), this feature is not available to use. (At least, I'm pretty sure? It doesn't seem to be anyway.) For now, we're basically re-implementing this lowering in RMC.

It'd be nice if we could make CBMC's implementation available for our use, to eliminate this duplication. Presumably to make that happen, instead of immediately lowering shuffle_vector_exprt for example here in src/ansi-c/c_typecheck_gcc_polymorphic_builtins.cpp:

return shuffle_vector_exprt{arg0, arg1, std::move(operands)}.lower();

...instead the backend would be altered to understand this construct and do that lowering. (Presumably? I'm not yet familiar with CBMC internals.) That would allow RMC to emit symbol tables containing this construct.

@tedinski tedinski changed the title Make shuffle_vector_exprt available to other backends Make shuffle_vector_exprt available to other frontends Aug 13, 2021
@danielsn danielsn added the aws Bugs or features of importance to AWS CBMC users label Aug 17, 2021
@jimgrundy jimgrundy added aws-medium aws Bugs or features of importance to AWS CBMC users and removed aws Bugs or features of importance to AWS CBMC users labels Aug 24, 2021
tautschnig added a commit to tautschnig/cbmc that referenced this issue Feb 7, 2022
de4557f added support for _builtin_shuffle/__builtin_shufflevector via
a shuffle_vector_exprt. This expression, however, was lowered right away
in the C front end, making it unavailable to other language front-ends.
By moving the lowering to `remove_vector` there no longer is such a
limitation. Kani will be able to use it directly for Rust programs.

Regression test cbmc/gcc_vector3 continues to pass, demonstrating that
processing via the C front-end works as before.

Fixes: diffblue#6297
@tautschnig
Copy link
Collaborator

With apologies for this taking so long: #6645 finally addresses this.

tautschnig added a commit to tautschnig/cbmc that referenced this issue Feb 7, 2022
de4557f added support for _builtin_shuffle/__builtin_shufflevector via
a shuffle_vector_exprt. This expression, however, was lowered right away
in the C front end, making it unavailable to other language front-ends.
By moving the lowering to `remove_vector` there no longer is such a
limitation. Kani will be able to use it directly for Rust programs.

Regression test cbmc/gcc_vector3 continues to pass, demonstrating that
processing via the C front-end works as before.

Fixes: diffblue#6297
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws Bugs or features of importance to AWS CBMC users aws-medium pending merge
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants