Index: utils/TableGen/CodeGenDAGPatterns.h =================================================================== --- utils/TableGen/CodeGenDAGPatterns.h +++ utils/TableGen/CodeGenDAGPatterns.h @@ -673,8 +673,8 @@ } void addPredicateFn(const TreePredicateFn &Fn) { assert(!Fn.isAlwaysTrue() && "Empty predicate string!"); - if (!is_contained(PredicateFns, Fn)) - PredicateFns.push_back(Fn); + assert(!is_contained(PredicateFns, Fn) && "predicate applied recursively"); + PredicateFns.push_back(Fn); } Record *getTransformFn() const { return TransformFn; } Index: utils/TableGen/CodeGenDAGPatterns.cpp =================================================================== --- utils/TableGen/CodeGenDAGPatterns.cpp +++ utils/TableGen/CodeGenDAGPatterns.cpp @@ -3037,13 +3037,6 @@ P->error("Operands list does not contain an entry for operand '" + *OperandsSet.begin() + "'!"); - // If there is a code init for this fragment, keep track of the fact that - // this fragment uses it. - TreePredicateFn PredFn(P); - if (!PredFn.isAlwaysTrue()) - for (auto T : P->getTrees()) - T->addPredicateFn(PredFn); - // If there is a node transformation corresponding to this, keep track of // it. Record *Transform = Frag->getValueAsDef("OperandTransform");