4 ms·
I believe this operates on values in something akin to registers, not expression trees. By the time you get to a place where one of these rules is relevant, the
by bastawhiz 2y ago
I believe this operates on values in something akin to registers, not expression trees. By the time you get to a place where one of these rules is relevant, the side effect has already taken place. This just prevents the return of such a function call to be operated on, like in your example.
- cfbolztereick 2y agoYeah, that's exactly right. It's operating on an SSA-based intermediate representation. So if an operation gets removed, the arguments are still being computed. The earlier operations that produce those arguments can also be removed by dead code elimination (which runs later), but indeed only if they have no side effects. I suppose the notation of the rule heads makes it look like there actually are expression trees, which is maybe sort of confusing.