Lines Matching refs:Graph
166 std::unique_ptr<MachineGadgetGraph> Graph) const;
168 std::unique_ptr<MachineGadgetGraph> Graph) const;
173 trimMitigatedEdges(std::unique_ptr<MachineGadgetGraph> Graph) const;
276 std::unique_ptr<MachineGadgetGraph> Graph = getGadgetGraph(MF, MLI, MDT, MDF); in runOnMachineFunction() local
278 if (Graph == nullptr) in runOnMachineFunction()
282 writeGadgetGraph(outs(), MF, Graph.get()); in runOnMachineFunction()
295 writeGadgetGraph(FileOut, MF, Graph.get()); in runOnMachineFunction()
314 FencesInserted = hardenLoadsWithPlugin(MF, std::move(Graph)); in runOnMachineFunction()
316 FencesInserted = hardenLoadsWithHeuristic(MF, std::move(Graph)); in runOnMachineFunction()
599 std::unique_ptr<MachineGadgetGraph> Graph) const { in trimMitigatedEdges()
600 NodeSet ElimNodes{*Graph}; in trimMitigatedEdges()
601 EdgeSet ElimEdges{*Graph}; in trimMitigatedEdges()
603 elimMitigatedEdgesAndNodes(*Graph, ElimEdges, ElimNodes); in trimMitigatedEdges()
605 Graph->NumFences = 0; in trimMitigatedEdges()
606 Graph->NumGadgets = RemainingGadgets; in trimMitigatedEdges()
608 Graph = GraphBuilder::trim(*Graph, ElimNodes, ElimEdges, 0 /* NumFences */, in trimMitigatedEdges()
611 return Graph; in trimMitigatedEdges()
615 MachineFunction &MF, std::unique_ptr<MachineGadgetGraph> Graph) const { in hardenLoadsWithPlugin()
620 Graph = trimMitigatedEdges(std::move(Graph)); in hardenLoadsWithPlugin()
622 if (Graph->NumGadgets == 0) in hardenLoadsWithPlugin()
626 EdgeSet CutEdges{*Graph}; in hardenLoadsWithPlugin()
627 auto Nodes = std::make_unique<unsigned int[]>(Graph->nodes_size() + in hardenLoadsWithPlugin()
629 auto Edges = std::make_unique<unsigned int[]>(Graph->edges_size()); in hardenLoadsWithPlugin()
630 auto EdgeCuts = std::make_unique<int[]>(Graph->edges_size()); in hardenLoadsWithPlugin()
631 auto EdgeValues = std::make_unique<int[]>(Graph->edges_size()); in hardenLoadsWithPlugin()
632 for (const Node &N : Graph->nodes()) { in hardenLoadsWithPlugin()
633 Nodes[Graph->getNodeIndex(N)] = Graph->getEdgeIndex(*N.edges_begin()); in hardenLoadsWithPlugin()
635 Nodes[Graph->nodes_size()] = Graph->edges_size(); // terminator node in hardenLoadsWithPlugin()
636 for (const Edge &E : Graph->edges()) { in hardenLoadsWithPlugin()
637 Edges[Graph->getEdgeIndex(E)] = Graph->getNodeIndex(*E.getDest()); in hardenLoadsWithPlugin()
638 EdgeValues[Graph->getEdgeIndex(E)] = E.getValue(); in hardenLoadsWithPlugin()
640 OptimizeCut(Nodes.get(), Graph->nodes_size(), Edges.get(), EdgeValues.get(), in hardenLoadsWithPlugin()
641 EdgeCuts.get(), Graph->edges_size()); in hardenLoadsWithPlugin()
642 for (int I = 0; I < Graph->edges_size(); ++I) in hardenLoadsWithPlugin()
649 FencesInserted += insertFences(MF, *Graph, CutEdges); in hardenLoadsWithPlugin()
653 Graph = GraphBuilder::trim(*Graph, NodeSet{*Graph}, CutEdges); in hardenLoadsWithPlugin()
660 MachineFunction &MF, std::unique_ptr<MachineGadgetGraph> Graph) const { in hardenLoadsWithHeuristic()
663 if (Graph->NumFences > 0) { in hardenLoadsWithHeuristic()
665 Graph = trimMitigatedEdges(std::move(Graph)); in hardenLoadsWithHeuristic()
669 if (Graph->NumGadgets == 0) in hardenLoadsWithHeuristic()
673 EdgeSet CutEdges{*Graph}; in hardenLoadsWithHeuristic()
677 for (const Edge &E : Graph->edges()) in hardenLoadsWithHeuristic()
689 for (const Node &N : Graph->nodes()) { in hardenLoadsWithHeuristic()
718 int FencesInserted = insertFences(MF, *Graph, CutEdges); in hardenLoadsWithHeuristic()