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

Commit 31dad22

Browse files
Sven Verdoolaegeftynse
authored andcommitted
isReductionUpdateId: stop returning corresponding init statement
Since the previous commit, this information is no longer needed.
1 parent ceef5c3 commit 31dad22

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

tc/core/polyhedral/reduction_matcher.cc

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,10 @@ bool isSupportedReduction(Halide::Internal::Stmt stmt) {
4848
// the reduction. that is a kind of internal state dependence we want to avoid
4949
// If id is the statement identifier of an update statement
5050
// of a supported type of reduction,
51-
// then return the corresponding init statement in init and
52-
// the corresponding reduction dimensions in reductionDims.
51+
// then return the corresponding reduction dimensions in reductionDims.
5352
bool isReductionUpdateId(
5453
isl::id id,
5554
const Scop& scop,
56-
Halide::Internal::Stmt& init,
5755
std::vector<size_t>& reductionDims) {
5856
CHECK_EQ(scop.halide.statements.count(id), 1u)
5957
<< "id is not a statement in scop" << id;
@@ -63,7 +61,6 @@ bool isReductionUpdateId(
6361
}
6462
for (auto const& iup : scop.halide.reductions) {
6563
if (iup.update.same_as(provideNode)) {
66-
init = iup.init;
6764
reductionDims = iup.dims;
6865
return true;
6966
}
@@ -104,9 +101,8 @@ bool isAlmostIdentityReduction(isl::pw_aff pa, const Scop& scop) {
104101
return false;
105102
}
106103
auto stmtId = space.get_tuple_id(isl::dim_type::in);
107-
Halide::Internal::Stmt init;
108104
std::vector<size_t> reductionDims;
109-
if (!isReductionUpdateId(stmtId, scop, init, reductionDims)) {
105+
if (!isReductionUpdateId(stmtId, scop, reductionDims)) {
110106
return false;
111107
}
112108

@@ -124,9 +120,8 @@ isl::union_set reductionUpdates(isl::union_set domain, const Scop& scop) {
124120
auto update = isl::union_set::empty(domain.get_space());
125121
domain.foreach_set([&update, &scop](isl::set set) {
126122
auto setId = set.get_tuple_id();
127-
Halide::Internal::Stmt initStmt;
128123
std::vector<size_t> reductionDims;
129-
if (isReductionUpdateId(setId, scop, initStmt, reductionDims)) {
124+
if (isReductionUpdateId(setId, scop, reductionDims)) {
130125
update = update.unite(set);
131126
}
132127
});

0 commit comments

Comments
 (0)