Merge pull request #14588 from aschackmull/shared/rangeanalysis

C++/Java: Share core range analysis
This commit is contained in:
Mathias Vorreiter Pedersen
2023-10-26 16:32:46 +01:00
committed by GitHub
22 changed files with 1006 additions and 1132 deletions

View File

@@ -56,7 +56,7 @@
while (f3_get(n)) n+=2;
for (int i = 0; i < n; i += 2) {
range(i); // $ range=>=0 SPURIOUS: range="<=Phi: call to f3_get-1" range="<=Phi: call to f3_get-2"
range(i); // $ range=>=0 range="<=Phi: call to f3_get-2"
}
}
@@ -117,3 +117,16 @@ void test_sub(int x, int y, int n) {
}
}
}
void test_div(int x) {
if (3 <= x && x <= 7) {
range(x / 2); // $ range=>=1 range=<=3
range(x / 3); // $ range=>=1 range=<=2
range(x >> 2); // $ range=>=0 range=<=1
}
if (2 <= x && x <= 8) {
range(x / 2); // $ range=>=1 range=<=4
range(x / 3); // $ range=>=0 range=<=2
range(x >> 2); // $ range=>=0 range=<=2
}
}