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

Pipeline #65475 passed

Pipeline passed for f449abb7 on hyteg:bauerd/fix-hoisting

Checking approval status

Merged by Frederik HennigFrederik Hennig 11 months ago (Apr 29, 2024 6:48am UTC)

Loading

Pipeline #65504 passed

Pipeline passed for d0654625 on backend-rework

Activity

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