-
Notifications
You must be signed in to change notification settings - Fork 6
fix transfer semantics for set/clear high/low bits #79
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
base: main
Are you sure you want to change the base?
Conversation
|
I remove the functions |
|
Sorry, I was very busy during PLDI, and now I have more time. And thanks a lot;) |
|
No worries, those paper deadlines are stressful! |
|
Let's take the function These are generated z3 exprs: It tries to find a counterexample when |
|
@math-fehr By the way, I found another small issue. https://github.com/opencompl/xdsl-smt/blob/main/xdsl_smt/passes/lower_to_smt/smt_lowerer_loaders.py#L72 |
|
ah, good point! I guess from my point of view, all other operations in the transfer dialect are total functions (output is well-defined for all inputs) like how we have special gaurds for |
|
Yes @Hatsunespica, please remove the one you think we should remove! |
|
thanks for taking a look @math-fehr, can you also weigh in on the question about semantics? Is it okay if the transfer dialect has some ub semantics? |
|
My understanding is that |
|
😨😨 if that's the case then there are several semantically incorrect lowerings from the transfer dialect into lib-smt code (and some bad rewrite rules for the optimization passes). At least for ops like u/sdiv, u/srem, a/lshr, and shl (and maybe some other ops), since with LLVM's APInt's these ops have some undefined inputs (div by 0 etc.) but we lower to the lib-smt functions which are defined for all inputs, so they end up being more restrictive |
there are incorrect op semantics for (in how the ops are lowered to the SMT dialect)
SetHighBitsOp,SetLowBitsOp,ClearHighBitsOp, andClearLowBitsOp, this PR fixes all of those