Skip to content
Snippets Groups Projects

Do not hoist declarations of mutated variables

Merged Daniel Bauer requested to merge hyteg/pystencils:bauerd/fix-hoisting into backend-rework

Declarations/initializations of non-constant variables must not be hoisted from loops because it changes the semantics of the code.

For example:

for (...) {
  int i = 0; // <- rhs is invariant but lhs is not
  for (...) {
    i += 1;
  }
}

Previously got falsly transformed to:

int i = 0;
for (...) {
  for (...) {
    i += 1;
  }
}

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply