Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LVI] Don't traverse uses when calculating range at use
This effectively reverts 5c38c6a and 4f772b0. A recently introduced LazyValueInfo::getConstantRangeAtUse returns incorrect ranges for values in certain cases. One such example is described in PR60629. The issue has something to do with traversing PHI uses of a value transitively. As nikic pointed out, we're effectively reasoning about values from different loop iterations. In the faulting test case, CVP made a miscompilation because the calculated range for a shift argument was incorrect. It returned empty-set, however it is clearly not a dead code. CVP then erased the shift instruction because of empty range.
- Loading branch information
Showing
3 changed files
with
33 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters