Skip to content

Random question about the semantics of 'region' in CIR #978

Closed
@ChuanqiXu9

Description

@ChuanqiXu9

I know the concept of 'region' comes from MLIR directly. And I am developing #522 and the concept of 'region' in CIR makes me confusing about how to handle cases. Given this is not only limited to switch, I tried to open a new issue for this.

In my mind, a region is a group of blocks, where these blocks has a single entry and a single exit. And I am not sure if it is still true in CIR due to the existence of goto. I didn't see our handling of goto changes any region information. So if I didn't misunderstand, goto breaks the general semantics of 'region'. And I hope to get some input on this topic.

I feel the possible answers may be:

  1. The semantics of 'region' is the in the same page of the general form:
    a. then for 'goto':
    i. I missed some places and actually CIR handles it well.
    ii. We hope to fix the problem for goto some day.
    iii. goto is the devil and we don't know how to fix it. We will get what we get.
  2. The semantics of 'region' in CIR is different than the general meaning. And then what is the semantics? And how does that incorporate with goto?

CC: @Lancern @wenpen @gitoleg @bcardosolopes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions