[llvm-exegesis] Restrict to allowed back-to-back instructions in SerialSnippetGenerator.

Summary: Followup to D73161.

Reviewers: gchatelet, mstojanovic

Subscribers: tschuett, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73256
This commit is contained in:
Clement Courbet 2020-01-23 08:58:58 +01:00
parent 9dbc1ab232
commit 6d2510d30a
1 changed files with 4 additions and 1 deletions

View File

@ -8,8 +8,9 @@
#include "SerialSnippetGenerator.h"
#include "MCInstrDescView.h"
#include "CodeTemplate.h"
#include "MCInstrDescView.h"
#include "Target.h"
#include <algorithm>
#include <numeric>
#include <vector>
@ -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)