[PATCH] D36791: [Polly][Bug fix] Wrong dependences filtering during Fully Indexed expansion

Bonfante Nicolas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 16 06:52:36 PDT 2017


niosega created this revision.
Herald added a reviewer: bollu.

When trying to expand memory accesses, the current version of Polly uses statement Level dependences. The actual implementation is not working in case of multiple dependences per statement. For example in the following source code :

  void mse(double A[Ni], double B[Nj], double C[Nj], double D[Nj]) {
    int i,j;
    for (j = 0; j < Ni; j++) {
      for (int i = 0; i<Nj; i++)
  S:    B[i] = i;
      for (int i = 0; i<Nj; i++)
  T:    D[i] = i;
  
  U:  A[j] = B[j];
        C[j] = D[j];
    }
  }

The statement U has two dependences with S and T. The current version of polly fails during expansion.

This patch aims to fix this bug. For that, we use Reference Level dependences to be able to filter dependences according to statement and memory ref. The principle of expansion remains the same as before.

We also noticed that we need to bail out if load come after store (at the same position) in same statement. So a check was added to isExpandable.


https://reviews.llvm.org/D36791

Files:
  lib/Transform/MaximalStaticExpansion.cpp
  test/MaximalStaticExpansion/load_after_store_same_statement.ll
  test/MaximalStaticExpansion/working_expansion_multiple_dependences_per_statement.ll
  test/MaximalStaticExpansion/working_expansion_multiple_instruction_per_statement.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36791.111336.patch
Type: text/x-patch
Size: 21311 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170816/8d4dd951/attachment-0001.bin>


More information about the llvm-commits mailing list