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)
301 : ID(ID), RepLeader(Leader), DefiningExpr(E) {}
313 // Leader functions
315 void setLeader(Value *Leader) { RepLeader = Leader; }
326 void setStoredValue(Value *Leader) { RepStoredValue = Leader; }
328 void setMemoryLeader(const MemoryAccess *Leader) { RepMemoryAccess = Leader; }
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) {
738 auto *result = new CongruenceClass(NextCongruenceNum++, Leader, E);
1060 // Transform the operand array into an operand leader array, and keep track of
1302 // The most likely candidates for dominance are the leader and the next leader.
1303 // The leader or nextleader will dominate in all cases where there is an
1313 // Depending on the rpo order picked, the leader could be the equivalent in
1330 // See if we have a congruence class and leader for this operand, and if so,
1663 << " with current MemoryAccess leader ");
1682 LLVM_DEBUG(dbgs() << "Memory class leader change for class "
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
2152 // Make sure there will be a leader to find.
2153 assert(!CC->definesNoMemory() && "Can't get next leader if there is none");
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
2215 // Should be a new class, or a store becoming a leader of a new class.
2220 LLVM_DEBUG(dbgs() << "Memory class leader change for class "
2222 << " due to new memory instruction becoming leader\n");
2230 LLVM_DEBUG(dbgs() << "Memory class leader change for class "
2233 << " due to removal of old leader " << *InstMA << "\n");
2256 // Okay, so when do we want to make a store a leader of a class?
2262 // as the leader
2269 // Shift the new class leader to be the store
2270 LLVM_DEBUG(dbgs() << "Changing leader of congruence class "
2274 // If we changed the leader, we have to mark it changed because we don't
2308 // When the leader changes, the value numbering of
2311 LLVM_DEBUG(dbgs() << "Value class leader change for class "
2359 // Constants and variables should always be made the leader.
2377 << NewClass->getID() << " and leader "
2390 "constant leader");
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.
2778 // leader for us or not, so we have to add additional users.
2802 // We failed to find a leader for the current ValueOp, but this might
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
3081 // leader, and it can't have stopped being the leader because it was never
3191 "Any class with a store as a leader should have a "
3346 // This can happen when the leader of the stored value changes over time.
3597 // If it's a store, use the leader of the value operand, if it's always
3599 // find a dominating leader, but not worth it ATM.
3601 auto Leader = lookupOperandLeader(SI->getValueOperand());
3602 if (alwaysAvailable(Leader)) {
3603 VDDef.Def.setPointer(Leader);
3797 // see if the value has a leader available in that block.
3847 // When we find something not dominated, it becomes the new leader
3921 assert(CC->getLeader() && "We should have had a leader");
3922 // If this is a leader that is always available, and it's a
3926 Value *Leader =
3928 if (alwaysAvailable(Leader)) {
3933 if (Member == Leader || !isa<Instruction>(Member) ||
3938 LLVM_DEBUG(dbgs() << "Found replacement " << *(Leader) << " for "
3941 assert(Leader != I && "About to accidentally remove our leader");
3942 replaceInstruction(I, Leader);
3948 if (CC->size() != 1 || RealToTemp.count(Leader)) {
3951 // those constant values in preference to the current leader, over
4043 // flags/metadata due to downstreams users of the leader.
4099 // This is now a use of the dominating leader, which means if the
4100 // dominating leader was dead, it's now live!
4105 // For copy instructions, we use their operand as a leader,
4157 Instruction *Leader = cast<Instruction>(EliminationStack.back());
4158 (void)Leader;
4159 assert(DT->dominates(Leader->getParent(), Member->getParent()));
4160 // Member is dominater by Leader, and thus dead
4162 << " that is dominated by " << *Leader << "\n");