Skip to content

Fix Data Dependency and Self-Loop Handling + Refactor Core Functions#28

Merged
DanielAugusto191 merged 17 commits intomainfrom
alg-bugfix
May 5, 2025
Merged

Fix Data Dependency and Self-Loop Handling + Refactor Core Functions#28
DanielAugusto191 merged 17 commits intomainfrom
alg-bugfix

Conversation

@Casperento
Copy link
Copy Markdown
Collaborator

@Casperento Casperento commented May 1, 2025

Summary

This PR addresses issues encountered while executing our pass in the LLVM Test Suite and includes several functional fixes and code refactorings.

Issues Fixed

  1. Incomplete Data and Control Dependencies
    The existing implementation in computeGates and get_data_dependences_for (in ProgramSlice.cpp) did not correctly account for all relevant edges and basic blocks when computing data and control dependencies.

    • Fix: Gates are now computed for all basic blocks, and this comprehensive information is used to derive accurate data dependencies.
  2. Incorrect Handling of Self-Loops
    In cases where a basic block has a self-loop (an edge to itself), its gating instruction (typically a branch) was being included in the outlined slice function, resulting in incorrect slices.

    • Fix: The gating instruction of a basic block is now excluded from dependency computation when it forms part of a self-loop.

Refactorings

  • Refactored the isSelfContained, canRemove and killSlice functions in daedalus.cpp to improve readability and maintainability.
  • New internal test called test4.c.

Additions

  • Introduced the getParentFunction getter to log the parent function during each iteration of function outlining.

@Casperento Casperento added the bug Something isn't working label May 1, 2025
@Casperento Casperento self-assigned this May 1, 2025
Copy link
Copy Markdown
Collaborator

@DanielAugusto191 DanielAugusto191 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@DanielAugusto191 DanielAugusto191 merged commit 109fee6 into main May 5, 2025
1 check passed
@DanielAugusto191 DanielAugusto191 deleted the alg-bugfix branch May 5, 2025 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants