This patch changes LoopFlattenPass from FunctionPass to LoopNestPass.
Utilize LoopNest and let function 'Flatten' generate information from it.
Differential D102904
[LoopNest][LoopFlatten] Change LoopFlattenPass to LoopNest pass eopXD on May 21 2021, 12:53 AM. Authored by
Details This patch changes LoopFlattenPass from FunctionPass to LoopNestPass. Utilize LoopNest and let function 'Flatten' generate information from it.
Diff Detail
Event TimelineComment Actions D99149 ended up needing to use the LPMUpdater as the loops may be removed. Does the same thing need to be done here? As loop flattening does inherently remove loops. Comment Actions
Loop flattening aims to remove the inner loop of a nested loop, Thank you for spotting out the problem. Comment Actions added LPMUpdater for loop removal,
Comment Actions
I think I have misused revisitCurrentLoop here, the loop don't need to be revisited again, @dmgreen Comment Actions
Comment Actions OK. So because we only delete the inner loop, not the current one, the loop nest pass remains valid? That sounds Ok then. I think the changes from UnrollAndJam were found with a sanitizer build, so it might be worth testing it with one of those (or letting the buildbots do it post-commit, and keeping an eye one them to make sure they remain OK).
Comment Actions
I think for a LoopNestPass (or a LoopPass), the LPMUpdater is necessary parameter.
Comment Actions
I've deleted the parts for loop simplification and form LCSSA inside function Flatten, I've just commented out the 3 passes and the tests still passed when I added -enable-new-pm=0 (using the legacy pass). Comment Actions Remove declaration of LoopUnrollAndJam as a FunctionPass. Previously I resolved the merge conflict incorrecly. |
Please undo this no newline change.