Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CIR][CodeGen] Flattening for ScopeOp and LoopOpInterface #546

Merged
merged 7 commits into from
Apr 17, 2024

Conversation

gitoleg
Copy link
Collaborator

@gitoleg gitoleg commented Apr 16, 2024

This PR is the next step towards goto support and adds flattening for ScopeOp and LoopOpInterface.

Looks like I can't separate this operations and create two PRs, since some errors occur if I do so, e.g. reference to block defined in another region. Seems we need to flatten both operations in the same time. Given it's a copy-pasta, I think there is no need to try to make several PRs.

I added several tests - just copied them from the lowering part just to demonstrate how it looks like.

Note, that changes in dot.cir caused by BrCondOp updates in the previous PR, when we removed the following casts:

    %20 = llvm.zext %19 : i1 to i8
    %21 = llvm.trunc %20 : i8 to i1
    llvm.cond_br %21 ...

Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

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

Awesome, LGTM

@gitoleg gitoleg force-pushed the scope-n-loop-flattening branch from 12f174c to aefdb23 Compare April 17, 2024 13:53
@gitoleg
Copy link
Collaborator Author

gitoleg commented Apr 17, 2024

@bcardosolopes rebased!

@bcardosolopes bcardosolopes merged commit 63098a9 into llvm:main Apr 17, 2024
6 checks passed
@gitoleg gitoleg mentioned this pull request Apr 26, 2024
lanza pushed a commit that referenced this pull request Apr 29, 2024
This PR is the next step towards goto support and adds flattening for
`ScopeOp` and `LoopOpInterface`.

Looks like I can't separate this operations and create two PRs, since
some errors occur if I do so, e.g. `reference to block defined in
another region`. Seems we need to flatten both operations in the same
time. Given it's a copy-pasta, I think there is no need to try to make
several PRs.

I added several tests - just copied them from the lowering part just to
demonstrate how it looks like.

Note, that changes in `dot.cir` caused by `BrCondOp` updates in the
previous PR, when we removed the following casts:
```
    %20 = llvm.zext %19 : i1 to i8
    %21 = llvm.trunc %20 : i8 to i1
    llvm.cond_br %21 ...
```
lanza pushed a commit that referenced this pull request Apr 29, 2024
This PR is the next step towards goto support and adds flattening for
`ScopeOp` and `LoopOpInterface`.

Looks like I can't separate this operations and create two PRs, since
some errors occur if I do so, e.g. `reference to block defined in
another region`. Seems we need to flatten both operations in the same
time. Given it's a copy-pasta, I think there is no need to try to make
several PRs.

I added several tests - just copied them from the lowering part just to
demonstrate how it looks like.

Note, that changes in `dot.cir` caused by `BrCondOp` updates in the
previous PR, when we removed the following casts:
```
    %20 = llvm.zext %19 : i1 to i8
    %21 = llvm.trunc %20 : i8 to i1
    llvm.cond_br %21 ...
```
lanza pushed a commit that referenced this pull request Apr 29, 2024
This PR is the next step towards goto support and adds flattening for
`ScopeOp` and `LoopOpInterface`.

Looks like I can't separate this operations and create two PRs, since
some errors occur if I do so, e.g. `reference to block defined in
another region`. Seems we need to flatten both operations in the same
time. Given it's a copy-pasta, I think there is no need to try to make
several PRs.

I added several tests - just copied them from the lowering part just to
demonstrate how it looks like.

Note, that changes in `dot.cir` caused by `BrCondOp` updates in the
previous PR, when we removed the following casts:
```
    %20 = llvm.zext %19 : i1 to i8
    %21 = llvm.trunc %20 : i8 to i1
    llvm.cond_br %21 ...
```
bruteforceboy pushed a commit to bruteforceboy/clangir that referenced this pull request Oct 2, 2024
This PR is the next step towards goto support and adds flattening for
`ScopeOp` and `LoopOpInterface`.

Looks like I can't separate this operations and create two PRs, since
some errors occur if I do so, e.g. `reference to block defined in
another region`. Seems we need to flatten both operations in the same
time. Given it's a copy-pasta, I think there is no need to try to make
several PRs.

I added several tests - just copied them from the lowering part just to
demonstrate how it looks like.

Note, that changes in `dot.cir` caused by `BrCondOp` updates in the
previous PR, when we removed the following casts:
```
    %20 = llvm.zext %19 : i1 to i8
    %21 = llvm.trunc %20 : i8 to i1
    llvm.cond_br %21 ...
```
Hugobros3 pushed a commit to shady-gang/clangir that referenced this pull request Oct 2, 2024
This PR is the next step towards goto support and adds flattening for
`ScopeOp` and `LoopOpInterface`.

Looks like I can't separate this operations and create two PRs, since
some errors occur if I do so, e.g. `reference to block defined in
another region`. Seems we need to flatten both operations in the same
time. Given it's a copy-pasta, I think there is no need to try to make
several PRs.

I added several tests - just copied them from the lowering part just to
demonstrate how it looks like.

Note, that changes in `dot.cir` caused by `BrCondOp` updates in the
previous PR, when we removed the following casts:
```
    %20 = llvm.zext %19 : i1 to i8
    %21 = llvm.trunc %20 : i8 to i1
    llvm.cond_br %21 ...
```
keryell pushed a commit to keryell/clangir that referenced this pull request Oct 19, 2024
This PR is the next step towards goto support and adds flattening for
`ScopeOp` and `LoopOpInterface`.

Looks like I can't separate this operations and create two PRs, since
some errors occur if I do so, e.g. `reference to block defined in
another region`. Seems we need to flatten both operations in the same
time. Given it's a copy-pasta, I think there is no need to try to make
several PRs.

I added several tests - just copied them from the lowering part just to
demonstrate how it looks like.

Note, that changes in `dot.cir` caused by `BrCondOp` updates in the
previous PR, when we removed the following casts:
```
    %20 = llvm.zext %19 : i1 to i8
    %21 = llvm.trunc %20 : i8 to i1
    llvm.cond_br %21 ...
```
lanza pushed a commit that referenced this pull request Nov 5, 2024
This PR is the next step towards goto support and adds flattening for
`ScopeOp` and `LoopOpInterface`.

Looks like I can't separate this operations and create two PRs, since
some errors occur if I do so, e.g. `reference to block defined in
another region`. Seems we need to flatten both operations in the same
time. Given it's a copy-pasta, I think there is no need to try to make
several PRs.

I added several tests - just copied them from the lowering part just to
demonstrate how it looks like.

Note, that changes in `dot.cir` caused by `BrCondOp` updates in the
previous PR, when we removed the following casts:
```
    %20 = llvm.zext %19 : i1 to i8
    %21 = llvm.trunc %20 : i8 to i1
    llvm.cond_br %21 ...
```
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.

2 participants