[PATCH] D62610: [DA] Add an option to control delinearization validity checks

Bardia via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 29 10:08:11 PDT 2019

bmahjour created this revision.
bmahjour added reviewers: Meinersbur, jdoerfert, kbarton, dmgreen.
bmahjour added a project: LLVM.
Herald added subscribers: llvm-commits, javed.absar, hiraditya.

Dependence Analysis performs static checks to confirm validity of delinearization. These checks often fail for 64-bit targets due to type conversions and integer wrapping that prevent simplification of the SCEV expressions. These checks would also fail at compile-time if the lower bound of the loops are compile-time unknown.

For example:

  void foo(int n, int m, int a[][m]) {
    for (int i = 0; i < n; ++i)
      for (int j = 0; j < m; ++j) {
        a[i][j] = a[i+1][j-2];
  opt -mem2reg -instcombine -indvars -loop-simplify -loop-rotate -inline -pass-remarks=.* -debug-pass=Arguments  -da-permissive-validity-checks=false k3.ll -analyze -da

will produce the following by default:

  da analyze - anti [* *|<]!

but will produce the following expected dependence vector if the validity checks are disabled:

  da analyze - consistent anti [1 -2]!

This revision will introduce a debug option that will leave the validity checks in place by default, but allow them to be turned off. New tests are added for cases where it cannot be proven at compile-time that the individual subscripts stay in-bound with respect to a particular dimension of an array. These tests enable the option to provide user guarantee that the subscripts do not over/under-flow into other dimensions, thereby producing more accurate dependence vectors.

For prior discussion on this topic, leading to this change, please see the following thread: http://lists.llvm.org/pipermail/llvm-dev/2019-May/132372.html




-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62610.201966.patch
Type: text/x-patch
Size: 12037 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190529/262b5bcc/attachment.bin>

More information about the llvm-commits mailing list