Skip to content
Snippets Groups Projects
Commit 358452be authored by kotsifa2's avatar kotsifa2
Browse files

Added DFEdge class

parent 2a561909
No related branches found
No related tags found
No related merge requests found
//===-- llvm/IR/DFNode.h - Class to represent a single Dataflow Node --===// //===----- llvm/IR/DFGraph.h - Classes to represent a Dataflow Graph ------===//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
// This file contains the declaration of the DFNode class, which represents a // This file contains the declaration of the DFNode and DFEdge class.
// single VISC Dataflow Node in LLVM. //
// DFNode represents a single VISC Dataflow Node in LLVM.
// //
// A Dataflow Node basically consists of // A Dataflow Node basically consists of
// 1. Pointer to a function describing this dataflow node // 1. Pointer to a function describing this dataflow node
...@@ -18,10 +19,23 @@ ...@@ -18,10 +19,23 @@
// 5. List of children Dataflow Nodes (empty if it is a leaf node) // 5. List of children Dataflow Nodes (empty if it is a leaf node)
// 6. List of Dataflow Edges among children // 6. List of Dataflow Edges among children
// //
// DFEdge represents a single VISC Dataflow Edge in LLVM.
//
// A Dataflow Edge basically consists of
// 1. Pointer to the dataflow node that is the source of this edge
// 2. Pointer to the dataflow node that is the destination of this edge
// 3. Pointer to a function that describes which instances of the source
// dataflow node are connected to which instances of the destination
// dataflow node via this edge
// 4. Pointer to a function that describes which input arguments of the
// destination dataflow node are connected to which outputs of the source
// dataflow node via this edge
//
// FIXME : We still need to figure out whether these functions are independent
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef LLVM_IR_DFNODE_H #ifndef LLVM_IR_DFGRAPH_H
#define LLVM_IR_DFNODE_H #define LLVM_IR_DFGRAPH_H
#include "llvm/IR/Function.h" #include "llvm/IR/Function.h"
#include "llvm/Support/Compiler.h" #include "llvm/Support/Compiler.h"
...@@ -29,10 +43,11 @@ ...@@ -29,10 +43,11 @@
namespace llvm { namespace llvm {
class DFNode : public ilist_node<DFNode> { class DFNode : public ilist_node<DFNode> {
public: private:
typedef iplist<DFNode> DFNodeListType; typedef iplist<DFNode> DFNodeListType;
typedef iplist<DFEdge> DFEdgeListType; typedef iplist<DFEdge> DFEdgeListType;
public:
// DFNode and DFEdge iterators // DFNode and DFEdge iterators
typedef DFNodeListType::iterator iterator; typedef DFNodeListType::iterator iterator;
typedef DFNodeListType::const_iterator const_iterator; typedef DFNodeListType::const_iterator const_iterator;
...@@ -55,6 +70,25 @@ public: ...@@ -55,6 +70,25 @@ public:
} }
}; };
class DFEdge : public ilist_node<DFEdge> {
private:
// Important things that make up a Dataflow Edge
DFNode* SrcDF; ///< Pointer to source dataflow Node
DFNode* DestDF; ///< Pointer to destination dataflow Node
Function* DFMapFuncPointer; ///< Function that associates the appropriate
///< instances of source and destination
///< dataflow nodes
Function* ArgMapFuncPointer; ///< Function that associates the input
///< arguments of destination with the outputs
///< of source dataflow node
public:
static DFEdge *Create(DFNode* SrcDF, DFNode* DestDF, Function* DFMapFuncPointer, Function* ArgMapFuncPointer) {
return new DFEdge(SrcDF, DestDF, DFMapFuncPointer, ArgMapFuncPointer);
}
};
} // End llvm namespace } // End llvm namespace
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment