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

Remove unused 'external_buffers' member in Codegen_Xtensa #7466

Open
wants to merge 1 commit into
base: xtensa-codegen
Choose a base branch
from
Open
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: 1 addition & 8 deletions src/CodeGen_Xtensa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -786,9 +786,6 @@ void CodeGen_Xtensa::visit(const Load *op) {
native_lanes = bytes_in_vector / 2;
}
bool is_aligned_load = (op->alignment.modulus % native_lanes == 0) && (op->alignment.remainder % native_lanes == 0);
if (external_buffers.count(op->name) > 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, this seems like it was a legit bug. I think if (external_buffers.count(op->name) > 0) should be replaced by if (op->param.defined()) .

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yikes, ok, lets hold off on this PR -- I'll let you choose how to clean this up, you are much closer to this code than I

is_aligned_load = is_aligned_load && (op->param.host_alignment() % bytes_in_vector == 0);
}
if (is_aligned_load) {
op_name = "aligned_load";
} else {
Expand All @@ -811,7 +808,7 @@ void CodeGen_Xtensa::visit(const Load *op) {
// } else {
string id_index = print_expr(op->index);
// Is not allocated on the heap and is not a buffer
bool is_tcm = !(heap_allocations.contains(name) || external_buffers.count(op->name) > 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here and below.

bool is_tcm = !heap_allocations.contains(name);

rhs << "gather_load<" << print_type(t) << ", "
<< print_type(Int(32, t.lanes())) << ", "
Expand Down Expand Up @@ -938,10 +935,6 @@ void CodeGen_Xtensa::visit(const Store *op) {
}

bool is_aligned_store = (op->alignment.modulus % native_lanes == 0) && (op->alignment.remainder % native_lanes == 0);
if (external_buffers.count(op->name) > 0) {
is_aligned_store = is_aligned_store && (op->param.host_alignment() % bytes_in_vector == 0);
}

if (is_aligned_store) {
op_name = "aligned_store";
} else {
Expand Down
3 changes: 0 additions & 3 deletions src/CodeGen_Xtensa.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ class CodeGen_Xtensa : public CodeGen_C {
int current_loop_level = 0;
std::vector<std::string> global_static_allocations;

// TODO: this appears to be unused; we read from it but never write to it?
std::set<std::string> external_buffers;

template<typename T>
bool is_native_xtensa_vector(halide_type_t op_type) const {
constexpr halide_type_t cpp_type = halide_type_of<T>();
Expand Down