MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Visit

Method Visit

tensorflow/compiler/jit/deadness_analysis.cc:348–368  ·  view source on GitHub ↗

static*/

Source from the content-addressed store, hash-verified

346
347template <typename FunctionTy>
348/*static*/ void Predicate::Visit(Predicate* p, const FunctionTy& func) {
349 absl::flat_hash_set<Predicate*> visited;
350 std::vector<Predicate*> stack;
351
352 stack.push_back(p);
353 visited.insert(p);
354
355 while (!stack.empty()) {
356 Predicate* current = stack.back();
357 stack.pop_back();
358 bool done = func(current);
359 if (done) {
360 return;
361 }
362 for (Predicate* op : current->GetOperands()) {
363 if (visited.insert(op).second) {
364 stack.push_back(op);
365 }
366 }
367 }
368}
369
370// Creates and owns Predicate instances. Simplifies predicates as it creates
371// them.

Callers

nothing calls this directly

Calls 7

pop_backMethod · 0.80
funcFunction · 0.50
push_backMethod · 0.45
insertMethod · 0.45
emptyMethod · 0.45
backMethod · 0.45
GetOperandsMethod · 0.45

Tested by

no test coverage detected