diff --git a/gematria/datasets/process_and_filter_bbs.cc b/gematria/datasets/process_and_filter_bbs.cc index d32ee0a9..3b402461 100644 --- a/gematria/datasets/process_and_filter_bbs.cc +++ b/gematria/datasets/process_and_filter_bbs.cc @@ -70,6 +70,11 @@ static cl::opt FilterImplicitOutputEflags( cl::desc("Whether or not to filter instructions that have an eflags implicit output"), cl::init(false), 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, @@ -124,6 +129,13 @@ Expected ProcessBasicBlock( if (UsesEflags) 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); }