diff --git a/src/poly/tiling_analyzer.cc b/src/poly/tiling_analyzer.cc index eb33c8a18bf8144f4a73b9aa9ce132a287fc9e0a..1eb5aad1a69a8db0606c1976ed93157f04bbc185 100644 --- a/src/poly/tiling_analyzer.cc +++ b/src/poly/tiling_analyzer.cc @@ -444,12 +444,10 @@ int64_t TileCandidate::CalActualTile(const CalAlignInfo *align_info) { void TileCandidate::UpdateMemoryAfterBuffer(const BufferEntry *buf, MemInferInfo *mem_infer_info) { CHECK(buf); CHECK(mem_infer_info); - CHECK(buf); const auto fix_size = buf->shape.as(); if (fix_size == nullptr) { std::stringstream ss; ss << "Buffer " << buf->name << " contains dynamic shape " << buf->shape << ", skip."; - analyzer_->logger_.AppendLog(DO_TILING, ss); return; } diff --git a/src/poly/tiling_solver.cc b/src/poly/tiling_solver.cc index fa3680fa19b88966795787ce4c8d4c3e0f8ac118..a30542d94005dd5ec21982d849a27a86128f8f06 100644 --- a/src/poly/tiling_solver.cc +++ b/src/poly/tiling_solver.cc @@ -936,16 +936,17 @@ bool TraverseSolver::DoTiling(const TileInfo *info) { if (!mem_ok) continue; success = true; - if (dst % t == 0) { + auto tail = dst % t; + if (tail == 0) { if (deviation > best_no_iso_devs) continue; ss << "factor " << t << " has " << deviation << " deviation, update to no isolate factor"; best_no_iso_val = t; best_no_iso_devs = deviation; } else { if (deviation > best_devs) continue; - if (analyzer_.scop_->pragma_allow_tail_tiling_) { - auto tail = dst - dst / t * t; - if (tail % GetMaxAlignBytes(axis->data_size) != 0) continue; + if (analyzer_.scop_->pragma_allow_tail_tiling_ && tail < GetMaxAlignBytes(axis->data_size)) { + ss << "factor " << t << " has " << tail << " tail that may disable multicore, skip."; + continue; } ss << "factor " << t << " has " << deviation << " deviation, update to isolate factor"; best_val = t;