Complex pattern's custom matcher should not call Select() on any operands.
Select them afterwards if it returns true.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25968 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp
index b85ee8c..0b3d6df 100644
--- a/utils/TableGen/DAGISelEmitter.cpp
+++ b/utils/TableGen/DAGISelEmitter.cpp
@@ -2136,6 +2136,11 @@
for (unsigned i = 0; i < NumRes; i++)
Code += ", Tmp" + utostr(i + ResNo);
emitCheck(Code + ")");
+
+ for (unsigned i = 0; i < NumRes; ++i)
+ emitCode("Tmp" + utostr(i+ResNo) + " = Select(Tmp" +
+ utostr(i+ResNo) + ");");
+
TmpNo = ResNo + NumRes;
} else {
emitCode("SDOperand Tmp" + utostr(ResNo) + " = Select(" + Val + ");");