Skip to content

Commit

Permalink
Add doc and missing load check
Browse files Browse the repository at this point in the history
  • Loading branch information
jwlawson committed Mar 11, 2021
1 parent 427ff33 commit 644af10
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/ExtractTileOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,15 @@ class ExtractTileOperations : public IRMutator {
return ProducerConsumer::make(amx_alloc, op->is_producer, body);
}

Expr visit(const Load* op) override {
if (op->name == tile_name) {
// Any tile load will be matched elsewhere, so a load here means that
// the AMX tile is used outside of a tile instruction.
is_valid = false;
}
return IRMutator::visit(op);
}

Stmt visit(const Store *op) override {
if (op->name != tile_name) {
const auto *load = op->value.as<Load>();
Expand Down
3 changes: 2 additions & 1 deletion src/ExtractTileOperations.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
namespace Halide {
namespace Internal {

/** TODO */
/** Rewrite any AMX tile operations that have been stored in the AMXTile memory
* type as intrinsic calls, to be used in the X86 backend. */
Stmt extract_tile_operations(const Stmt &s);

} // namespace Internal
Expand Down

0 comments on commit 644af10

Please sign in to comment.