From 772498dc684cef556928a6ce53f4d6b026b43a5d Mon Sep 17 00:00:00 2001 From: Roman Gareev Date: Wed, 8 Feb 2017 13:29:06 +0000 Subject: [PATCH] [NFC] Make ScheduleTreeOptimizer::optimizeBand return a schedule node optimized with optimizeMatMulPattern This patch makes ScheduleTreeOptimizer::optimizeBand return a schedule node optimized with optimizeMatMulPattern. Otherwise, it could not use the isolate option, because standardBandOpts could try to tile a band node with anchored subtree and get the error, since the use of the isolate option causes any tree containing the node to be considered anchored. Furthermore, it is not intended to apply standard optimizations, when the matrix multiplication has been detected. llvm-svn: 294444 --- polly/lib/Transform/ScheduleOptimizer.cpp | 2 +- polly/test/ScheduleOptimizer/mat_mul_pattern_data_layout_2.ll | 2 -- polly/test/ScheduleOptimizer/pattern-matching-based-opts_3.ll | 4 ---- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/polly/lib/Transform/ScheduleOptimizer.cpp b/polly/lib/Transform/ScheduleOptimizer.cpp index cb0a8edbf9cc..d0027b104fa5 100644 --- a/polly/lib/Transform/ScheduleOptimizer.cpp +++ b/polly/lib/Transform/ScheduleOptimizer.cpp @@ -1179,7 +1179,7 @@ ScheduleTreeOptimizer::optimizeBand(__isl_take isl_schedule_node *Node, MatMulInfoTy MMI; if (PMBasedOpts && User && isMatrMultPattern(Node, OAI->D, MMI)) { DEBUG(dbgs() << "The matrix multiplication pattern was detected\n"); - Node = optimizeMatMulPattern(Node, OAI->TTI, MMI); + return optimizeMatMulPattern(Node, OAI->TTI, MMI); } return standardBandOpts(Node, User); diff --git a/polly/test/ScheduleOptimizer/mat_mul_pattern_data_layout_2.ll b/polly/test/ScheduleOptimizer/mat_mul_pattern_data_layout_2.ll index 62d9feb1d314..a78e8b6621df 100644 --- a/polly/test/ScheduleOptimizer/mat_mul_pattern_data_layout_2.ll +++ b/polly/test/ScheduleOptimizer/mat_mul_pattern_data_layout_2.ll @@ -42,8 +42,6 @@ ; CHECK-NEXT: for (int c4 = 0; c4 <= 23; c4 += 1) ; CHECK-NEXT: for (int c5 = 0; c5 <= min(255, -256 * c1 + 1022); c5 += 1) { ; CHECK-NEXT: // Register tiling - Points -; CHECK-NEXT: // 1st level tiling - Tiles -; CHECK-NEXT: // 1st level tiling - Points ; CHECK-NEXT: { ; CHECK-NEXT: Stmt_Copy_0(96 * c2 + 4 * c4, 8 * c3, 256 * c1 + c5); ; CHECK-NEXT: Stmt_Copy_0(96 * c2 + 4 * c4, 8 * c3 + 1, 256 * c1 + c5); diff --git a/polly/test/ScheduleOptimizer/pattern-matching-based-opts_3.ll b/polly/test/ScheduleOptimizer/pattern-matching-based-opts_3.ll index 0f9edf5b4428..a605508c9b28 100644 --- a/polly/test/ScheduleOptimizer/pattern-matching-based-opts_3.ll +++ b/polly/test/ScheduleOptimizer/pattern-matching-based-opts_3.ll @@ -38,8 +38,6 @@ ; CHECK-NEXT: for (int c1 = 0; c1 <= 263; c1 += 1) ; CHECK-NEXT: for (int c2 = 0; c2 <= 1023; c2 += 1) { ; CHECK-NEXT: // Register tiling - Points -; CHECK-NEXT: // 1st level tiling - Tiles -; CHECK-NEXT: // 1st level tiling - Points ; CHECK-NEXT: { ; CHECK-NEXT: Stmt_Copy_0(4 * c1, 8 * c0, c2); ; CHECK-NEXT: Stmt_Copy_0(4 * c1, 8 * c0 + 1, c2); @@ -101,8 +99,6 @@ ; EXTRACTION-OF-MACRO-KERNEL-NEXT: for (int c4 = 0; c4 <= 23; c4 += 1) ; EXTRACTION-OF-MACRO-KERNEL-NEXT: for (int c5 = 0; c5 <= 255; c5 += 1) { ; EXTRACTION-OF-MACRO-KERNEL-NEXT: // Register tiling - Points -; EXTRACTION-OF-MACRO-KERNEL-NEXT: // 1st level tiling - Tiles -; EXTRACTION-OF-MACRO-KERNEL-NEXT: // 1st level tiling - Points ; EXTRACTION-OF-MACRO-KERNEL-NEXT: { ; EXTRACTION-OF-MACRO-KERNEL-NEXT: Stmt_Copy_0(96 * c2 + 4 * c4, 8 * c3, 256 * c1 + c5); ; EXTRACTION-OF-MACRO-KERNEL-NEXT: Stmt_Copy_0(96 * c2 + 4 * c4, 8 * c3 + 1, 256 * c1 + c5);