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

Commit 77de578

Browse files
author
Sven Verdoolaege
committed
reduction_matcher.cc: affInvolvesOnlyInputDim: drop explicit check on local vars
There is no need to check whether the local variables involve any input dimensions. This is implicit in the entire expression involving these input dimensions.
1 parent 4961247 commit 77de578

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

src/core/polyhedral/reduction_matcher.cc

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,6 @@ bool affInvolvesOnlyInputDim(isl::aff aff, int redDimIdx) {
8181

8282
bool hasPureDim = aff.involves_dims(isl::dim_type::in, redDimIdx, 1);
8383

84-
bool divsInvolveOtherDims = false;
85-
bool divsInvolveDim = false;
86-
for (int i = 0, ei = aff.dim(isl::dim_type::div); i < ei; ++i) {
87-
// Ignore divs with coefficient 0 that may be referred to by the aff.
88-
// This is particularly the case when we are already processing the div.
89-
if (aff.get_coefficient_val(isl::dim_type::div, i).is_zero()) {
90-
continue;
91-
}
92-
bool divR = affInvolvesOnlyInputDim(aff.get_div(i), redDimIdx);
93-
divsInvolveDim |=
94-
divR; // becomes true if at least one involves the given dim
95-
divsInvolveOtherDims |=
96-
!divR; // becomes true if at least one involves other dims
97-
}
98-
9984
bool involvesOtherDims = aff.involves_dims(isl::dim_type::in, 0, redDimIdx) ||
10085
aff.involves_dims(
10186
isl::dim_type::in,
@@ -105,10 +90,7 @@ bool affInvolvesOnlyInputDim(isl::aff aff, int redDimIdx) {
10590
if (involvesOtherDims) {
10691
return false;
10792
}
108-
if (!hasPureDim && !divsInvolveDim) {
109-
return false;
110-
}
111-
if (divsInvolveDim && divsInvolveOtherDims) {
93+
if (!hasPureDim) {
11294
return false;
11395
}
11496
return true;

0 commit comments

Comments
 (0)