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

Commit 1361815

Browse files
author
Sven Verdoolaege
committed
reduction_matcher.cc: affInvolvesOnlyInputDim: simplify code
1 parent 77de578 commit 1361815

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/core/polyhedral/reduction_matcher.cc

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,18 @@ bool isReductionUpdateId(
7979
bool affInvolvesOnlyInputDim(isl::aff aff, int redDimIdx) {
8080
auto space = aff.get_space();
8181

82-
bool hasPureDim = aff.involves_dims(isl::dim_type::in, redDimIdx, 1);
82+
if (!aff.involves_dims(isl::dim_type::in, redDimIdx, 1)) {
83+
return false;
84+
}
8385

84-
bool involvesOtherDims = aff.involves_dims(isl::dim_type::in, 0, redDimIdx) ||
86+
if (aff.involves_dims(isl::dim_type::in, 0, redDimIdx) ||
8587
aff.involves_dims(
8688
isl::dim_type::in,
8789
redDimIdx + 1,
88-
space.dim(isl::dim_type::in) - redDimIdx - 1);
89-
90-
if (involvesOtherDims) {
91-
return false;
92-
}
93-
if (!hasPureDim) {
90+
space.dim(isl::dim_type::in) - redDimIdx - 1)) {
9491
return false;
9592
}
93+
9694
return true;
9795
}
9896

0 commit comments

Comments
 (0)