Lines Matching full:stores
48 STATISTIC(NumStoresMerged, "Number of stores merged");
306 // Try to merge all the stores in the vector, splitting into separate segments
308 assert(StoresToMerge.size() > 1 && "Expected multiple stores to merge");
326 // Compute the biggest store we can generate to handle the number of stores.
360 bool LoadStoreOpt::doSingleStoreMerge(SmallVectorImpl<GStore *> &Stores) {
361 assert(Stores.size() > 1);
362 // We know that all the stores are consecutive and there are no aliasing
367 GStore *FirstStore = Stores[0];
368 const unsigned NumStores = Stores.size();
374 DebugLoc MergedLoc = Stores.front()->getDebugLoc();
375 for (auto *Store : drop_begin(Stores))
378 Builder.setInstr(*Stores.back());
385 for (auto *Store : Stores) {
419 LLVM_DEBUG(dbgs() << "Merged " << Stores.size()
420 << " stores into merged store: " << *NewStore);
421 LLVM_DEBUG(for (auto *MI : Stores) dbgs() << " " << *MI;);
422 NumStoresMerged += Stores.size();
429 R << "Merged " << NV("NumMerged", Stores.size()) << " stores of "
436 for (auto *MI : Stores)
442 if (C.Stores.size() < 2) {
447 LLVM_DEBUG(dbgs() << "Checking store merge candidate with " << C.Stores.size()
448 << " stores, starting with " << *C.Stores[0]);
449 // We know that the stores in the candidate are adjacent.
451 // during the search alias with load/stores added to the candidate after.
453 // C.Stores = [ST1, ST2, ST3, ST4]
484 for (int StoreIdx = C.Stores.size() - 1; StoreIdx >= 0; --StoreIdx) {
485 auto *CheckStore = C.Stores[StoreIdx];
492 << " stores remaining after alias checks. Merging...\n");
494 // Now we've checked for aliasing hazards, merge any stores left.
503 if (C.Stores.empty())
505 return llvm::any_of(C.Stores, [&](MachineInstr *OtherMI) {
511 PotentialAliases.emplace_back(std::make_pair(&MI, Stores.size() - 1));
525 // Don't allow truncating stores for now.
529 // Avoid adding volatile or ordered stores to the candidate. We already have a
538 if (C.Stores.empty()) {
551 C.Stores.emplace_back(&StoreMI);
558 if (MRI->getType(C.Stores[0]->getValueReg()).getSizeInBits() !=
562 if (MRI->getType(C.Stores[0]->getPointerReg()).getAddressSpace() !=
566 // There are other stores in the candidate. Check that the store address
579 C.Stores.emplace_back(&StoreMI);
608 // If we don't have any stores yet, this instruction can't pose a problem.
609 if (Candidate.Stores.empty())
615 Candidate.Stores.clear();
629 // Record this instruction as a potential alias for future stores that are
692 /// stores. Fold it into a single store or a BSWAP and a store if the targets
717 // We only handle merging simple stores of 1-4 bytes.
731 // We do a simple search for mergeable stores prior to this one.
743 // The single base pointer that all stores must use.
824 // We didn't find enough stores to merge into the size of the original
842 // to merge the stores.
899 // Erase the old stores.
909 SmallVector<GStore *, 16> Stores;
911 // Walk up the block so we can see the most eligible stores.
914 Stores.emplace_back(StoreMI);
916 for (auto *StoreMI : Stores) {
947 // We record this because we don't want to bother trying to merge stores into
961 // We assume that we're not going to be generating any stores wider than