-
Notifications
You must be signed in to change notification settings - Fork 311
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
[SMT] Add bv2int op #8049
[SMT] Add bv2int op #8049
Conversation
if (isa<smt::Int2BVOp, BV2IntOp>(op)) | ||
return op->emitError("operation not supported for SMTLIB emission"); | ||
|
||
return success(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think just
return op->emitError("operation not supported for SMTLIB emission");
should work instead of
if (isa<smt::Int2BVOp, BV2IntOp>(op))
return op->emitError("operation not supported for SMTLIB emission");
return success();
to generically emit this error if we add new operations that we don't explicitly add support for in ExportSMTLIB (i.e., should be more robust)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see, sorry for the misunderstanding before!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checked and this actually breaks all the ExportSMTLIB tests - I'm not super clear on the Visitor infrastructure so I'm not sure why yet, but from a brief scan it looks like getting rid of the condition causes the error to throw on the first non-ConstantLike op the export pass encounters.
I'll push fixes to main, thanks! |
As per review on llvm#8049
As per post-commit review on #8049
Adds an operation to convert between SMT bitvectors and SMT integers. As discussed further in #8041, support for these operations varies between solvers - technically this one is outlined in the SMTLIB spec but AFAIU only to describe the semantics of other operations, rather than as something solvers are expected to implement, so I've made ExportSMTLIB error out on this one too since it's not really part of the spec for the language itself.