The code to preserve LCSSA PHIs currently only properly supports
reduction PHIs and PHIs for values defined outside the latches.
This patch improves the LCSSA PHI handling to cover PHIs for values
defined in the latches.
Fixes PR41725.
Paths
| Differential D61576
[LoopInterchange] Fix handling of LCSSA nodes defined in headers and latches. ClosedPublic Authored by fhahn on May 5 2019, 2:35 PM.
Details Summary The code to preserve LCSSA PHIs currently only properly supports This patch improves the LCSSA PHI handling to cover PHIs for values Fixes PR41725.
Diff Detail
Event Timelinejdoerfert added inline comments.
Comment Actions Remove restriction for single use PHIs. We can replace such PHIs with their incoming fhahn added inline comments.
This revision is now accepted and ready to land.May 14 2019, 5:45 AM Closed by commit rL361743: [LoopInterchange] Fix handling of LCSSA nodes defined in headers and latches. (authored by fhahn). · Explain WhyMay 26 2019, 4:35 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 198204 llvm/lib/Transforms/Scalar/LoopInterchange.cpp
llvm/test/Transforms/LoopInterchange/perserve-lcssa.ll
|
This seems brittle. I don't know all the preconditions here but I imagine various situations where you might end up with multiple uses for escaping LCSSA phi nodes.
One might be two values escape which happen to be equal, in the inner exit block some optimization merges the two LCSSA phi nodes, in the outer that doesn't happen. Now we have one PHI in the inner exit and two uses in the outer exists. Does this make sense (without asserting we have a transformation like this right now)?