1 //===- SparseAnalysis.cpp - Sparse data-flow analysis ---------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #include "mlir/Analysis/DataFlow/SparseAnalysis.h" 10 11 using namespace mlir; 12 using namespace mlir::dataflow; 13 14 //===----------------------------------------------------------------------===// 15 // AbstractSparseLattice 16 //===----------------------------------------------------------------------===// 17 18 void AbstractSparseLattice::onUpdate(DataFlowSolver *solver) const { 19 // Push all users of the value to the queue. 20 for (Operation *user : point.get<Value>().getUsers()) 21 for (DataFlowAnalysis *analysis : useDefSubscribers) 22 solver->enqueue({user, analysis}); 23 } 24