Go to file
Roman Gareev e0d466342b Restore the initial ordering of dimensions before applying the pattern matching
Dimensions of band nodes can be implicitly permuted by the algorithm applied
during the schedule generation.

For example, in case of the following matrix-matrix multiplication,

for (i = 0; i < 1024; i++)
  for (k = 0; k < 1024; k++)
    for (j = 0; j < 1024; j++)
      C[i][j] += A[i][k] * B[k][j];

it can produce the following schedule tree

domain: "{ Stmt_for_body6[i0, i1, i2] : 0 <= i0 <= 1023 and 0 <= i1 <= 1023 and
                                        0 <= i2 <= 1023 }"
child:
  schedule: "[{ Stmt_for_body6[i0, i1, i2] -> [(i0)] },
              { Stmt_for_body6[i0, i1, i2] -> [(i1)] },
              { Stmt_for_body6[i0, i1, i2] -> [(i2)] }]"
  permutable: 1
  coincident: [ 1, 1, 0 ]

The current implementation of the pattern matching optimizations relies on the
initial ordering of dimensions. Otherwise, it can produce the miscompilation
(e.g., [1]).

This patch helps to restore the initial ordering of dimensions by recreating
the band node when the corresponding conditions are satisfied.

Refs.:

[1] - https://bugs.llvm.org/show_bug.cgi?id=32500

Reviewed-by: Michael Kruse <llvm@meinersbur.de>

Differential Revision: https://reviews.llvm.org/D31741

llvm-svn: 299662
2017-04-06 17:09:54 +00:00
clang [analyzer] Reland r299544 "Add a modular constraint system to the CloneDetector" 2017-04-06 14:34:07 +00:00
clang-tools-extra [clang-tidy] Temporarily disable a test-case that does not work on windows. 2017-04-06 15:58:57 +00:00
compiler-rt [TSan] Adjust expectation for check_analyze.sh 2017-04-06 17:09:08 +00:00
debuginfo-tests
libclc math: Implement sinh function 2017-02-25 02:46:53 +00:00
libcxx Revert "Restore Missing awk regex tests. Thanks to dexonsmith for noticing, and proposing this as https://reviews.llvm.org/D16541" 2017-04-06 15:56:55 +00:00
libcxxabi Fix exception address alignment test for EHABI 2017-04-04 14:03:54 +00:00
libunwind AddressSpace: fix DWARF based unwinding handling on Android 2017-04-05 21:29:38 +00:00
lld Revert r299635 because it exposed a latent bug. 2017-04-06 15:22:58 +00:00
lldb Update unittests/Host/SocketTest.cpp to also use the new 2017-04-06 03:16:44 +00:00
llgo benchcomp: Add a mode for analyzing file sizes. 2017-04-03 19:13:12 +00:00
llvm [ADT] Add a generic breadth-first-search graph iterator. 2017-04-06 17:03:04 +00:00
openmp Test cancellation_for_sections.c expectedly fails on GCC 2017-04-04 14:39:52 +00:00
parallel-libs [Axccel] Remove -Wno-missing-braces in build 2016-12-19 21:34:07 +00:00
polly Restore the initial ordering of dimensions before applying the pattern matching 2017-04-06 17:09:54 +00:00