Reapply "Look through invertible recurrences in isKnownNonEqual"
I'd reverted this in commit 3b6acb17 due to buildbot failures. This patch contains the fix for said issue. I'd forgotten to handle the case where two phis in the same block have different operand order. We canonicalize away from this, but it's still valid IR. The tests included in this change (as opposed to simply having test output changed), crashed without the fix. Original commit message follows... This extends the phi handling in isKnownNonEqual with a special case based on invertible recurrences. If we can prove the recurrence is invertible (which many common ones are), we can recurse through the start operands of the recurrence skipping the phi cycle. (Side note: Instcombine currently does not push back through these cases. I will implement that in a follow up change w/separate review.) Differential Revision: https://reviews.llvm.org/D99912
Loading
Please sign in to comment