Skip to content

Conversation

BobTheBuidler
Copy link
Contributor

We can't yet fold the expression itself, but we can fold its value expr

This PR implements folding for the value expr

We can't yet fold the expression itself, but we can fold its value expr This PR implements folding for the value expr

def transform_assignment_expr(builder: IRBuilder, o: AssignmentExpr) -> Value:
value = builder.accept(o.value)
value = try_constant_fold(builder, o.value) or builder.accept(o.value)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure if this has any effect. Can you show an example where this changes the generated IR? Constant folding should happen through builder.accept(...) already, and if it doesn't work, this is probably not the right place to do it.

@BobTheBuidler
Copy link
Contributor Author

agreed. I think I'll convert this to a draft until I have a chance to go thru the AssignmentExpr stuff with a magnifying glass and can fold the entire expr correctly

@BobTheBuidler BobTheBuidler marked this pull request as draft October 3, 2025 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants