diff --git a/llvm/tools/llvm-exegesis/lib/SerialSnippetGenerator.cpp b/llvm/tools/llvm-exegesis/lib/SerialSnippetGenerator.cpp --- a/llvm/tools/llvm-exegesis/lib/SerialSnippetGenerator.cpp +++ b/llvm/tools/llvm-exegesis/lib/SerialSnippetGenerator.cpp @@ -8,8 +8,9 @@ #include "SerialSnippetGenerator.h" -#include "MCInstrDescView.h" #include "CodeTemplate.h" +#include "MCInstrDescView.h" +#include "Target.h" #include #include #include @@ -50,6 +51,8 @@ const Instruction &OtherInstr = State.getIC().getInstr(OtherOpcode); if (OtherInstr.hasMemoryOperands()) continue; + if (!State.getExegesisTarget().allowAsBackToBack(OtherInstr)) + continue; if (Instr->hasAliasingRegistersThrough(OtherInstr, ForbiddenRegisters)) AliasingInstructions.push_back(&OtherInstr); if (AliasingInstructions.size() >= MaxAliasingInstructions)