Lines Matching refs:GepNode
52 struct GepNode;
53 typedef std::set<GepNode*> NodeSet;
54 typedef std::map<GepNode*,Value*> NodeToValueMap;
55 typedef std::vector<GepNode*> NodeVect;
56 typedef std::map<GepNode*,NodeVect> NodeChildrenMap;
58 typedef std::map<GepNode*,UseSet> NodeToUsesMap;
65 void insert(const GepNode *N) { Map.insert(std::make_pair(N, ++LastNum)); } in insert()
68 bool operator()(const GepNode *N1, const GepNode *N2) const { in operator ()()
75 std::map<const GepNode *, unsigned> Map;
101 typedef std::map<Value*,GepNode*> ValueToNodeMap;
103 typedef std::map<GepNode*,ValueVect> NodeToValuesMap;
111 BasicBlock *recalculatePlacement(GepNode *Node, NodeChildrenMap &NCM,
113 BasicBlock *recalculatePlacementRec(GepNode *Node, NodeChildrenMap &NCM,
116 bool isInvariantIn(GepNode *Node, Loop *L);
118 BasicBlock *adjustForInvariance(GepNode *Node, NodeChildrenMap &NCM,
120 void separateChainForNode(GepNode *Node, Use *U, NodeToValueMap &Loc);
121 void separateConstantChains(GepNode *Node, NodeChildrenMap &NCM,
127 void getAllUsersForNode(GepNode *Node, ValueVect &Values,
136 SpecificBumpPtrAllocator<GepNode> *Mem;
156 struct GepNode { struct
166 GepNode *Parent;
172 GepNode() : Flags(0), Parent(0), Idx(0), PTy(0) {} in GepNode() argument
173 GepNode(const GepNode *N) : Flags(N->Flags), Idx(N->Idx), PTy(N->PTy) { in GepNode() argument
179 friend raw_ostream &operator<< (raw_ostream &OS, const GepNode &GN);
198 raw_ostream &operator<< (raw_ostream &OS, const GepNode &GN) { in operator <<()
201 if (GN.Flags & GepNode::Root) { in operator <<()
205 if (GN.Flags & GepNode::Internal) { in operator <<()
211 if (GN.Flags & GepNode::Used) { in operator <<()
218 if (GN.Flags & GepNode::Root) in operator <<()
283 bool operator() (GepNode *N) const { in operator ()()
292 inline void *operator new(size_t, SpecificBumpPtrAllocator<GepNode> &A) { in operator new()
326 GepNode *N = new (*Mem) GepNode; in processGepInst()
331 N->Flags |= GepNode::Root; in processGepInst()
360 GepNode *PN = N; in processGepInst()
365 GepNode *Nx = new (*Mem) GepNode; in processGepInst()
367 Nx->Flags |= GepNode::Internal; in processGepInst()
379 PN->Flags |= GepNode::Used; in processGepInst()
418 GepNode *N = *I; in invert_find_roots()
419 if (N->Flags & GepNode::Root) { in invert_find_roots()
423 GepNode *PN = N->Parent; in invert_find_roots()
428 void nodes_for_root(GepNode *Root, NodeChildrenMap &NCM, NodeSet &Nodes) { in nodes_for_root()
435 GepNode *N = *First; in nodes_for_root()
449 typedef std::pair<GepNode*,GepNode*> NodePair;
452 const NodeSet *node_class(GepNode *N, NodeSymRel &Rel) { in node_class()
462 NodePair node_pair(GepNode *N1, GepNode *N2) { in node_pair()
469 unsigned node_hash(GepNode *N) { in node_hash()
477 bool node_eq(GepNode *N1, GepNode *N2, NodePairSet &Eq, NodePairSet &Ne) { in node_eq()
491 bool Root1 = N1->Flags & GepNode::Root; in node_eq()
492 bool Root2 = N2->Flags & GepNode::Root; in node_eq()
522 GepNode *N = *I; in common()
535 GepNode *N = *NI; in common()
578 typedef std::map<const NodeSet*,GepNode*> ProjMap; in common()
582 GepNode *Min = *std::min_element(S.begin(), S.end(), NodeOrder); in common()
591 GepNode *N = *J; in common()
595 if (NF & GepNode::Used) in common()
612 GepNode *N = *I; in common()
613 if (N->Flags & GepNode::Root) in common()
622 GepNode *Rep = F->second; in common()
631 GepNode *N = *I; in common()
738 BasicBlock *HexagonCommonGEP::recalculatePlacement(GepNode *Node, in recalculatePlacement()
751 if (Node->Flags & GepNode::Used) { in recalculatePlacement()
773 GepNode *CN = *I; in recalculatePlacement()
806 BasicBlock *HexagonCommonGEP::recalculatePlacementRec(GepNode *Node, in recalculatePlacementRec()
834 bool HexagonCommonGEP::isInvariantIn(GepNode *Node, Loop *L) { in isInvariantIn()
835 if (Node->Flags & GepNode::Root) in isInvariantIn()
868 BasicBlock *HexagonCommonGEP::adjustForInvariance(GepNode *Node, in adjustForInvariance()
874 if (Node->Flags & GepNode::Root) { in adjustForInvariance()
937 inline bool is_constant(GepNode *N) { in is_constant()
943 void HexagonCommonGEP::separateChainForNode(GepNode *Node, Use *U, in separateChainForNode()
950 GepNode *N = Node; in separateChainForNode()
951 GepNode *C = 0, *NewNode = 0; in separateChainForNode()
952 while (is_constant(N) && !(N->Flags & GepNode::Root)) { in separateChainForNode()
954 GepNode *NewN = new (*Mem) GepNode(N); in separateChainForNode()
960 NewN->Flags &= ~GepNode::Used; in separateChainForNode()
984 Node->Flags &= ~GepNode::Used; in separateChainForNode()
989 NewNode->Flags |= GepNode::Used; in separateChainForNode()
996 void HexagonCommonGEP::separateConstantChains(GepNode *Node, in separateConstantChains()
1007 GepNode *N = *I; in separateConstantChains()
1008 if (!(N->Flags & GepNode::Used)) in separateConstantChains()
1042 GepNode *N = I->first; in separateConstantChains()
1090 GepNode *RN = NA[0]; in fabricateGEP()
1091 assert((RN->Flags & GepNode::Root) && "Creating GEP for non-root"); in fabricateGEP()
1110 GepNode *N = NA[nax-1]; in fabricateGEP()
1133 void HexagonCommonGEP::getAllUsersForNode(GepNode *Node, ValueVect &Values, in getAllUsersForNode()
1140 GepNode *N = *First; in getAllUsersForNode()
1142 if (N->Flags & GepNode::Used) { in getAllUsersForNode()
1168 GepNode *Root = *First, *Last = *First; in materialize()
1187 LastUsed = (Last->Flags & GepNode::Used); in materialize()
1194 GepNode *Child = CF->second.front(); in materialize()
1218 GepNode *CN = *I; in materialize()
1219 CN->Flags &= ~GepNode::Internal; in materialize()
1220 CN->Flags |= GepNode::Root; in materialize()
1287 SpecificBumpPtrAllocator<GepNode> Allocator; in runOnFunction()