Lines Matching defs:GepNode

70   struct GepNode;
71 using NodeSet = std::set<GepNode *>;
72 using NodeToValueMap = std::map<GepNode *, Value *>;
73 using NodeVect = std::vector<GepNode *>;
74 using NodeChildrenMap = std::map<GepNode *, NodeVect>;
76 using NodeToUsesMap = std::map<GepNode *, UseSet>;
83 void insert(const GepNode *N) { Map.insert(std::make_pair(N, ++LastNum)); }
86 bool operator()(const GepNode *N1, const GepNode *N2) const {
93 std::map<const GepNode *, unsigned> Map;
119 using ValueToNodeMap = std::map<Value *, GepNode *>;
121 using NodeToValuesMap = std::map<GepNode *, ValueVect>;
129 BasicBlock *recalculatePlacement(GepNode *Node, NodeChildrenMap &NCM,
131 BasicBlock *recalculatePlacementRec(GepNode *Node, NodeChildrenMap &NCM,
134 bool isInvariantIn(GepNode *Node, Loop *L);
136 BasicBlock *adjustForInvariance(GepNode *Node, NodeChildrenMap &NCM,
138 void separateChainForNode(GepNode *Node, Use *U, NodeToValueMap &Loc);
139 void separateConstantChains(GepNode *Node, NodeChildrenMap &NCM,
145 void getAllUsersForNode(GepNode *Node, ValueVect &Values,
154 SpecificBumpPtrAllocator<GepNode> *Mem;
176 struct GepNode {
187 GepNode *Parent;
193 GepNode() : Parent(nullptr) {}
194 GepNode(const GepNode *N) : Flags(N->Flags), Idx(N->Idx), PTy(N->PTy) {
201 friend raw_ostream &operator<< (raw_ostream &OS, const GepNode &GN);
220 raw_ostream &operator<< (raw_ostream &OS, const GepNode &GN) {
223 if (GN.Flags & GepNode::Root) {
227 if (GN.Flags & GepNode::Internal) {
233 if (GN.Flags & GepNode::Used) {
238 if (GN.Flags & GepNode::InBounds) {
244 if (GN.Flags & GepNode::Root)
309 bool operator() (GepNode *N) const {
319 inline void *operator new(size_t, SpecificBumpPtrAllocator<GepNode> &A) {
347 GepNode *N = new (*Mem) GepNode;
349 uint32_t InBounds = GepI->isInBounds() ? GepNode::InBounds : 0;
353 N->Flags |= GepNode::Root | InBounds;
382 GepNode *PN = N;
387 GepNode *Nx = new (*Mem) GepNode;
389 Nx->Flags |= GepNode::Internal | InBounds;
401 PN->Flags |= GepNode::Used;
438 GepNode *N = *I;
439 if (N->Flags & GepNode::Root) {
443 GepNode *PN = N->Parent;
448 static void nodes_for_root(GepNode *Root, NodeChildrenMap &NCM,
456 GepNode *N = *First;
469 using NodePair = std::pair<GepNode *, GepNode *>;
474 static const NodeSet *node_class(GepNode *N, NodeSymRel &Rel) {
481 // Create an ordered pair of GepNode pointers. The pair will be used in
484 static NodePair node_pair(GepNode *N1, GepNode *N2) {
491 static unsigned node_hash(GepNode *N) {
499 static bool node_eq(GepNode *N1, GepNode *N2, NodePairSet &Eq,
514 bool Root1 = N1->Flags & GepNode::Root;
515 bool Root2 = N2->Flags & GepNode::Root;
543 GepNode *N = *I;
556 GepNode *N = *NI;
598 using ProjMap = std::map<const NodeSet *, GepNode *>;
602 GepNode *Min = *std::min_element(S.begin(), S.end(), NodeOrder);
611 GepNode *N = *J;
615 if (NF & GepNode::Used)
632 GepNode *N = *I;
633 if (N->Flags & GepNode::Root)
642 GepNode *Rep = F->second;
651 GepNode *N = *I;
755 BasicBlock *HexagonCommonGEP::recalculatePlacement(GepNode *Node,
768 if (Node->Flags & GepNode::Used) {
790 GepNode *CN = *I;
822 BasicBlock *HexagonCommonGEP::recalculatePlacementRec(GepNode *Node,
848 bool HexagonCommonGEP::isInvariantIn(GepNode *Node, Loop *L) {
849 if (Node->Flags & GepNode::Root)
877 BasicBlock *HexagonCommonGEP::adjustForInvariance(GepNode *Node,
883 if (Node->Flags & GepNode::Root) {
947 inline bool is_constant(GepNode *N) {
953 void HexagonCommonGEP::separateChainForNode(GepNode *Node, Use *U,
960 GepNode *N = Node;
961 GepNode *C = nullptr, *NewNode = nullptr;
962 while (is_constant(N) && !(N->Flags & GepNode::Root)) {
964 GepNode *NewN = new (*Mem) GepNode(N);
970 NewN->Flags &= ~GepNode::Used;
992 Node->Flags &= ~GepNode::Used;
997 NewNode->Flags |= GepNode::Used;
1003 void HexagonCommonGEP::separateConstantChains(GepNode *Node,
1014 GepNode *N = *I;
1015 if (!(N->Flags & GepNode::Used))
1049 GepNode *N = I->first;
1096 GepNode *RN = NA[0];
1097 assert((RN->Flags & GepNode::Root) && "Creating GEP for non-root");
1116 GepNode *N = NA[nax-1];
1130 NewInst->setIsInBounds(RN->Flags & GepNode::InBounds);
1139 void HexagonCommonGEP::getAllUsersForNode(GepNode *Node, ValueVect &Values,
1146 GepNode *N = *First;
1148 if (N->Flags & GepNode::Used) {
1173 GepNode *Root = *First, *Last = *First;
1192 LastUsed = (Last->Flags & GepNode::Used);
1199 GepNode *Child = CF->second.front();
1223 GepNode *CN = *I;
1224 CN->Flags &= ~GepNode::Internal;
1225 CN->Flags |= GepNode::Root;
1292 SpecificBumpPtrAllocator<GepNode> Allocator;