Skip to content
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
2 changes: 2 additions & 0 deletions src/cpp/common/assembler_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class assembler_state : public std::enable_shared_from_this<assembler_state>
std::vector<std::string> m_labellist;
std::map<std::string, std::vector<std::string>> m_dependent_labelmap;
std::set<std::string> m_opt_opcodes;
bool m_is_save_restore_op = false; // True when currently serializing a save/restore op
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

warning: member variable 'm_is_save_restore_op' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]

  bool m_is_save_restore_op = false;  // True when currently serializing a save/restore op
       ^

inline std::string gen_label_name(bool makeunique, const std::shared_ptr<asm_data> data)
{
return makeunique ? data->get_file() + ":" + data->get_operation()->get_name() : data->get_operation()->get_name();
Expand Down Expand Up @@ -159,6 +160,7 @@ class assembler_state : public std::enable_shared_from_this<assembler_state>
std::map<uint32_t, std::string>& m_ctrlpkt_id_map;

HEADER_ACCESS_GET_SET(offset_type, pos);
HEADER_ACCESS_GET_SET(bool, is_save_restore_op);

void printstate() const;

Expand Down
40 changes: 16 additions & 24 deletions src/cpp/encoder/aie2ps/aie2ps_encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,6 @@

namespace aiebu {

void
aie2ps_encoder::
fill_scratchpad(std::shared_ptr<section_writer> padwriter, const std::map<std::string, std::shared_ptr<scratchpad_info>>& scratchpads)
{
for (const auto& pad : scratchpads)
{
const auto& content = pad.second->get_content();
if (content.size())
{
assert((void("Pad content size and size doesnt match\n"), content.size() == pad.second->get_size()));
padwriter->write_bytes(content);
} else {
auto size = pad.second->get_size();
std::vector<uint8_t> zeros(size, 0x00);
padwriter->write_bytes(zeros);
}
}
}

void
aie2ps_encoder::
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The fill_scratchpad function implementation has been removed, but its declaration still exists in aie2ps_encoder.h (line 41). This will cause linker errors if the function is ever called. Since the function is no longer used and scratchpad sections are no longer being written (see removed code at lines 55-58 in the old version), the declaration should also be removed from the header file.

Suggested change
aie2ps_encoder::
aie2ps_encoder::
fill_scratchpad(std::shared_ptr<section_writer> scratchpadwriter,
const std::vector<char>& scratchpad)
{
scratchpadwriter->write_bytes(scratchpad);
}
void
aie2ps_encoder::

Copilot uses AI. Check for mistakes.
Expand Down Expand Up @@ -66,16 +48,10 @@ process(std::shared_ptr<preprocessed_output> input)

// for each colnum encode each page
for (const auto& coldata: totalcoldata) {
auto colnum = coldata.first;
for (auto& lpage : coldata.second->m_pages)
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The variable colnum is extracted from coldata.first but is no longer used after the removal of the scratchpad writing code. This creates an unused variable warning. Consider removing this variable declaration.

Copilot uses AI. Check for mistakes.
page_writer(lpage, coldata.second->m_scratchpad, coldata.second->m_labelpageindex,
ctrlpkt_id_map, optimizatiom_level);

if (coldata.second->m_scratchpad.size()) {
auto padwriter = std::make_shared<section_writer>(get_PadSectionName(colnum), code_section::data);
fill_scratchpad(padwriter, coldata.second->m_scratchpad);
twriter.push_back(padwriter);
}

for (const auto& pair : ctrlpkt_id_map) {
auto ctrlpktwriter = std::make_shared<section_writer>(pair.second, code_section::data);
Expand Down Expand Up @@ -180,6 +156,7 @@ page_writer(page& lpage, std::map<std::string, std::shared_ptr<scratchpad_info>>
if (text->isOpcode())
{
page_state->set_pos(textwriter->tell() - offset);
page_state->set_is_save_restore_op(text->get_is_save_restore()); // Track if this is save/restore op
std::vector<uint8_t> ret = (*m_isa)[name]->serializer(text->get_operation()->get_args())
->serialize(page_state, tsym, colnum, pagenum);
textwriter->write_bytes(ret);
Expand Down Expand Up @@ -218,6 +195,15 @@ page_writer(page& lpage, std::map<std::string, std::shared_ptr<scratchpad_info>>
for (auto& arg : spad.second)
{
offset = page_state->parse_num_arg(arg);
// Log patch information
log_info() << "Patching scratchpad: label=" << spad.first
<< ", arg=" << arg
<< ", offset=" << offset
<< ", base=" << page_state->m_scratchpad[spad.first.substr(1)]->get_base()
<< ", offset=" << page_state->m_scratchpad[spad.first.substr(1)]->get_offset()
<< ", patch=" << (page_state->m_scratchpad[spad.first.substr(1)]->get_base() +
page_state->m_scratchpad[spad.first.substr(1)]->get_offset())
<< std::endl;
patch57(textwriter, datawriter, offset + static_cast<offset_type>(page_header.size()),
page_state->m_scratchpad[spad.first.substr(1)]->get_base() + page_state->m_scratchpad[spad.first.substr(1)]->get_offset());
}
Expand All @@ -243,6 +229,12 @@ patch57(const std::shared_ptr<section_writer> textwriter, std::shared_ptr<sectio
uint64_t bd2 = datawriter->read_word(offset + 2*4); // NOLINT
uint64_t bd8 = datawriter->read_word(offset + 8*4); // NOLINT
uint64_t arg = ((bd8 & 0x1FF) << 48) + ((bd2 & 0xFFFF) << 32) + (bd1 & 0xFFFFFFFF); // NOLINT
// Add log for debugging patching
log_info() << "aie2ps_encoder::patch57: offset=" << offset
<< ", patch=0x" << std::hex << patch
<< ", arg=0x" << std::hex << arg
<< ", after patch=0x" << std::hex << patch + arg
<< std::dec << std::endl;
Comment on lines +233 to +237
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

log_info() in patch57 will execute for every patch operation and can produce very large logs and runtime overhead. Consider lowering to a debug/trace level and/or gating behind a runtime flag to keep normal runs quiet and efficient.

Suggested change
log_info() << "aie2ps_encoder::patch57: offset=" << offset
<< ", patch=0x" << std::hex << patch
<< ", arg=0x" << std::hex << arg
<< ", after patch=0x" << std::hex << patch + arg
<< std::dec << std::endl;
log_debug() << "aie2ps_encoder::patch57: offset=" << offset
<< ", patch=0x" << std::hex << patch
<< ", arg=0x" << std::hex << arg
<< ", after patch=0x" << std::hex << patch + arg
<< std::dec << std::endl;

Copilot uses AI. Check for mistakes.
Comment on lines +232 to +237
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

Debug logging statements are being added to production code. These log statements should either be removed before merging or wrapped in a debug flag/conditional compilation to avoid performance impact in production builds.

Suggested change
// Add log for debugging patching
log_info() << "aie2ps_encoder::patch57: offset=" << offset
<< ", patch=0x" << std::hex << patch
<< ", arg=0x" << std::hex << arg
<< ", after patch=0x" << std::hex << patch + arg
<< std::dec << std::endl;
// Add log for debugging patching
#ifndef NDEBUG
log_info() << "aie2ps_encoder::patch57: offset=" << offset
<< ", patch=0x" << std::hex << patch
<< ", arg=0x" << std::hex << arg
<< ", after patch=0x" << std::hex << patch + arg
<< std::dec << std::endl;
#endif

Copilot uses AI. Check for mistakes.
patch = arg + patch;
datawriter->write_word_at(offset + 1*4, patch & 0xFFFFFFFF); // NOLINT
datawriter->write_word_at(offset + 2*4, ((patch >> 32) & 0xFFFF) | (bd2 & 0xFFFF0000)); // NOLINT
Expand Down
8 changes: 8 additions & 0 deletions src/cpp/encoder/aie4/aie4_encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "writer.h"
#include "aie2ps_preprocessed_output.h"
#include "ops.h"
#include "common/logger.h"
#include "specification/aie2ps/isa.h"

namespace aiebu {
Expand Down Expand Up @@ -38,6 +39,13 @@ class aie4_encoder : public aie2ps_encoder
uint64_t bd0 = datawriter->read_word(offset);
uint64_t bd1 = datawriter->read_word(offset + 1*4); // NOLINT
uint64_t arg = (bd1 & 0xFFFFFFFF) + ((bd0 & 0x1FFFFFF) << 32); // NOLINT

// Add log for debugging patching
log_info() << "aie4_encoder::patch57: offset=" << offset
<< ", patch=0x" << std::hex << patch
<< ", arg=0x" << std::hex << arg
<< ", after patch=0x" << std::hex << patch + arg
<< std::dec << std::endl;
Comment on lines +43 to +48
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

Similar to the AIE2PS encoder, this unconditional info-level logging inside a patch routine is likely to be noisy and impact performance. Prefer debug-level logging and/or a feature flag to enable it only when troubleshooting.

Copilot uses AI. Check for mistakes.
patch = arg + patch;
datawriter->write_word_at(offset + 1*4, patch & 0xFFFFFFFF); // NOLINT
datawriter->write_word_at(offset, (((patch >> 32) & 0x1FFFFFF) | (bd0 & 0xFE000000))); // NOLINT
Expand Down
2 changes: 2 additions & 0 deletions src/cpp/ops/ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ serialize(std::shared_ptr<assembler_state> state, std::vector<symbol>& symbols,
{
if (state->m_ctrlpkt_id_map.find(val) != state->m_ctrlpkt_id_map.end())
sval = state->m_ctrlpkt_id_map[val];
else if (val == offset_type_marker && state->get_is_save_restore_op())
sval = "scratch-pad-mem"; // For save/restore routine, use "scratch-pad-mem" as arg name
else if (val == offset_type_marker)
sval = "control-code-" + std::to_string(colnum);

Expand Down
8 changes: 3 additions & 5 deletions src/cpp/preprocessor/aie2ps/aie2ps_preprocessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ class aie2ps_preprocessor: public preprocessor
toutput->set_ctrlpkt_id_map(ctrlpkt_id_map);
toutput->set_annotations(parser->get_annotations());

offset_type preemption_scratchpad = 0;
for (auto col: collist)
Comment on lines +130 to 131
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

preemption_scratchpad is initialized once before iterating columns, so skip-pad scratchpad offsets will accumulate across columns. If scratchpad offsets are intended to be per-column (matching how pad_size behaves), move/reset preemption_scratchpad inside the per-column loop; otherwise, add an explicit comment explaining why this is intentionally global across all columns.

Copilot uses AI. Check for mistakes.
{
std::vector<page> pages;
Comment on lines +130 to 133
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

The preemption_scratchpad offsets are not being aligned to 4 bytes (unlike pad_size), which can produce unaligned offsets for skip-pad scratchpads. Consider applying the same 4-byte rounding to preemption_scratchpad before assigning/incrementing, so patching/consumers that assume word alignment don’t break.

Copilot uses AI. Check for mistakes.
int relative_page_index = 0;
int pad_size = 0;
auto& label_page_index = parser->getcollabelpageindex(col);
auto& scratchpad = parser->getcolscratchpad(col);
auto& coldata = parser->get_col_asmdata(col);
Expand All @@ -148,10 +148,8 @@ class aie2ps_preprocessor: public preprocessor

for (auto& pad : scratchpad)
{
pad_size = (((pad_size + 3) >> 2) << 2); // round off to next multiple of 4
pad.second->set_offset(pad_size);
pad.second->set_base(PAGE_SIZE * relative_page_index);
pad_size += pad.second->get_size();
pad.second->set_offset(preemption_scratchpad);
preemption_scratchpad += pad.second->get_size();
}
Comment on lines 149 to 153
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

The preemption_scratchpad offsets are not being aligned to 4 bytes (unlike pad_size), which can produce unaligned offsets for skip-pad scratchpads. Consider applying the same 4-byte rounding to preemption_scratchpad before assigning/incrementing, so patching/consumers that assume word alignment don’t break.

Copilot uses AI. Check for mistakes.
Comment on lines 130 to 153
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The preemption scratchpad offset calculation has been changed from being per-column with a page-relative base to being global across all columns. This means scratchpad offsets are now accumulated across columns rather than being reset for each column. Verify this behavior is intentional - if multiple columns have scratchpads, they will now have increasing offsets rather than independent offsets. This could be correct if scratchpads are now shared across columns or allocated from a global pool.

Copilot uses AI. Check for mistakes.

toutput->set_coldata(col, pages, scratchpad, label_page_index, tinput->get_control_packet_index());
Expand Down
18 changes: 14 additions & 4 deletions src/cpp/preprocessor/asm/asm_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,15 @@ std::vector<uint32_t>
asm_parser::
get_col_list()
{
// get col list
// get col list (sorted order since unordered_map doesn't preserve insertion order)
std::vector<uint32_t> keys;

std::transform(
m_col.begin(),
m_col.end(),
std::back_inserter(keys),
[](const std::unordered_map<uint32_t, col_data>::value_type &pair){return pair.first;});
std::sort(keys.begin(), keys.end());
return keys;
}

Expand Down Expand Up @@ -223,7 +224,7 @@ parse_lines(const std::vector<char>& data, std::string& file)
} else
insert_col_asmdata(std::make_shared<asm_data>(std::make_shared<operation>(sm[1].str(), ""),
operation_type::label, code_section::unknown, 0,
(uint32_t)-1, linenumber, line, file));
(uint32_t)-1, linenumber, line, file, is_save_restore_routine()));
continue;
}
// check for operation
Expand Down Expand Up @@ -307,7 +308,7 @@ parse_lines(const std::vector<char>& data, std::string& file)

insert_col_asmdata(std::make_shared<asm_data>(std::make_shared<operation>(op_name, arg_str),
operation_type::op, code_section::unknown, 0, (uint32_t)-1,
linenumber, line, file));
linenumber, line, file, is_save_restore_routine()));
if (!op_name.compare("eof"))
set_data_state(true);
}
Expand Down Expand Up @@ -991,12 +992,14 @@ asm_parser::inject_hintmap_save_restore(int col,

m_current_col = col;
set_data_state(false);
set_save_restore_routine(true); // Mark as save/restore routine
parse_lines(save_chars, save_file_mod);
pop_data_state();

set_data_state(false);
parse_lines(restore_chars, restore_file_mod);
pop_data_state();
set_save_restore_routine(false); // Clear save/restore routine flag
}

// ---------------------------------------------------------------------------
Expand Down Expand Up @@ -1120,12 +1123,14 @@ asm_parser::inject_default_save_restore(int col,

m_current_col = col;
set_data_state(false);
set_save_restore_routine(true); // Mark as save/restore routine
parse_lines(save_chars, save_file_mod);
pop_data_state();

set_data_state(false);
parse_lines(restore_chars, restore_file_mod);
pop_data_state();
set_save_restore_routine(false); // Clear save/restore routine flag
}

// ---------------------------------------------------------------------------
Expand Down Expand Up @@ -1377,8 +1382,13 @@ operate(std::shared_ptr<asm_parser> parserptr, const smatch& sm)
m_parserptr = parserptr;
verify_match(sm, error::error_code::invalid_asm, ".setpad directive requires arguments\n");

std::vector<std::string> args = splitoption(sm[2].str().c_str(), ',');
// .setpad should only be part of save/restore routines
if (!m_parserptr->should_skip_setpad_in_save_restore()) {
log_warn() << "Warning: Directive \"" << sm[0].str() << "\" found outside save/restore routine for target: "
<< m_parserptr->get_target_type() << "\n";
}

std::vector<std::string> args = splitoption(sm[2].str().c_str(), ',');
add_scratchpad(args[0], args[1]);
}

Expand Down
22 changes: 20 additions & 2 deletions src/cpp/preprocessor/asm/asm_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,15 @@ class asm_data
std::string m_line;
std::string m_file;
int m_annotation_index = -1;
bool m_is_save_restore = false; // True if this instruction is from save/restore routine

public:
asm_data() = default;
asm_data(std::shared_ptr<operation> op, operation_type optype,
code_section sec, offset_type size, uint32_t pgnum,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

warning: 3 adjacent parameters of 'asm_data' of similar type are easily swapped by mistake [bugprone-easily-swappable-parameters]

           code_section sec, offset_type size, uint32_t pgnum,
                             ^
Additional context

src/cpp/preprocessor/asm/asm_parser.h:203: the first parameter in the range is 'size'

           code_section sec, offset_type size, uint32_t pgnum,
                                         ^

src/cpp/preprocessor/asm/asm_parser.h:204: the last parameter in the range is 'ln'

           uint32_t ln, std::string line, std::string file, bool is_save_restore = false)
                    ^

src/cpp/preprocessor/asm/asm_parser.h:203: after resolving type aliases, 'offset_type' and 'uint32_t' are the same

           code_section sec, offset_type size, uint32_t pgnum,
                             ^

uint32_t ln, std::string line, std::string file)
uint32_t ln, std::string line, std::string file, bool is_save_restore = false)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

warning: pass by value and use std::move [modernize-pass-by-value]

src/cpp/preprocessor/asm/asm_parser.h:202:

-             m_pagenum(pgnum), m_linenumber(ln), m_line(line), m_file(file), m_is_save_restore(is_save_restore) {}
+             m_pagenum(pgnum), m_linenumber(ln), m_line(line), m_file(std::move(file)), m_is_save_restore(is_save_restore) {}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

warning: pass by value and use std::move [modernize-pass-by-value]

src/cpp/preprocessor/asm/asm_parser.h:202:

-             m_pagenum(pgnum), m_linenumber(ln), m_line(line), m_file(file), m_is_save_restore(is_save_restore) {}
+             m_pagenum(pgnum), m_linenumber(ln), m_line(std::move(line)), m_file(file), m_is_save_restore(is_save_restore) {}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

warning: pass by value and use std::move [modernize-pass-by-value]

src/cpp/preprocessor/asm/asm_parser.h:206:

-             m_pagenum(pgnum), m_linenumber(ln), m_line(line), m_file(file), m_is_save_restore(is_save_restore) {}
+             m_pagenum(pgnum), m_linenumber(ln), m_line(line), m_file(std::move(file)), m_is_save_restore(is_save_restore) {}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

warning: pass by value and use std::move [modernize-pass-by-value]

src/cpp/preprocessor/asm/asm_parser.h:206:

-             m_pagenum(pgnum), m_linenumber(ln), m_line(line), m_file(file), m_is_save_restore(is_save_restore) {}
+             m_pagenum(pgnum), m_linenumber(ln), m_line(std::move(line)), m_file(file), m_is_save_restore(is_save_restore) {}

:m_op(op), m_optype(optype), m_section(sec), m_size(size),
m_pagenum(pgnum), m_linenumber(ln), m_line(line), m_file(file) {}
m_pagenum(pgnum), m_linenumber(ln), m_line(line), m_file(file), m_is_save_restore(is_save_restore) {}

asm_data( asm_data* a)
{
Expand All @@ -215,6 +216,7 @@ class asm_data
a->m_linenumber = m_linenumber;
a->m_line = m_line;
a->m_file = m_file;
a->m_is_save_restore = m_is_save_restore;
}

HEADER_ACCESS_GET_SET(code_section, section);
Expand All @@ -223,6 +225,7 @@ class asm_data
HEADER_ACCESS_GET_SET(uint32_t, linenumber);
HEADER_ACCESS_GET_SET(std::string, file);
HEADER_ACCESS_GET_SET(std::string, line);
HEADER_ACCESS_GET_SET(bool, is_save_restore);
bool isLabel() { return m_optype == operation_type::label; }
bool isOpcode() { return m_optype == operation_type::op; }
bool isAnnotation() { return m_optype == operation_type::annotation; }
Expand Down Expand Up @@ -346,6 +349,7 @@ class asm_parser: public std::enable_shared_from_this<asm_parser>
std::map<int, std::vector<std::string>> m_preempt_hintmaps; // group -> vector of hintmap_labels (multiple PREEMPT opcodes per group)
std::map<std::string, std::pair<std::string, std::string>> m_hintmap_labels; // hintmap_label -> (save_label, restore_label)
std::set<int> m_preempt_without_hintmap; // groups that have PREEMPT opcodes without hintmaps
bool m_is_save_restore_routine = false; // True when parsing save/restore routine files

// One unique scratchpad region: all hintmap labels that share the same scratchbase+size
struct hintmap_group_entry {
Expand Down Expand Up @@ -425,6 +429,20 @@ class asm_parser: public std::enable_shared_from_this<asm_parser>

bool is_multi_column_mode() const { return m_preempt_labels.size() > 1; }

// Check if currently parsing save/restore routine
bool is_save_restore_routine() const { return m_is_save_restore_routine; }
void set_save_restore_routine(bool val) { m_is_save_restore_routine = val; }

// Check if we should skip setpad for this target in save/restore routine
bool should_skip_setpad_in_save_restore() const {
return m_is_save_restore_routine;
}

Comment on lines +436 to +440
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The function name should_skip_setpad_in_save_restore is confusing. It returns true when inside a save/restore routine (line 369), but the comment on line 367 says "Check if we should skip setpad for this target in save/restore routine", which implies it would return true to skip. However, line 493 in the usage comment says ".setpad should only be part of save/restore routines", and the warning is issued when NOT in save/restore (negated condition). Consider renaming to is_in_save_restore_routine() for clarity, or inverting the logic to match the name.

Suggested change
// Check if we should skip setpad for this target in save/restore routine
bool should_skip_setpad_in_save_restore() const {
return m_is_save_restore_routine;
}
// Returns true if we are in a save/restore routine where .setpad is allowed
bool is_in_save_restore_routine() const {
return m_is_save_restore_routine;
}
// Backward-compatible alias: true means we are in a save/restore routine
// where .setpad is expected/allowed.
bool should_skip_setpad_in_save_restore() const {
return is_in_save_restore_routine();
}

Copilot uses AI. Check for mistakes.
// Check if we should use scratch-pad section for save/restore APPLY_OFFSET_57
//bool should_use_scratchpad_section_for_save_restore() const {
// return m_is_save_restore_routine;
//}

Comment on lines +441 to +445
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

Commented-out code in a public header adds noise and makes it harder to understand the intended API. Either remove this block, or reintroduce it as a real method if it’s still part of the design.

Suggested change
// Check if we should use scratch-pad section for save/restore APPLY_OFFSET_57
//bool should_use_scratchpad_section_for_save_restore() const {
// return m_is_save_restore_routine;
//}

Copilot uses AI. Check for mistakes.
// Record preempt label for current group (called when PREEMPT opcode is hit)
// Label naming: save_N / restore_N where N = index (group/2 + 1)
// group 0 -> save_1, group 2 -> save_2, group 4 -> save_3
Expand Down
2 changes: 1 addition & 1 deletion test/aie4-ctrlcode/1col_preempt/gold.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
96b00cbda9f5061f2cfef83b22c2e01d
7605802954688a5e7d1fff4198e6ef59
Loading