diff --git a/gematria/datasets/process_and_filter_bbs.cc b/gematria/datasets/process_and_filter_bbs.cc index 1b2314a8..ff356573 100644 --- a/gematria/datasets/process_and_filter_bbs.cc +++ b/gematria/datasets/process_and_filter_bbs.cc @@ -52,6 +52,11 @@ static cl::opt ReportProgressEvery( cl::desc("The interval at which to report progress in blocks"), cl::init(std::numeric_limits::max()), cl::cat(ProcessFilterCat)); +static cl::opt FilterVariableLatencyInstructions( + "filter-variable-latency-instructions", + cl::desc("Whether or not to filter variable latency instructions"), + cl::init(false), cl::cat(ProcessFilterCat)); + Expected processBasicBlock( const std::string &BasicBlock, const gematria::LlvmArchitectureSupport &LLVMSupport, @@ -91,6 +96,15 @@ Expected 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); }