-
Notifications
You must be signed in to change notification settings - Fork 5
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
Multiple loop unrolling passes? #34
Comments
Does it work if you apply the loop_unroll decorator twice? That could probably unblock you. |
Yep, that worked. Thanks for the help! |
Lets keep this open because I think It would be useful to think about how we want marcros to evaluate. @cdonovick @leonardt, thoughts? |
Yeah macro evaluation order is tricky. One possible solution is that the |
@leonardt @phanrahan @willcrichton Thoughts? |
Something like this, where macro1 and macro2 would keep getting applied until it converges?
|
Is there a reason in the first place why the user has to write |
If you still need precise control over the order of passes, then you could also do something like @loop_inline('a')
def foo():
for x in name('a', range(0)):
... This is in the same vein of how Pyro deals with random variables in its Python-embedded probabilistic programming language. |
That's an interesting thought @willcrichton , I think the use of decorators for the pass was mainly as an entry point to the function as well as ordering as you mentioned. The use of the But, it seems like we could have a generic (p.s. I think this is the do_macros pass that caleb suggested, it also seems reasonable to provide the passes you'd like to run, however, it could be that one pass depends on another pass, which in this case the user would need to know these dependencies, where if we could somehow automatically infer them via tree inspection, the user could simply include the top level macro/passes that they'd like to use and the dependent passes would be managed implicitly) |
@willcrichton * currently only supports iterators which yield |
@leonardt I think we should think about pass ordering and infrastructure for managing it. We already have some dependencies Maybe we could describe the types of AST nodes that a pass operates on and the type nodes that pass eliminates, and type of nodes that a pass can't except, and from these constraints generate an ordering? For example |
I can comment that in LLVM, you manually specify other passes as dependencies for the current pass. This is not quite the same as what you want though. Not sure about the "if you want to run this other pass, it needs to be run before current pass" |
I think in most compilers, |
I was wondering if its possible to support multiple passes of loop unrolling.
This is the type of nested loop I want to unroll:
Currently, this code produces:
While it would be helpful if it could unroll it again to:
Its possible to do what I want using the if_inline but, as you can imagine, the code gets very long if you have large loops:
The text was updated successfully, but these errors were encountered: