From e8273f0e0d210522a449b384b9c01d16d9d9155f Mon Sep 17 00:00:00 2001 From: Sergi Siso Date: Mon, 13 Jan 2025 10:27:30 +0000 Subject: [PATCH] #2704 Update changelog and documentation --- changelog | 3 +++ doc/developer_guide/dependency.rst | 6 +++--- .../tools/definition_use_chains_backward_dependence_test.py | 4 ---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/changelog b/changelog index 8fb6369f5e..fe5ec70972 100644 --- a/changelog +++ b/changelog @@ -29,6 +29,9 @@ 10) PR #2810. Adds caching of the fparser2 parse tree to FileInfo. Is disabled by default. + 11) PR #2814 for #2704. Adds backward accesses capabilities to the + DefinitionUseChain tool. + release 3.0.0 6th of December 2024 1) PR #2477 for #2463. Add support for Fortran Namelist statements. diff --git a/doc/developer_guide/dependency.rst b/doc/developer_guide/dependency.rst index e110aef8d3..b4974f6a9d 100644 --- a/doc/developer_guide/dependency.rst +++ b/doc/developer_guide/dependency.rst @@ -666,12 +666,12 @@ can be parallelised: DefinitionUseChain ================== PSyclone also provides a DefinitionUseChain class, which can search for forward -dependencies (backward NYI) for a given Reference inside a region of code. This +and backward dependencies for a given Reference inside a region of code. This implementation differs from the DependencyTools as it is control-flow aware, so can find many dependencies for a single Reference in a given Routine or scope. -This is primarily used to implement the `References.next_accesses` function, but can be -used directly as follows: +This is primarily used to implement the `Reference.next_accesses` and +`Reference.previous_accessess` functions, but can be used directly as follows: .. code:: diff --git a/src/psyclone/tests/psyir/tools/definition_use_chains_backward_dependence_test.py b/src/psyclone/tests/psyir/tools/definition_use_chains_backward_dependence_test.py index 3240775768..bafc2c92c8 100644 --- a/src/psyclone/tests/psyir/tools/definition_use_chains_backward_dependence_test.py +++ b/src/psyclone/tests/psyir/tools/definition_use_chains_backward_dependence_test.py @@ -253,9 +253,6 @@ def test_definition_use_chain_find_backward_accesses_loop_example( # Second a = A + i # Third (?) is A = a + i # Last is A = 1 - print(reaches[0].parent.debug_string()) - print(reaches[1].parent.debug_string()) - print(reaches[2].parent.debug_string()) assert len(reaches) == 4 assert ( reaches[0] is routine.children[1].loop_body.children[1].rhs.children[0] @@ -460,7 +457,6 @@ def test_definition_use_chain_find_backward_accesses_codeblock_and_call_cflow( chains = DefinitionUseChain(routine.children[2].rhs.children[0]) reaches = chains.find_backward_accesses() assert len(reaches) == 2 - print([x.parent.debug_string() for x in reaches]) assert reaches[0] is routine.children[1].if_body.children[1].children[1] assert reaches[1] is routine.children[0]