Definition Use chains have some confusing implementation when looking backwards at the RHS of an assignment.

Open
#3,552 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Refactor
Clarity
Needs clarification
Activity status
Quiet
Tech stack
fortran, python
Domain
compilers

Research direction

Start with the Definition Use Chains implementation and the discussion in PR #3492, then inspect the corresponding handling for UnsupportedTypes. Use the existing dependency tests, especially those involving loops, to understand the current results and confirm that the revised code or comments explain RHS handling without changing dependencies.

Written by the indexing model from the issue text.

Description

In #3492 It has become apparent that some of the code in the Definition Use Chains is not understood (particularly since the changes to handle multiple inputs), and the comments don't really explain what is happening (see https://github.com/stfc/PSyclone/pull/3492#discussion_r3756885980). It would be good to look at improving either the code or comments that explain this, and also the corresponding section for UnsupportedTypes.

Removing this code entirely is not an option, as many of the tests (mostly involving loops) start finding the wrong dependencies at that point, but the way it behaves means (in particular) the order of results for loops is confusing (to me).

This is all a fun side effect of the tree order meaning searching backwards doesn't automatically find the RHS of an assignment when looking backwards from the LHS, so there are likely a few separate parts of the code that handle the RHS, and the code in question may just avoid duplication of adding the RHS to the code. If so this is not a problem, but it needs to be explained properly in the code.

Dominant language
Python
Stars
137
Forks
36
Avg merge
6d 16h
Merged PRs (30d)
18

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stfc/PSyclone

All issues in stfc/PSyclone

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.