@@ -144,9 +144,7 @@ class MemoryDepChecker {
144144 // on MinDepDistBytes.
145145 BackwardVectorizable,
146146 // Same, but may prevent store-to-load forwarding.
147- BackwardVectorizableButPreventsForwarding,
148- // Access is to a loop loaded value, but is part of a histogram operation.
149- Histogram
147+ BackwardVectorizableButPreventsForwarding
150148 };
151149
152150 // / String version of the types.
@@ -203,8 +201,7 @@ class MemoryDepChecker {
203201 // / Only checks sets with elements in \p CheckDeps.
204202 bool areDepsSafe (DepCandidates &AccessSets, MemAccessInfoList &CheckDeps,
205203 const DenseMap<Value *, SmallVector<const Value *, 16 >>
206- &UnderlyingObjects,
207- const SmallPtrSetImpl<const Value *> &HistogramPtrs);
204+ &UnderlyingObjects);
208205
209206 // / No memory dependence was encountered that would inhibit
210207 // / vectorization.
@@ -355,8 +352,7 @@ class MemoryDepChecker {
355352 isDependent (const MemAccessInfo &A, unsigned AIdx, const MemAccessInfo &B,
356353 unsigned BIdx,
357354 const DenseMap<Value *, SmallVector<const Value *, 16 >>
358- &UnderlyingObjects,
359- const SmallPtrSetImpl<const Value *> &HistogramPtrs);
355+ &UnderlyingObjects);
360356
361357 // / Check whether the data dependence could prevent store-load
362358 // / forwarding.
@@ -397,8 +393,7 @@ class MemoryDepChecker {
397393 const MemAccessInfo &A, Instruction *AInst, const MemAccessInfo &B,
398394 Instruction *BInst,
399395 const DenseMap<Value *, SmallVector<const Value *, 16 >>
400- &UnderlyingObjects,
401- const SmallPtrSetImpl<const Value *> &HistogramPtrs);
396+ &UnderlyingObjects);
402397};
403398
404399class RuntimePointerChecking ;
@@ -450,15 +445,6 @@ struct PointerDiffInfo {
450445 NeedsFreeze (NeedsFreeze) {}
451446};
452447
453- struct HistogramInfo {
454- LoadInst *Load;
455- Instruction *Update;
456- StoreInst *Store;
457-
458- HistogramInfo (LoadInst *Load, Instruction *Update, StoreInst *Store)
459- : Load(Load), Update(Update), Store(Store) {}
460- };
461-
462448// / Holds information about the memory runtime legality checks to verify
463449// / that a group of pointers do not overlap.
464450class RuntimePointerChecking {
@@ -639,13 +625,6 @@ class RuntimePointerChecking {
639625// / Checks for both memory dependences and the SCEV predicates contained in the
640626// / PSE must be emitted in order for the results of this analysis to be valid.
641627class LoopAccessInfo {
642- // / Represents whether the memory access dependencies in the loop:
643- // / * Prohibit vectorization
644- // / * Allow for vectorization (possibly with runtime checks)
645- // / * Allow for vectorization (possibly with runtime checks),
646- // / as long as histogram operations are supported.
647- enum VecMemPossible { CantVec = 0 , NormalVec = 1 , HistogramVec = 2 };
648-
649628public:
650629 LoopAccessInfo (Loop *L, ScalarEvolution *SE, const TargetTransformInfo *TTI,
651630 const TargetLibraryInfo *TLI, AAResults *AA, DominatorTree *DT,
@@ -657,11 +636,7 @@ class LoopAccessInfo {
657636 // / hasStoreStoreDependenceInvolvingLoopInvariantAddress and
658637 // / hasLoadStoreDependenceInvolvingLoopInvariantAddress also need to be
659638 // / checked.
660- bool canVectorizeMemory () const { return CanVecMem == NormalVec; }
661-
662- bool canVectorizeMemoryWithHistogram () const {
663- return CanVecMem == NormalVec || CanVecMem == HistogramVec;
664- }
639+ bool canVectorizeMemory () const { return CanVecMem; }
665640
666641 // / Return true if there is a convergent operation in the loop. There may
667642 // / still be reported runtime pointer checks that would be required, but it is
@@ -689,10 +664,6 @@ class LoopAccessInfo {
689664 unsigned getNumStores () const { return NumStores; }
690665 unsigned getNumLoads () const { return NumLoads;}
691666
692- const SmallVectorImpl<HistogramInfo> &getHistograms () const {
693- return Histograms;
694- }
695-
696667 // / The diagnostics report generated for the analysis. E.g. why we
697668 // / couldn't analyze the loop.
698669 const OptimizationRemarkAnalysis *getReport () const { return Report.get (); }
@@ -744,8 +715,8 @@ class LoopAccessInfo {
744715private:
745716 // / Analyze the loop. Returns true if all memory access in the loop can be
746717 // / vectorized.
747- VecMemPossible analyzeLoop (AAResults *AA, LoopInfo *LI,
748- const TargetLibraryInfo *TLI, DominatorTree *DT);
718+ bool analyzeLoop (AAResults *AA, LoopInfo *LI, const TargetLibraryInfo *TLI ,
719+ DominatorTree *DT);
749720
750721 // / Check if the structure of the loop allows it to be analyzed by this
751722 // / pass.
@@ -786,7 +757,7 @@ class LoopAccessInfo {
786757 unsigned NumStores = 0 ;
787758
788759 // / Cache the result of analyzeLoop.
789- VecMemPossible CanVecMem = CantVec ;
760+ bool CanVecMem = false ;
790761 bool HasConvergentOp = false ;
791762
792763 // / Indicator that there are two non vectorizable stores to the same uniform
@@ -806,13 +777,6 @@ class LoopAccessInfo {
806777 // / If an access has a symbolic strides, this maps the pointer value to
807778 // / the stride symbol.
808779 DenseMap<Value *, const SCEV *> SymbolicStrides;
809-
810- // / Holds the load, update, and store instructions for all histogram-style
811- // / operations found in the loop.
812- SmallVector<HistogramInfo, 2 > Histograms;
813-
814- // / Storing Histogram Pointers
815- SmallPtrSet<const Value *, 2 > HistogramPtrs;
816780};
817781
818782// / Return the SCEV corresponding to a pointer with the symbolic stride
0 commit comments