We need to check that the return type is correct, even in cases where we don't
have a return type that differs from the operand types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55376 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/TableGen/FastISelEmitter.cpp b/utils/TableGen/FastISelEmitter.cpp
index c9978e5..20b39c6 100644
--- a/utils/TableGen/FastISelEmitter.cpp
+++ b/utils/TableGen/FastISelEmitter.cpp
@@ -437,6 +437,9 @@
           Operands.PrintParameters(OS);
           OS << ") {\n";
           
+          OS << "  if (RetVT != " << getName(RM.begin()->first)
+             << ")\n    return 0;\n";
+          
           const PredMap &PM = RM.begin()->second;
           bool HasPred = false;