[llvm] fa30ade - [Attributor][NFC] Update description for the dependency graph
Luofan Chen via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 1 06:27:42 PDT 2020
Author: Luofan Chen
Date: 2020-08-01T21:27:16+08:00
New Revision: fa30adecc766eb627a85f746b0f6f22b0eadbda8
URL: https://github.com/llvm/llvm-project/commit/fa30adecc766eb627a85f746b0f6f22b0eadbda8
DIFF: https://github.com/llvm/llvm-project/commit/fa30adecc766eb627a85f746b0f6f22b0eadbda8.diff
LOG: [Attributor][NFC] Update description for the dependency graph
The word "dependency graph" is a bit misleading. When there is an
edge from node A to B (A -> B), it actually mean that B depends on
A and when the state of A is updated, B should also be updated. So
I update the comment to make the description clearer.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D85065
Added:
Modified:
llvm/include/llvm/Transforms/IPO/Attributor.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h
index bd6ff03a31fa..418a00731967 100644
--- a/llvm/include/llvm/Transforms/IPO/Attributor.h
+++ b/llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -155,8 +155,8 @@ struct AADepGraphNode {
using DepTy = PointerIntPair<AADepGraphNode *, 1>;
protected:
- /// Set of dependency graph nodes which this one depends on.
- /// The bit encodes if it is optional.
+ /// Set of dependency graph nodes which should be updated if this one
+ /// is updated. The bit encodes if it is optional.
TinyPtrVector<DepTy> Deps;
static AADepGraphNode *DepGetVal(DepTy &DT) { return DT.getPointer(); }
@@ -184,6 +184,11 @@ struct AADepGraphNode {
friend struct AADepGraph;
};
+/// The data structure for the dependency graph
+///
+/// Note that in this graph if there is an edge from A to B (A -> B),
+/// then it means that B depends on A, and when the state of A is
+/// updated, node B should also be updated
struct AADepGraph {
AADepGraph() {}
~AADepGraph() {}
@@ -197,7 +202,6 @@ struct AADepGraph {
/// requires a single entry point, so we maintain a fake("synthetic") root
/// node that depends on every node.
AADepGraphNode SyntheticRoot;
-
AADepGraphNode *GetEntryNode() { return &SyntheticRoot; }
iterator begin() { return SyntheticRoot.child_begin(); }
More information about the llvm-commits
mailing list