[PATCH] D26555: [LV] Keep predicated instructions in the same block

Gil Rapaport via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 15 15:17:50 PST 2016


gilr added a comment.

So committing to a single predicated block may be too aggressive at this point, for example in the following where the srem is moved into the predicated block and above the vectorized sub feeding it:

  void foo(int* a, int b, int* c, int* d) {
    for (int i = 0; i < 10000; ++i) {
      int x = 333;
      if (a[i] > 777) {
        int t1 = a[i] / c[i];
        int t2 = b - t1;
        x = t2 % d[i];
      }
      a[i] += x;
    }
  }

I'm not sure it would still serve the needs of the smarter-scalarization work, but as a standalone improvement to predication logic we can still try to combine predicated instructions into a mutual basic block wherever possible (e.g. reuse the last predicated basic block if possible, create a new one otherwise).


https://reviews.llvm.org/D26555





More information about the llvm-commits mailing list