@@ -1879,15 +1879,6 @@ module IteratorFlow {
1879
1879
phi .definesAt ( sv , bb2 , i2 , _)
1880
1880
)
1881
1881
}
1882
-
1883
- cached
1884
- Node getAPriorDefinition ( IteratorSsa:: DefinitionExt next ) {
1885
- exists ( IRBlock bb , int i , SourceVariable sv , IteratorSsa:: DefinitionExt def |
1886
- IteratorSsa:: lastRefRedefExt ( pragma [ only_bind_into ] ( def ) , pragma [ only_bind_into ] ( sv ) ,
1887
- pragma [ only_bind_into ] ( bb ) , pragma [ only_bind_into ] ( i ) , next ) and
1888
- nodeToDefOrUse ( result , sv , bb , i , _)
1889
- )
1890
- }
1891
1882
}
1892
1883
1893
1884
/** The set of nodes necessary for iterator flow. */
@@ -1912,25 +1903,19 @@ module IteratorFlow {
1912
1903
1913
1904
private import IteratorSsaCached
1914
1905
1915
- private predicate defToNode ( Node node , Def def , boolean uncertain ) {
1916
- (
1917
- nodeHasOperand ( node , def .getValue ( ) .asOperand ( ) , def .getIndirectionIndex ( ) )
1918
- or
1919
- nodeHasInstruction ( node , def .getValue ( ) .asInstruction ( ) , def .getIndirectionIndex ( ) )
1920
- ) and
1921
- uncertain = false
1906
+ private predicate defToNode ( Node node , Def def ) {
1907
+ nodeHasOperand ( node , def .getValue ( ) .asOperand ( ) , def .getIndirectionIndex ( ) )
1908
+ or
1909
+ nodeHasInstruction ( node , def .getValue ( ) .asInstruction ( ) , def .getIndirectionIndex ( ) )
1922
1910
}
1923
1911
1924
- private predicate nodeToDefOrUse (
1925
- Node node , SourceVariable sv , IRBlock bb , int i , boolean uncertain
1926
- ) {
1912
+ private predicate nodeToDefOrUse ( Node node , SourceVariable sv , IRBlock bb , int i ) {
1927
1913
exists ( Def def |
1928
1914
def .hasIndexInBlock ( bb , i , sv ) and
1929
- defToNode ( node , def , uncertain )
1915
+ defToNode ( node , def )
1930
1916
)
1931
1917
or
1932
- useToNode ( bb , i , sv , node ) and
1933
- uncertain = false
1918
+ useToNode ( bb , i , sv , node )
1934
1919
}
1935
1920
1936
1921
private predicate useToNode ( IRBlock bb , int i , SourceVariable sv , Node nodeTo ) {
@@ -1949,21 +1934,10 @@ module IteratorFlow {
1949
1934
* Holds if `nodeFrom` flows to `nodeTo` in a single step.
1950
1935
*/
1951
1936
predicate localFlowStep ( Node nodeFrom , Node nodeTo ) {
1952
- exists (
1953
- Node nFrom , SourceVariable sv , IRBlock bb1 , int i1 , IRBlock bb2 , int i2 , boolean uncertain
1954
- |
1937
+ exists ( SourceVariable sv , IRBlock bb1 , int i1 , IRBlock bb2 , int i2 |
1955
1938
adjacentDefRead ( bb1 , i1 , sv , bb2 , i2 ) and
1956
- nodeToDefOrUse ( nFrom , sv , bb1 , i1 , uncertain ) and
1939
+ nodeToDefOrUse ( nodeFrom , sv , bb1 , i1 ) and
1957
1940
useToNode ( bb2 , i2 , sv , nodeTo )
1958
- |
1959
- if uncertain = true
1960
- then
1961
- nodeFrom =
1962
- [
1963
- nFrom ,
1964
- getAPriorDefinition ( any ( IteratorSsa:: DefinitionExt next | next .definesAt ( sv , bb1 , i1 , _) ) )
1965
- ]
1966
- else nFrom = nodeFrom
1967
1941
)
1968
1942
}
1969
1943
}
0 commit comments