Skip to content

Commit

Permalink
Merge pull request #22 from numba/update_README
Browse files Browse the repository at this point in the history
Update Readme
  • Loading branch information
kc611 authored Mar 27, 2023
2 parents 6d99391 + ddbaa30 commit c75b0d9
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ branch-restructuring.

```python
# Example: for loop with branch and early exit

from numba_rvsdg.rendering.rendering import render_func

def foo(n):
c = 0
for i in range(n):
Expand All @@ -82,17 +85,8 @@ def foo(n):
break
return c

flow = ByteFlow.from_bytecode(foo)
ByteFlowRenderer().render_byteflow(flow).view("initial")

cflow = flow._join_returns()
ByteFlowRenderer().render_byteflow(cflow).view("closed")

lflow = cflow._restructure_loop()
ByteFlowRenderer().render_byteflow(lflow).view("loop restructured")
render_func(foo)

bflow = lflow._restructure_branch()
ByteFlowRenderer().render_byteflow(bflow).view("branch restructured")
```

![initial](docs/images/initial.png "initial")
Expand Down
Binary file added docs/images/before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/branch_restructured.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/closed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/loop_restructured.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c75b0d9

Please sign in to comment.