diff --git a/utils/TableGen/GlobalISelEmitter.cpp b/utils/TableGen/GlobalISelEmitter.cpp index a9ebf8f1bea..52fe9b2af2f 100644 --- a/utils/TableGen/GlobalISelEmitter.cpp +++ b/utils/TableGen/GlobalISelEmitter.cpp @@ -4394,6 +4394,11 @@ Expected GlobalISelEmitter::importExplicitDefRenderers( DstMIBuilder.addRenderer(DstI->Operands[0].Name); + // Some instructions have multiple defs, but are missing a type entry + // (e.g. s_cc_out operands). + if (Dst->getExtTypes().size() < NumDefs) + return failedImport("unhandled discarded def"); + // Patterns only handle a single result, so any result after the first is an // implicitly dead def. for (unsigned I = 1; I < NumDefs; ++I) {