[PATCH] D94094: [DDG] Fix duplicate edge removal during pi-block formation

Bardia Mahjour via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 5 08:36:37 PST 2021


bmahjour created this revision.
bmahjour added reviewers: Meinersbur, etiotto, Whitney.
bmahjour added a project: LLVM.
Herald added a subscriber: hiraditya.
bmahjour requested review of this revision.
Herald added a subscriber: llvm-commits.

I stumbled upon this issue while working on the graph printer. 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.

An example is provided in the unittest added in this revision.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94094

Files:
  llvm/lib/Analysis/DependenceGraphBuilder.cpp
  llvm/unittests/Analysis/DDGTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94094.314619.patch
Type: text/x-patch
Size: 12991 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210105/16d173de/attachment.bin>


More information about the llvm-commits mailing list