Skip to content

Conversation

@katrinafyi
Copy link
Member

compared to obasil, changes the phi block syntax to use square brackets to avoid ambiguity with simulassign statement.

see src/test/scala/ir/ParserTest.scala to learn the effect of phi blocks and named call params. these get lowered into sbasil simul assigns and unnamed params.

@katrinafyi
Copy link
Member Author

ci failing is definitely a line ending problem

@agle
Copy link
Contributor

agle commented Jan 22, 2026

compared to obasil, changes the phi block syntax to use square brackets to avoid ambiguity with simulassign statement.

I would prefer round brackets, square brackets are used to give the impression of a sequence of nonatomic operations, phis don't have evaluation order etc it seems odd, the phi list is semantically the same as a simulassign and i wanted the syntax to point to that.

Instead the ambiguity could be fixed by moving the phi list before the block's statement list, this gives the impression of block parameters which I don't hate.

assign
}

simulAssign.assignments :+= (phiVar -> predVar)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@katrinafyi
Copy link
Member Author

katrinafyi commented Jan 22, 2026

you want this? any suggestions for the indentation?

  block %inputs2
  (
    var R29:bv64 := phi(%inputs -> R29_in:bv64, %inputs2 -> R30_in:bv64),
  )
  [
    goto (%inputs);
  ];

or maybe

  block %inputs2 [
    phi( R29:bv64 := ( %inputs -> R29_in:bv64, %inputs2 -> R30_in:bv64 ) );
    goto (%inputs);
  ];

@agle
Copy link
Contributor

agle commented Jan 22, 2026

The first option, indentation can be the same as it already is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants