Juan C Rodriguez
Juan C Rodriguez
Actually, the `opt_loop_invariant` considers only full expressions, it is not working on subexpressions, for instance, the code: ```r while (i < n) { i
Actually, the `opt_loop_invariant` does not consider `if/else` expressions to move. In this sense, the code: ```r while (i < n) { if (n > 3) { something_without_i } } ```...
Eliminate all those variables that are assigned, read or not, but that do not affect the value returned by the function. For example: ```r foo
For example, when `opt_constant_propagation` finds a function call, it deletes the previously found constant-assigned values. This is mainly done to avoid having ```r x
The R parser has left associativity, so `x + 10 + 200` is `((x + 10) + 200)`. So this is not being folded to `x + 210`. If we...
For example: fold `0 * x` to `0` However, this could change code semantics, in the second case, if x does not exist then the code would not throw an...
If the optimizer knows which functions modify their parent env, then function calls won’t abort optimization.
This can have an issue if the common function call returns random values. For example: ```r a
Dead Expression Elimination is optimizing the code: ```r code
The `opt_dead_code` optimizer could also implement empty if/else and loops eliminations. For instance: ```r if (condition) { } else { some_code } while (condition) { } ``` Could be optimized...