Lines Matching defs:depth
88 void emitMatch(DagNode tree, StringRef name, int depth);
98 void emitNativeCodeMatch(DagNode tree, StringRef name, int depth);
102 void emitOpMatch(DagNode tree, StringRef opName, int depth);
116 int depth);
121 int &operandIndex, int depth);
126 int depth);
147 // `depth` is the nesting level of `resultTree`; 0 means top-level result
153 int depth);
157 std::string handleReplaceWithNativeCodeCall(DagNode resultTree, int depth);
164 std::string handleVariadic(DagNode tree, int depth);
189 std::string handleReturnTypeArg(DagNode returnType, int i, int depth);
196 std::string handleOpCreation(DagNode tree, int resultIndex, int depth);
208 int depth);
213 DagNode node, const ChildNodeIndexNameMap &childNodeNames, int depth);
387 emitMatch(tree, "op0", /*depth=*/1);
395 void PatternEmitter::emitMatch(DagNode tree, StringRef name, int depth) {
397 emitNativeCodeMatch(tree, name, depth);
402 emitOpMatch(tree, name, depth);
451 int depth) {
465 // NativeCodeCall will never be at depth 0 so that we don't need to catch
478 std::string argName = formatv("arg{0}_{1}", depth, i);
561 void PatternEmitter::emitOpMatch(DagNode tree, StringRef opName, int depth) {
564 << op.getOperationName() << "' at depth " << depth
567 auto getCastedName = [depth]() -> std::string {
568 return formatv("castedOp{0}", depth);
581 if (depth == 0)
593 // Skip the operand matching at depth 0 as the pattern rewriter already does.
594 if (depth != 0)
607 std::string argName = formatv("op{0}", depth + 1);
613 depth);
626 nextOperand, depth);
651 emitMatch(argTree, argName, depth + 1);
667 emitAttributeMatch(tree, opName, opArgIdx, depth);
673 << op.getOperationName() << "' at depth " << depth
729 int &operandIndex, int depth) {
739 std::string lambda = formatv("eitherLambda{0}", depth);
765 emitMatch(argTree, argName, depth + 1);
809 int &operandIndex, int depth) {
850 emitMatch(argTree, argName, depth + 1);
868 int argIndex, int depth) {
957 int depth = 0;
958 emitMatch(tree, opName, depth);
1232 int resultIndex, int depth) {
1243 return handleReplaceWithNativeCodeCall(resultTree, depth);
1249 return handleVariadic(resultTree, depth);
1252 auto symbol = handleOpCreation(resultTree, resultIndex, depth);
1261 std::string PatternEmitter::handleVariadic(DagNode tree, int depth) {
1271 oss << name << ".push_back(" << handleResultPattern(child, i, depth + 1)
1348 int depth) {
1354 return handleReplaceWithNativeCodeCall(dagNode, depth);
1399 int depth) {
1416 handleResultPattern(tree.getArgAsNestedDag(i), i, depth + 1));
1529 int depth) {
1584 childNodeNames[i] = handleResultPattern(child, i, depth + 1);
1623 createAggregateLocalVarsForOpArgs(tree, childNodeNames, depth);
1634 if (!tail.returnType && (usePartialResults || depth > 0 || resultIndex < 0)) {
1647 supplyValuesForOpArgs(tree, childNodeNames, depth);
1653 // However, if depth == 0 and resultIndex >= 0, it means we are replacing
1657 if (depth == 0 && resultIndex >= 0 && tail.returnType)
1662 createAggregateLocalVarsForOpArgs(tree, childNodeNames, depth);
1672 auto varName = handleReturnTypeArg(tail.returnType, i, depth + 1);
1749 DagNode node, const ChildNodeIndexNameMap &childNodeNames, int depth) {
1791 DagNode node, const ChildNodeIndexNameMap &childNodeNames, int depth) {