Support simple loop control-related operation fuse.#94
Support simple loop control-related operation fuse.#94ShangkunLi wants to merge 1 commit intocoredac:mainfrom
Conversation
|
Plz show before and after on the region of interest (i.e., the fused part) of the IRs in the PR's description. Thanks~! |
Updated~ |
|
The |
This pass cannot be applied to For For For this pass, I only support the loop structures generated by polygeist. |
For the So, we are urgently needing the register support. |
lol, i am on it #95. However, the issue is that after applying it, the
|
Hmm, I may read through your implementation ASAP and try to find out the problem. |
Yes, plz #59 |
After reading the mapping II, the problem comes from that the operands of the |
|
@ShangkunLi right, i already have a pending issue for you: #96 :-) |
|
What does And I don't get why there are still ctrl_mov after fusion, can you help briefly explain following by providing the equivalent C++: |
The source There are two reasons why we still have
|
If that's the case, shouldn't there be |
|
And I am thinking the design of |
| // RUN: --insert-data-mov \ | ||
| // RUN: --map-to-accelerator="mapping-strategy=heuristic" | FileCheck %s -check-prefix=CTRLFUSE-MAPPING | ||
|
|
||
| module attributes {} { |
There was a problem hiding this comment.
Plz add the equivalent C++ code here as comment, thanks~!
There was a problem hiding this comment.
Rename to simple_loop.mlir.
I think we can embed all the constant loop parameters as attributes in the And the newest version of For constant-based loops, we can embed all the constant values in the attributes. For other loops, we can use operands to denote the loop parameters. |
There was a problem hiding this comment.
Can we rename loop_controller to loop_control? All the other operations are verb
I doubt about this, let's discuss this later. Or plz give a simple example to elaborate. And I doubt whether we really need following constant attribute, the similar 3 operands are enough? |
Here is a simple loop with constant parameters: The main purpose of this And to eliminate such recurrence cycle, we have to trace until we reach the value of loop parameters. If we trace to And for nested non-constant loop parameters, we can avoid introducing more |
Is this eliminatable? I thought we can only eliminate I don't get "If we trace to constant (e.g., %6 for lower bound), we can not fuse constant with grant_once later. If we trace to grant_once, then we have to add grant_predicate ops for grant_once and ctrl_mov after each index increment; there will still be recurrence dependency." let's discuss this later or tmr. |
Hi~ Cheng, I revised the definition of WDYT? |
|
Hi @ShangkunLi, it looks better~ thanks for the refactor. I am still curious
|
Sorry, I forgot to add And please refer #100 directly. These two prs will be deprecated. |
|
And though |
|
Supported in #100 |
In this pr:
loop_controlleroperation to control loopsAs shown below, the recurrence II of 3 is caused by the loop reduction dependence and the
endvalue.The IR before control flow fuse:
The IR after control flow fuse:
endvalue