Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit 381dc6c

Browse files
author
Sven Verdoolaege
committed
findReductions: extract out isReductionUpdate
This function will be reused in the next commit.
1 parent bc63ab4 commit 381dc6c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tc/core/halide2isl.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,14 @@ std::pair<isl::union_map, isl::union_map> extractAccesses(
334334
return {finder.reads, finder.writes};
335335
}
336336

337+
bool isReductionUpdate(const Provide* op) {
338+
if (const Call* call = op->values[0].as<Call>()) {
339+
return call->is_intrinsic(tc2halide::kReductionUpdate);
340+
} else {
341+
return false;
342+
}
343+
}
344+
337345
/*
338346
* Take a parametric expression "f" and convert it into an expression
339347
* on the iteration domains in "domain" by reinterpreting the parameters
@@ -488,14 +496,6 @@ std::vector<Reduction> findReductions(const Stmt& s) {
488496
class FindReductions : public IRVisitor {
489497
using IRVisitor::visit;
490498

491-
bool isReductionUpdate(const Provide* op) {
492-
if (const Call* call = op->values[0].as<Call>()) {
493-
return call->is_intrinsic(tc2halide::kReductionUpdate);
494-
} else {
495-
return false;
496-
}
497-
}
498-
499499
// Keep track of any reduction variable name for use in visit(Provide*)
500500
void visit(const Variable* op) {
501501
if (op->reduction_domain.defined()) {

0 commit comments

Comments
 (0)