Lines Matching full:leader
135 STATISTIC(NumGVNLeaderChanges, "Number of leader changes");
136 STATISTIC(NumGVNSortedLeaderChanges, "Number of sorted leader changes");
138 "Number of avoided sorted leader changes");
264 // Every congruence class has a leader, and the leader is used to symbolize
266 // member of the same congruence class will always be replaced with leader
267 // during symbolization). To simplify symbolization, we keep the leader as a
269 // leader is the member of the value set with the smallest DFS number. Each
279 // leader of the memory congruence class, and the leader of memory congruence
300 CongruenceClass(unsigned ID, Value *Leader, const Expression *E) in CongruenceClass() argument
301 : ID(ID), RepLeader(Leader), DefiningExpr(E) {} in CongruenceClass()
313 // Leader functions
315 void setLeader(Value *Leader) { RepLeader = Leader; } in setLeader() argument
326 void setStoredValue(Value *Leader) { RepStoredValue = Leader; } in setStoredValue() argument
328 void setMemoryLeader(const MemoryAccess *Leader) { RepMemoryAccess = Leader; } in setMemoryLeader() argument
395 // Representative leader.
398 // The most dominating leader after our current leader, because the member set
599 // create expressions for them, we need to simulate leader change not just
621 // Which values have changed as a result of leader changes.
737 CongruenceClass *createCongruenceClass(Value *Leader, const Expression *E) { in createCongruenceClass() argument
738 auto *result = new CongruenceClass(NextCongruenceNum++, Leader, E); in createCongruenceClass()
1060 // Transform the operand array into an operand leader array, and keep track of in setBasicExpressionInfo()
1302 // The most likely candidates for dominance are the leader and the next leader. in someEquivalentDominates()
1303 // The leader or nextleader will dominate in all cases where there is an in someEquivalentDominates()
1313 // Depending on the rpo order picked, the leader could be the equivalent in in someEquivalentDominates()
1330 // See if we have a congruence class and leader for this operand, and if so,
1663 << " with current MemoryAccess leader "); in setMemoryClass()
1682 LLVM_DEBUG(dbgs() << "Memory class leader change for class " in setMemoryClass()
2117 // Mark users affected by a memory leader change.
2124 // leader change, and mark changed values.
2146 // This function returns the MemoryAccess that should be the next leader of
2147 // congruence class CC, under the assumption that the current leader is going to
2150 // TODO: If this ends up to slow, we can maintain a next memory leader like we in getNextMemoryLeader()
2152 // Make sure there will be a leader to find. in getNextMemoryLeader()
2153 assert(!CC->definesNoMemory() && "Can't get next leader if there is none"); in getNextMemoryLeader()
2171 // This function returns the next value leader of a congruence class, under the
2172 // assumption that the current leader is going away. This should end up being
2201 // - The OldClass memory leader has not been updated yet if I was the leader.
2206 // If the leader is I, and we had a representative MemoryAccess, it should in moveMemoryToNewCongruenceClass()
2215 // Should be a new class, or a store becoming a leader of a new class. in moveMemoryToNewCongruenceClass()
2220 LLVM_DEBUG(dbgs() << "Memory class leader change for class " in moveMemoryToNewCongruenceClass()
2222 << " due to new memory instruction becoming leader\n"); in moveMemoryToNewCongruenceClass()
2230 LLVM_DEBUG(dbgs() << "Memory class leader change for class " in moveMemoryToNewCongruenceClass()
2233 << " due to removal of old leader " << *InstMA << "\n"); in moveMemoryToNewCongruenceClass()
2256 // Okay, so when do we want to make a store a leader of a class? in moveValueToNewCongruenceClass()
2262 // as the leader in moveValueToNewCongruenceClass()
2269 // Shift the new class leader to be the store in moveValueToNewCongruenceClass()
2270 LLVM_DEBUG(dbgs() << "Changing leader of congruence class " in moveValueToNewCongruenceClass()
2274 // If we changed the leader, we have to mark it changed because we don't in moveValueToNewCongruenceClass()
2308 // When the leader changes, the value numbering of in moveValueToNewCongruenceClass()
2311 LLVM_DEBUG(dbgs() << "Value class leader change for class " in moveValueToNewCongruenceClass()
2359 // Constants and variables should always be made the leader. in performCongruenceFinding()
2377 << NewClass->getID() << " and leader " in performCongruenceFinding()
2390 "constant leader"); in performCongruenceFinding()
2651 // Try to find a leader for instruction TransInst, which is a phi translated
2766 // translated back into the predecessor, and see if we have a leader. in makePossiblePHIOfOps()
2778 // leader for us or not, so we have to add additional users. in makePossiblePHIOfOps()
2802 // We failed to find a leader for the current ValueOp, but this might in makePossiblePHIOfOps()
2871 // congruence class. The leader of TOP is the undetermined value `poison`.
3079 // a class where it is the leader (other things may be equivalent to it, but in valueNumberMemoryPhi()
3081 // leader, and it can't have stopped being the leader because it was never in valueNumberMemoryPhi()
3191 "Any class with a store as a leader should have a " in verifyMemoryCongruency()
3346 // This can happen when the leader of the stored value changes over time. in verifyStoreExpressions()
3597 // If it's a store, use the leader of the value operand, if it's always in convertClassToDFSOrdered()
3599 // find a dominating leader, but not worth it ATM. in convertClassToDFSOrdered()
3601 auto Leader = lookupOperandLeader(SI->getValueOperand()); in convertClassToDFSOrdered() local
3602 if (alwaysAvailable(Leader)) { in convertClassToDFSOrdered()
3603 VDDef.Def.setPointer(Leader); in convertClassToDFSOrdered()
3797 // see if the value has a leader available in that block.
3847 // When we find something not dominated, it becomes the new leader in eliminateInstructions()
3921 assert(CC->getLeader() && "We should have had a leader"); in eliminateInstructions()
3922 // If this is a leader that is always available, and it's a in eliminateInstructions()
3926 Value *Leader = in eliminateInstructions() local
3928 if (alwaysAvailable(Leader)) { in eliminateInstructions()
3933 if (Member == Leader || !isa<Instruction>(Member) || in eliminateInstructions()
3938 LLVM_DEBUG(dbgs() << "Found replacement " << *(Leader) << " for " in eliminateInstructions()
3941 assert(Leader != I && "About to accidentally remove our leader"); in eliminateInstructions()
3942 replaceInstruction(I, Leader); in eliminateInstructions()
3948 if (CC->size() != 1 || RealToTemp.count(Leader)) { in eliminateInstructions()
3951 // those constant values in preference to the current leader, over in eliminateInstructions()
4043 // flags/metadata due to downstreams users of the leader. in eliminateInstructions()
4099 // This is now a use of the dominating leader, which means if the in eliminateInstructions()
4100 // dominating leader was dead, it's now live! in eliminateInstructions()
4105 // For copy instructions, we use their operand as a leader, in eliminateInstructions()
4157 Instruction *Leader = cast<Instruction>(EliminationStack.back()); in eliminateInstructions() local
4158 (void)Leader; in eliminateInstructions()
4159 assert(DT->dominates(Leader->getParent(), Member->getParent())); in eliminateInstructions()
4160 // Member is dominater by Leader, and thus dead in eliminateInstructions()
4162 << " that is dominated by " << *Leader << "\n"); in eliminateInstructions()