Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4 |
|
#
e0447961 |
| 27-Oct-2022 |
Jannik Silvanus <jannik.silvanus@amd.com> |
[llvm-diff] Fix false-positive diffs on forward-referencing phi nodes
When a phi node references a variable defined in a basic block dominated by the the basic block containing the phi node, llvm-di
[llvm-diff] Fix false-positive diffs on forward-referencing phi nodes
When a phi node references a variable defined in a basic block dominated by the the basic block containing the phi node, llvm-diff currently cannot determine whether the variable is equivalent, and thus treats the phi node as different and reports a difference. This leads to false positive differences as demonstrated by the loop.ll diff, for which llvm-diff reports a diff when comparing the file with itself.
Fix that issue by adding the concept of *equivalence assumptions*. When encountering a pair of values which can neither be proven to be equivalent nor to be non-equivalent, instead optimistically assume equivalence, and store somewhere that the equivalence of the currently compared basic blocks depends on this assumption.
Later, once all BBs have been processed, check all made assumptions and report blocks as different whose equivalence was depending on an incorrect assumption, or an assumption we could not prove to be correct.
In order to preserve the original diff report order, also schedule diffs of blocks already known to be different using the same mechanism, so all block diffs are now generated at the very end of function diffing.
In case an incorrect assumption was made, all further shown equivalences between old and new values implictly depend on the incorrect assumption. Some of these may in fact be not equivalent, but these are neither reverted nor reported, because they are considered indirect diffs caused by an earlier direct diff.
See inline comments for an argument why we do not run into issues caused by circular proof dependencies.
Differential Revision: https://reviews.llvm.org/D137318
show more ...
|
#
91351377 |
| 02-Nov-2022 |
Jannik Silvanus <jannik.silvanus@amd.com> |
[llvm-diff] Precommit: Add loop test case with forward reference
Diffing phi nodes was recently added to llvm-diff. However, there currently is a limitation where equivalent values cannot be detecte
[llvm-diff] Precommit: Add loop test case with forward reference
Diffing phi nodes was recently added to llvm-diff. However, there currently is a limitation where equivalent values cannot be detected as such, leading to false positive diff reports.
If a phi node refers a value defined in a basic block dominated by the current basic block, for example a phi node in a loop header referring a value defined in the loop body, we cannot prove equivalence of the referred values, because the basic block containing the variable definition has not yet been processed.
This commit adds a test case showing this behavior, serving as a precommit for an upcoming fix of the above.
Differential Revision: https://reviews.llvm.org/D137262
show more ...
|