-
Notifications
You must be signed in to change notification settings - Fork 274
Smowton/fix/type equality improvements #4173
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
Smowton/fix/type equality improvements #4173
Conversation
No functional changes
The check is probably ok to go too, but we should make type preservation of `simplify` an invariant first.
{ | ||
std::cerr << symbol << '\n'; | ||
std::cerr << ns.lookup(id) << '\n'; | ||
} | ||
INVARIANT(base_type_eq(symbol.type, ns.lookup(id).type, ns), | ||
"type matches"); | ||
INVARIANT(symbol.type == ns.lookup(id).type, "type matches"); | ||
#endif |
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'd say you can just remove this code.
@@ -262,9 +262,6 @@ bool simplify_exprt::simplify_member(exprt &expr) | |||
|
|||
// Guess: turning this into a byte-extract operation is not really an | |||
// optimisation. | |||
// The type_eq check is because get_subexpression_at_offset uses | |||
// base_type_eq, whereas in the context of a simplifier we should not | |||
// change the type of the expression. |
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'll note down a TODO on my end to remove that type equality check when enabling the simplifier type equality checks.
Assigning @kroening since it's his PR. CI failures expected for the time being. |
Note this targets the
type-equality
branch -- I think these changes should go in alongside it. The value-set fixup is functional; everything else is cosmetic.