Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify the meaning of Shuffle::is_broadcast() #8158

Merged
merged 3 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/IR.h
Original file line number Diff line number Diff line change
Expand Up @@ -877,11 +877,10 @@ struct Shuffle : public ExprNode<Shuffle> {
* arguments. */
bool is_interleave() const;

/** Check if this shuffle can be represented as a broadcast.
* For example:
* A uint8 shuffle of with 4*n lanes and indices:
* 0, 1, 2, 3, 0, 1, 2, 3, ....., 0, 1, 2, 3
* can be represented as a uint32 broadcast with n lanes (factor = 4). */
/** Check if this shuffle can be represented as a repeating pattern that
* repeats the same shuffle of the single input vector some number of times.
* For example: 0, 3, 1, 1, 0, 3, 1, 1, ....., 0, 3, 1, 1
*/
bool is_broadcast() const;
int broadcast_factor() const;

Expand Down
4 changes: 0 additions & 4 deletions src/IRPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1084,10 +1084,6 @@ void IRPrinter::visit(const Shuffle *op) {
<< ", " << op->slice_stride()
<< ", " << op->indices.size()
<< ")";
} else if (op->is_broadcast()) {
stream << "broadcast(";
print_list(op->vectors);
stream << ", " << op->broadcast_factor() << ")";
} else {
stream << "shuffle(";
print_list(op->vectors);
Expand Down
Loading