Skip to content

Commit

Permalink
gpu: jit: conv: fix shuffle propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
echeresh committed Oct 31, 2022
1 parent caf4863 commit 90be8d5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gpu/jit/conv/ir_simplify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2073,14 +2073,15 @@ expr_t simplify_propagate_shuffle(const expr_t &e) {
bool found_binary = false;
for (int i : shuffle->idx) {
if (is_binary_op(shuffle->vec[i])) {
found_binary = true;
auto &op = shuffle->vec[i].as<binary_op_t>();
if (found_binary && op.op_kind != op_kind_t::_and) continue;
found_binary = true;
a_type = op.a.type();
b_type = op.b.type();
op_kind = op.op_kind;
if (is_const(op.a)) a_common_const = op.a;
if (is_const(op.b)) b_common_const = op.b;
break;
if (op_kind == op_kind_t::_and) break;
}
}
if (!found_binary) return e;
Expand Down

0 comments on commit 90be8d5

Please sign in to comment.