[DDG] Fix duplicate edge removal during pi-block formation
authorBardia Mahjour <bmahjour@ca.ibm.com>
Thu, 7 Jan 2021 15:31:11 +0000 (10:31 -0500)
committerBardia Mahjour <bmahjour@ca.ibm.com>
Thu, 7 Jan 2021 15:31:11 +0000 (10:31 -0500)
commitebfe4de2c04b09d3ae935325e6c02c68f2965b00
treecd8892a723469a1514542a26eb7f6b9c317f001c
parent6be1fd6b20f3418543a50ce9b04ab4a49585a7eb
[DDG] Fix duplicate edge removal during pi-block formation

When creating pi-blocks we try to avoid creating duplicate edges
between outside nodes and the pi-block when an edge is of the
same kind and direction as another one that has already been
created. We do this by keeping track of the edges in an
enumerated array called EdgeAlreadyCreated. The problem is that
this array is declared local to the loop that iterates over the
nodes in the pi-block, so the information gets lost every time a
new inside-node is iterated over. The fix is to move the
declaration to the outer loop.

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D94094
llvm/lib/Analysis/DependenceGraphBuilder.cpp
llvm/unittests/Analysis/DDGTest.cpp