Skip to content

flow dead if-statement optimization #106

@christianparpart

Description

@christianparpart

PLEASE NOTE Assuming that the expression of an if-condition is side-effect free (add this property to Flow to allow optimizations based on this)?

Given the following test handler:

handler main {
  foo;
  if (expression) { }
  else { }
  bar;
}

currently translates to:

handler main {
  foo;
  expression;
  bar;
}

but should translate to:

handler main {
  foo;
  bar;
}

the trueBlock and falseBlock get eliminated already but not the conditional expression itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions