diff --git a/llvm/tools/llvm-exegesis/lib/SerialSnippetGenerator.cpp b/llvm/tools/llvm-exegesis/lib/SerialSnippetGenerator.cpp index b0c881c4d62ba..503c77c2ab6b8 100644 --- 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 @@ computeAliasingInstructions(const LLVMState &State, const Instruction *Instr, 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)