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

Commit 83f59f3

Browse files
Merge pull request #544 from facebookresearch/pr/clean-up
clean up isSupportedReduction
2 parents 4823738 + 3220819 commit 83f59f3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tc/core/polyhedral/reduction_matcher.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,8 @@ namespace {
3939
bool isSupportedReduction(Halide::Internal::Stmt stmt) {
4040
auto provide = stmt.as<Halide::Internal::Provide>();
4141
auto call = provide->values[0].as<Halide::Internal::Call>();
42-
if (call && call->args[0].as<Halide::Internal::Add>()) {
43-
return true;
44-
}
45-
return false;
42+
return call && call->args.size() > 0 &&
43+
call->args[0].as<Halide::Internal::Add>();
4644
}
4745

4846
// TODO: the function currently available in Scop only works _after_ inserting

0 commit comments

Comments
 (0)