Skip to content

phi nodes must be in block header #18

@mnikander

Description

@mnikander
  • check that phi nodes appear only at the start of the block, with no other instructions before it (except the block label)
  • decision documented
  • ensure that when there are multiple phi nodes in a block, they do not bind the result of another phi node
  • decision documented

This simplifies the static analysis, since phi nodes must only consider the incoming edges, and never the instructions in the block
Open question: should a phi node be allowed to mention a variable defined by a phi-node in the same block?

x = phi ...
y = phi x ...

I think the answer should be NO, since there is no incoming edge, with which a phi-bound value in the current block can be associated. That breaks the "if I came form here then take this value, if I came from there then take the other value" semantics of the phi node.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions