Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More fixes for removing duplicated edges and wrong edges.
1. A thread may attempt to parse an address for edges multiple times when there are overlapping instructions. Handle this case to ensure that each address is parsed for edges once. This fix remove duplicated edges. 2. Fix moving edges during block split, which caused wrong edges. The block split during parsing and the consistent block split during finalizing should use the same algorithm described below: * We move outgoing edges from block A to block B, which is * necessary when spliting blocks. * The start of block B should be consistent with block A. * There are three cases: * * Case 1: the end of A and B are the same * A : [ ] * B : [ ] * In such case, we can directly move the edges from A to B * * Case 2: block A contains block B * A : [ ] * B : [ ] * edge_b : [] * In this case, the outgoing edges of A should not be moved to B. * Instead, we need to follow the fallthrough edge of B to find a * block (edge_b), which ends at same location as A. We then move * outgoing edges of A to edge_b. * Case 3: End of A is smaller than the end of B * A : [ ] * B : [ ] * In this case, the outgoing edges of A should only contain a * fallthrough edge (otherwise, B's end will the same as A). * We remove this fall through edge for now and we will add the * edge back in finalizing. * The same algorithm description is also documented in function Parser::move_edges_consistent_blocks(Block *A, Block *B) in parseAPI/src/Parser.C
- Loading branch information
Showing
3 changed files
with
151 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters