Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp =================================================================== --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -2640,7 +2640,11 @@ LLVM_ATTRIBUTE_ALWAYS_INLINE static bool CheckPatternPredicate(const unsigned char *MatcherTable, unsigned &MatcherIndex, const SelectionDAGISel &SDISel) { - return SDISel.CheckPatternPredicate(MatcherTable[MatcherIndex++]); + int64_t Val = MatcherTable[MatcherIndex++]; + if (Val & 128) + Val = GetVBR(Val, MatcherTable, MatcherIndex); + + return SDISel.CheckPatternPredicate(Val); } /// CheckNodePredicate - Implements OP_CheckNodePredicate. Index: llvm/utils/TableGen/DAGISelMatcherEmitter.cpp =================================================================== --- llvm/utils/TableGen/DAGISelMatcherEmitter.cpp +++ llvm/utils/TableGen/DAGISelMatcherEmitter.cpp @@ -473,11 +473,13 @@ case Matcher::CheckPatternPredicate: { StringRef Pred =cast(N)->getPredicate(); - OS << "OPC_CheckPatternPredicate, " << getPatternPredicate(Pred) << ','; + OS << "OPC_CheckPatternPredicate, "; + unsigned Bytes = + 1 + EmitVBRValue(getPatternPredicate(Pred), OS); if (!OmitComments) OS << " // " << Pred; OS << '\n'; - return 2; + return Bytes; } case Matcher::CheckPredicate: { TreePredicateFn Pred = cast(N)->getPredicate();