[PATCH] D70986: [DDG] Data Dependence Graph - Ordinals

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 18 11:16:37 PST 2019


Meinersbur added a comment.

In D70986#1771710 <https://reviews.llvm.org/D70986#1771710>, @bmahjour wrote:

> The nodes in a pi-block cannot be topologically sorted since they form a cycle. The ordinals help us put them in their original program order so as to preserve correctness. For example consider this case:
>
>   for (int i = 0; i < n-1; i++) {
>     A[i] = B[i];
>     B[i+1] = A[i];
>   }
>   
>
> There will be a pi-block consisting of all load and stores in the loop, and they cannot be sorted in the order of data dependence. We do not want to inadvertently change it to:
>
>   for (int i = 0; i < n-1; i++) {
>     B[i+1] = A[i];
>     A[i] = B[i];
>   }
>   


What would cause the order of nodes in a pi-node to change? As it's not topologically sorted, wouldn't the order stay the order in which they were added to `NodeList`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70986/new/

https://reviews.llvm.org/D70986





More information about the llvm-commits mailing list