https://llvm.org/bugs/show_bug.cgi?id=31867
Bug ID: 31867 Summary: InstCombine uselessly checks for irreducible phi cycles. Product: libraries Version: trunk Hardware: PC OS: All Status: NEW Severity: normal Priority: P Component: Scalar Optimizations Assignee: unassignedb...@nondot.org Reporter: dber...@dberlin.org CC: llvm-bugs@lists.llvm.org Classification: Unclassified InstCombinePhi has this code: // We sometimes end up with phi cycles that non-obviously end up being the // same value, for example: // z = some value; x = phi (y, z); y = phi (x, z) // where the phi nodes don't necessarily need to be in the same block. Do a // quick check to see if the PHI node only contains a single non-phi value, if // so, scan to see if the phi cycle is actually equal to that value. First, such code is impossible in minimal SSA. It should actually be impossible with the SSAUpdater too, since it generates minimal SSA. So i'm not sure what would generate it in the first place. I can't find a non-handmade testcase either. My suggestion would be to either make it a statistic, or remove it. Second, this is the ultra slow way of doing it. If it does minimize all cases, it does so non optimally (IE it is performed more than it needs to be). It's a bit hard to analyze to determine if it actually minimizes all cases. The algorithm to minimize these phis is precisely the phi minimization algorithm added to the new ssaupdater, which is an SCC algorithm that will minimize all phis in as short a time as possible. (it depends on the cycle depth. In the case given as an example above, it will be one pass). You can run this exactly once on the CFG, at the beginning or end of instcombine, and feel confident it is minimal ssa again. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs