mirror of
https://github.com/intel/llvm.git
synced 2026-01-14 20:10:50 +08:00
Do not scale tile loops
We now generate tile loops as:
for (int c1 = 0; c1 <= 47; c1 += 1)
for (int c2 = 0; c2 <= 47; c2 += 1)
for (int c3 = 0; c3 <= 31; c3 += 1)
for (int c4 = 0; c4 <= 31; c4 += 4)
#pragma simd
for (int c5 = c4; c5 <= c4 + 3; c5 += 1)
Stmt_for_body3(32 * c1 + c3, 32 * c2 + c5);
instead of
for (int c1 = 0; c1 <= 1535; c1 += 32)
for (int c2 = 0; c2 <= 1535; c2 += 32)
for (int c3 = 0; c3 <= 31; c3 += 1)
for (int c4 = 0; c4 <= 31; c4 += 4)
#pragma simd
for (int c5 = c4; c5 <= c4 + 3; c5 += 1)
Stmt_for_body3(c1 + c3, c2 + c5);
Run-time performance-wise this makes little difference, but this gives a large
reduction in compile time (10-30% on 17 LNT benchmarks). Apparently the isl
AST generator is not yet very efficient in generating the latter.
llvm-svn: 233675
This commit is contained in:
@@ -431,6 +431,7 @@ bool IslScheduleOptimizer::runOnScop(Scop &S) {
|
||||
isl_options_set_schedule_maximize_band_depth(S.getIslCtx(), IslMaximizeBands);
|
||||
isl_options_set_schedule_max_constant_term(S.getIslCtx(), MaxConstantTerm);
|
||||
isl_options_set_schedule_max_coefficient(S.getIslCtx(), MaxCoefficient);
|
||||
isl_options_set_tile_scale_tile_loops(S.getIslCtx(), 0);
|
||||
|
||||
isl_options_set_on_error(S.getIslCtx(), ISL_ON_ERROR_CONTINUE);
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
; RUN: opt %loadPolly -polly-detect-unprofitable -polly-opt-isl -analyze -polly-no-tiling=0 -polly-ast -polly-tile-sizes=1,64 < %s | FileCheck %s
|
||||
|
||||
; CHECK: for (int c0 = 0; c0 <= 1023; c0 += 1)
|
||||
; CHECK: for (int c1 = 0; c1 <= 511; c1 += 64)
|
||||
; CHECK: for (int c1 = 0; c1 <= 7; c1 += 1)
|
||||
; CHECK: for (int c3 = 0; c3 <= 63; c3 += 1)
|
||||
; CHECK: Stmt_for_body3(c0, c1 + c3);
|
||||
; CHECK: Stmt_for_body3(c0, 64 * c1 + c3);
|
||||
|
||||
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
; RUN: opt %loadPolly -polly-detect-unprofitable -polly-opt-isl -analyze -polly-no-tiling=0 -polly-ast -polly-tile-sizes=64,1 < %s | FileCheck %s
|
||||
|
||||
; CHECK: for (int c0 = 0; c0 <= 1023; c0 += 64)
|
||||
; CHECK: for (int c0 = 0; c0 <= 15; c0 += 1)
|
||||
; CHECK: for (int c1 = 0; c1 <= 511; c1 += 1)
|
||||
; CHECK: for (int c2 = 0; c2 <= 63; c2 += 1)
|
||||
; CHECK: Stmt_for_body3(c0 + c2, c1);
|
||||
; CHECK: Stmt_for_body3(64 * c0 + c2, c1);
|
||||
|
||||
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
|
||||
|
||||
|
||||
@@ -56,23 +56,23 @@ for.end30: ; preds = %for.inc28
|
||||
attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
|
||||
|
||||
; CHECK: #pragma known-parallel
|
||||
; CHECK: for (int c1 = 0; c1 <= 1535; c1 += 32)
|
||||
; CHECK: for (int c2 = 0; c2 <= 1535; c2 += 32)
|
||||
; CHECK: for (int c1 = 0; c1 <= 47; c1 += 1)
|
||||
; CHECK: for (int c2 = 0; c2 <= 47; c2 += 1)
|
||||
; CHECK: for (int c3 = 0; c3 <= 31; c3 += 1)
|
||||
; CHECK: for (int c4 = 0; c4 <= 31; c4 += 4)
|
||||
; CHECK: #pragma simd
|
||||
; CHECK: for (int c5 = c4; c5 <= c4 + 3; c5 += 1)
|
||||
; CHECK: Stmt_for_body3(c1 + c3, c2 + c5);
|
||||
; CHECK: Stmt_for_body3(32 * c1 + c3, 32 * c2 + c5);
|
||||
; CHECK: #pragma known-parallel
|
||||
; CHECK: for (int c1 = 0; c1 <= 1535; c1 += 32)
|
||||
; CHECK: for (int c2 = 0; c2 <= 1535; c2 += 32)
|
||||
; CHECK: for (int c3 = 0; c3 <= 1535; c3 += 32)
|
||||
; CHECK: for (int c1 = 0; c1 <= 47; c1 += 1)
|
||||
; CHECK: for (int c2 = 0; c2 <= 47; c2 += 1)
|
||||
; CHECK: for (int c3 = 0; c3 <= 47; c3 += 1)
|
||||
; CHECK: for (int c4 = 0; c4 <= 31; c4 += 1)
|
||||
; CHECK: for (int c5 = 0; c5 <= 31; c5 += 4)
|
||||
; CHECK: for (int c6 = 0; c6 <= 31; c6 += 1)
|
||||
; CHECK: #pragma simd
|
||||
; CHECK: for (int c7 = c5; c7 <= c5 + 3; c7 += 1)
|
||||
; CHECK: Stmt_for_body8(c1 + c4, c2 + c7, c3 + c6);
|
||||
; CHECK: Stmt_for_body8(32 * c1 + c4, 32 * c2 + c7, 32 * c3 + c6);
|
||||
|
||||
!llvm.ident = !{!0}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
; RUN: opt %loadPolly -polly-detect-unprofitable -polly-opt-isl -analyze -polly-no-tiling=0 -polly-ast -polly-tile-sizes=256,16 < %s | FileCheck %s
|
||||
|
||||
; CHECK: for (int c0 = 0; c0 <= 1023; c0 += 256)
|
||||
; CHECK: for (int c1 = 0; c1 <= 511; c1 += 16)
|
||||
; CHECK: for (int c0 = 0; c0 <= 3; c0 += 1)
|
||||
; CHECK: for (int c1 = 0; c1 <= 31; c1 += 1)
|
||||
; CHECK: for (int c2 = 0; c2 <= 255; c2 += 1)
|
||||
; CHECK: for (int c3 = 0; c3 <= 15; c3 += 1)
|
||||
; CHECK: Stmt_for_body3(c0 + c2, c1 + c3);
|
||||
; CHECK: Stmt_for_body3(256 * c0 + c2, 16 * c1 + c3);
|
||||
|
||||
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user