[llvm-exegesis] Don't use unsupported aliasing instructions
authorMiloš Stojanović <Milos.Stojanovic@rt-rk.com>
Thu, 23 Jan 2020 11:28:50 +0000 (12:28 +0100)
committerMiloš Stojanović <Milos.Stojanovic@rt-rk.com>
Thu, 23 Jan 2020 11:42:42 +0000 (12:42 +0100)
Since some instruction types aren't allowed as the main instruction also
don't allow them for aliasing instructions.

Differential Revision: https://reviews.llvm.org/D73220

llvm/tools/llvm-exegesis/lib/SerialSnippetGenerator.cpp

index 503c77c..3451edf 100644 (file)
@@ -49,6 +49,13 @@ computeAliasingInstructions(const LLVMState &State, const Instruction *Instr,
     if (OtherOpcode == Instr->Description.getOpcode())
       continue;
     const Instruction &OtherInstr = State.getIC().getInstr(OtherOpcode);
+    const MCInstrDesc &OtherInstrDesc = OtherInstr.Description;
+    // Ignore instructions that we cannot run.
+    if (OtherInstrDesc.isPseudo() ||
+        OtherInstrDesc.isBranch() || OtherInstrDesc.isIndirectBranch() ||
+        OtherInstrDesc.isCall() || OtherInstrDesc.isReturn()) {
+          continue;
+    }
     if (OtherInstr.hasMemoryOperands())
       continue;
     if (!State.getExegesisTarget().allowAsBackToBack(OtherInstr))