Skip to content
Draft
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
14 changes: 14 additions & 0 deletions gematria/datasets/process_and_filter_bbs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ static cl::opt<unsigned> ReportProgressEvery(
cl::desc("The interval at which to report progress in blocks"),
cl::init(std::numeric_limits<unsigned>::max()), cl::cat(ProcessFilterCat));

static cl::opt<bool> FilterVariableLatencyInstructions(
"filter-variable-latency-instructions",
cl::desc("Whether or not to filter variable latency instructions"),
cl::init(false), cl::cat(ProcessFilterCat));

Expected<std::string> processBasicBlock(
const std::string &BasicBlock,
const gematria::LlvmArchitectureSupport &LLVMSupport,
Expand Down Expand Up @@ -91,6 +96,15 @@ Expected<std::string> processBasicBlock(
if (FilterMemoryAccessingBlocks &&
(InstDesc.mayLoad() || InstDesc.mayStore()))
continue;

if (FilterVariableLatencyInstructions) {
// Kind of a hacky solution, but can't figure out a better way to get a
// list of all the variable latency instructions, and div seems like the
// main one currently.
if (Instruction.assembly.find("DIV") != std::string::npos)
continue;
}

OutputBlock += toHex(Instruction.machine_code);
}

Expand Down