Skip to content

Commit

Permalink
Fix two warnings found with clang 16 (halide#6918)
Browse files Browse the repository at this point in the history
- variable 'count' set but not used
- warning: use of bitwise '|' with boolean operands
  • Loading branch information
steven-johnson authored and ardier committed Mar 3, 2024
1 parent 7c2e5d5 commit 3ffba7b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions src/Derivative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,6 @@ void ReverseAccumulationVisitor::propagate_adjoints(
update_args, i);
}

int count = 0;
// Traverse the expressions in reverse order
for (auto it = expr_list.rbegin(); it != expr_list.rend(); it++) {
if (it->type().is_handle()) {
Expand All @@ -749,7 +748,6 @@ void ReverseAccumulationVisitor::propagate_adjoints(
}
// Propagate adjoints
it->accept(this);
count++;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/FuseGPUThreadLoops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@ class ExtractRegisterAllocations : public IRMutator {

Stmt rewrap(Stmt body, const string &loop_var) {
for (RegisterAllocation &alloc : allocations) {
if ((!loop_var.empty() && ends_with(alloc.loop_var, loop_var)) |
if ((!loop_var.empty() && ends_with(alloc.loop_var, loop_var)) ||
(loop_var.empty() && alloc.loop_var.empty())) {
body = Allocate::make(alloc.name, alloc.type, alloc.memory_type, {alloc.size}, const_true(), body);
}
Expand Down

0 comments on commit 3ffba7b

Please sign in to comment.