diff --git a/llvm/test/tools/llvm-exegesis/PowerPC/unsupported-opcode.s b/llvm/test/tools/llvm-exegesis/PowerPC/unsupported-opcode.s new file mode 100644 --- /dev/null +++ b/llvm/test/tools/llvm-exegesis/PowerPC/unsupported-opcode.s @@ -0,0 +1,3 @@ +# RUN: llvm-exegesis -mode=latency -opcode-name=SELECT_I8 2>&1 | FileCheck %s + +CHECK: Unsupported opcode: isPseudo/usesCustomInserter 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 @@ -51,7 +51,7 @@ const Instruction &OtherInstr = State.getIC().getInstr(OtherOpcode); const MCInstrDesc &OtherInstrDesc = OtherInstr.Description; // Ignore instructions that we cannot run. - if (OtherInstrDesc.isPseudo() || + if (OtherInstrDesc.isPseudo() || OtherInstrDesc.usesCustomInsertionHook() || OtherInstrDesc.isBranch() || OtherInstrDesc.isIndirectBranch() || OtherInstrDesc.isCall() || OtherInstrDesc.isReturn()) { continue; diff --git a/llvm/tools/llvm-exegesis/llvm-exegesis.cpp b/llvm/tools/llvm-exegesis/llvm-exegesis.cpp --- a/llvm/tools/llvm-exegesis/llvm-exegesis.cpp +++ b/llvm/tools/llvm-exegesis/llvm-exegesis.cpp @@ -251,8 +251,9 @@ const Instruction &Instr = State.getIC().getInstr(Opcode); const MCInstrDesc &InstrDesc = Instr.Description; // Ignore instructions that we cannot run. - if (InstrDesc.isPseudo()) - return make_error("Unsupported opcode: isPseudo"); + if (InstrDesc.isPseudo() || InstrDesc.usesCustomInsertionHook()) + return make_error( + "Unsupported opcode: isPseudo/usesCustomInserter"); if (InstrDesc.isBranch() || InstrDesc.isIndirectBranch()) return make_error("Unsupported opcode: isBranch/isIndirectBranch"); if (InstrDesc.isCall() || InstrDesc.isReturn())