MCPcopy Create free account
hub / github.com/AliveToolkit/alive2 / DenseDataFlow

Method DenseDataFlow

util/dataflow.h:17–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15
16public:
17 DenseDataFlow(const IR::Function &f) {
18 bb_data.emplace(&f.getFirstBB(), DataTy());
19
20 // We assume BBs were top sorted already
21 for (auto &bb : f.getBBs()) {
22 auto I = bb_data.find(bb);
23 if (I == bb_data.end()) // unreachable
24 continue;
25 auto &data = I->second;
26
27 for (auto &inst : bb->instrs()) {
28 data.exec(inst, glb_data);
29
30 if (dynamic_cast<const IR::Return*>(&inst)) {
31 ret_data.merge(data);
32 }
33 }
34
35 for (auto &dst : bb->targets()) {
36 auto [I, inserted] = bb_data.try_emplace(&dst, data);
37 if (!inserted) {
38 I->second.merge(data);
39 }
40 }
41 }
42 }
43
44 const auto& getResult() const { return ret_data; }
45};

Callers

nothing calls this directly

Calls 6

findMethod · 0.80
endMethod · 0.45
instrsMethod · 0.45
execMethod · 0.45
mergeMethod · 0.45
targetsMethod · 0.45

Tested by

no test coverage detected