Add an Affine Loop Perfection Optimization Pass#264
Conversation
|
What is the benefit to perform this loop perfection? To enable counter? All looks can be perfected theoretically? Why |
00cd54c to
6192215
Compare
The benefit is for creating a counter chain. If we do not perform this loop perfection optimization, all the imperfect nested parts will be wrapped in a hyperblock and transformed by the neura logic. This may create long recurrence cycles and severely damage the performance.
Not all loops can be perfectized. For now, I reject the loop with the operation that produces Side-effect operations mean that the operations may change the program state. Any |
|
Can we add all the taskflow-related passes into the compiler ASAP, instead of only enabling them in opt? |
This pr enable an affine loop perfection pass. The logic is:
func::FuncOp(a loop band is a sequence of nested loops w/o sibling loops);affine.load,memref.load) and side-effecting code (affine.store,memref.store);loop index == lower boundloop index == upper bound - stepFor example:
Pure computation code:
Before transformation
After transformation
Side-Effecting Code:
Before transformation
After transformation