Lines Matching full:slices

587 /// Representation of the alloca slices.
589 /// This class represents the slices of an alloca which are formed by its
591 /// for the slices used and we reflect that in this structure. The uses are
592 /// stored, sorted by increasing beginning offset and with unsplittable slices
593 /// starting at a particular offset before splittable slices.
596 /// Construct the slices of a particular alloca.
601 /// If this is true, the slices are never fully built and should be
606 /// Support for iterating over the slices.
611 iterator begin() { return Slices.begin(); }
612 iterator end() { return Slices.end(); }
617 const_iterator begin() const { return Slices.begin(); }
618 const_iterator end() const { return Slices.end(); }
621 /// Erase a range of slices.
622 void erase(iterator Start, iterator Stop) { Slices.erase(Start, Stop); }
624 /// Insert new slices for this alloca.
626 /// This moves the slices into the alloca's slices collection, and re-sorts
627 /// everything so that the usual ordering properties of the alloca's slices
630 int OldSize = Slices.size();
631 Slices.append(NewSlices.begin(), NewSlices.end());
632 auto SliceI = Slices.begin() + OldSize;
633 std::stable_sort(SliceI, Slices.end());
634 std::inplace_merge(Slices.begin(), SliceI, Slices.end());
681 /// of slices.
684 /// store a pointer to that here and abort trying to form slices of the
685 /// alloca. This will be null if the alloca slices are analyzed successfully.
689 /// The slices of the alloca.
691 /// We store a vector of the slices formed by uses of the alloca here. This
693 /// slices before the splittable ones. See the Slice inner class for more
695 SmallVector<Slice, 8> Slices;
719 /// A partition of the slices.
721 /// An ephemeral representation for a range of slices which can be viewed as
723 /// memory which cannot be split, and provides access to all of the slices
726 /// Objects of this type are produced by traversing the alloca's slices, but
752 /// All of the contained slices start at or after this offset.
757 /// All of the contained slices end at or before this offset.
768 /// Test whether this partition contains no slices, and merely spans
769 /// a region occupied by split slices.
772 /// \name Iterate slices that start within the partition.
787 /// These tails are of slices which start before this partition but are
795 /// An iterator over partitions of the alloca's slices.
798 /// slices. It is a forward iterator as we don't support backtracking for
800 /// current set of split slices.
813 /// We need to keep the end of the slices to know when to stop.
832 /// Requires that the iterator not be at the end of the slices.
835 "Cannot advance past the end of the slices!");
865 assert(P.SplitTails.empty() && "Failed to clear the split slices!");
872 // Accumulate all the splittable slices which started in the old
884 // If P.SI is now at the end, we at most have a tail of split slices.
891 // If the we have split slices and the next slice is after a gap and is
893 // slices up until the next slice begins.
902 // OK, we need to consume new slices. Set the end offset based on the
905 // pre-existing split slices that are continuing, in which case we begin
918 // Form a partition including all of the overlapping slices with this
936 // Collect all of the overlapping splittable slices.
945 // a partition spanning only splittable slices.
958 // the emptiness of the split slices. The latter is only relevant when
960 // slices list, but the prior may have the same P.SI and a tail of split
961 // slices.
964 "Same set of slices formed two different sized partitions!");
981 /// A forward range over the partitions of the alloca's slices.
984 /// slices. It computes these partitions on the fly based on the overlapping
985 /// offsets of the slices and the ability to split them. It will visit "empty"
987 /// slices.
1014 /// Builder for the alloca slices.
1016 /// This class builds a set of alloca slices by recursively visiting the uses
1078 AS.Slices.push_back(Slice(BeginOffset, EndOffset, U, IsSplittable));
1202 AS.Slices[MTPI->second].kill();
1224 MemTransferSliceMap.insert(std::make_pair(&II, AS.Slices.size()));
1227 Slice &PrevP = AS.Slices[PrevIdx];
1245 assert(AS.Slices[PrevIdx].getUse()->getUser() == &II &&
1431 llvm::erase_if(Slices, [](const Slice &S) { return S.isDead(); });
1435 llvm::stable_sort(Slices);
1461 OS << "Can't analyze slices for alloca: " << AI << "\n"
1470 OS << "Slices of alloca: " << AI << "\n";
1483 /// sequence of slices.
1492 // always get consistent results regardless of the order of slices.
1522 // To avoid depending on the order of slices, Ty and TyIsCommon must not
2116 /// (and thus isVectorPromotionViable) over all slices of the alloca for the
2145 /// all slices of the alloca for the given VectorType.
2268 /// Test whether the given alloca partitioning and range of slices can be
2371 // larger than other load/store slices (RelEnd > Size). But lifetime are
2372 // always promotable and should not impact other slices' promotability of the
2475 // FIXME: We shouldn't consider split slices that happen to start in the
2777 // interchangeably for unsplit slices.
4370 // all the slices that end up split.
4453 // Now scan the already split slices, and add a split for any of them which
4537 // Collect the new slices which we will merge into the alloca slices.
4550 // load in a parallel structure. We also build the slices for them and append
4551 // them to the alloca slices.
4809 // Remove the killed slices that have ben pre-split.
4812 // Insert our new slices. This will sort and merge them into the sorted
4816 LLVM_DEBUG(dbgs() << " Pre-split slices:\n");
4950 // Now that we've processed all the slices in the new partition, check if any
5258 /// Walks the slices of an alloca and form partitions based on them,
5273 // We leave a slice splittable if all other slices are disjoint or fully
5498 // Look through each "partition", looking for slices with the same start/end
5499 // that do not overlap with any before them. The slices are sorted by
5501 // sophisticated algorithm that takes splittable slices into account.
5539 // So long as all the slices start and end offsets matched, update loads to
5564 /// the slices of the alloca, and then hands it off to be split and
5595 // Build the slices using a recursive instruction-visiting builder.
5624 // No slices to split. Leave the dead alloca for a later pass to clean up.