@@ -144,9 +144,7 @@ class MemoryDepChecker {
144
144
// on MinDepDistBytes.
145
145
BackwardVectorizable,
146
146
// 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
150
148
};
151
149
152
150
// / String version of the types.
@@ -203,8 +201,7 @@ class MemoryDepChecker {
203
201
// / Only checks sets with elements in \p CheckDeps.
204
202
bool areDepsSafe (DepCandidates &AccessSets, MemAccessInfoList &CheckDeps,
205
203
const DenseMap<Value *, SmallVector<const Value *, 16 >>
206
- &UnderlyingObjects,
207
- const SmallPtrSetImpl<const Value *> &HistogramPtrs);
204
+ &UnderlyingObjects);
208
205
209
206
// / No memory dependence was encountered that would inhibit
210
207
// / vectorization.
@@ -355,8 +352,7 @@ class MemoryDepChecker {
355
352
isDependent (const MemAccessInfo &A, unsigned AIdx, const MemAccessInfo &B,
356
353
unsigned BIdx,
357
354
const DenseMap<Value *, SmallVector<const Value *, 16 >>
358
- &UnderlyingObjects,
359
- const SmallPtrSetImpl<const Value *> &HistogramPtrs);
355
+ &UnderlyingObjects);
360
356
361
357
// / Check whether the data dependence could prevent store-load
362
358
// / forwarding.
@@ -397,8 +393,7 @@ class MemoryDepChecker {
397
393
const MemAccessInfo &A, Instruction *AInst, const MemAccessInfo &B,
398
394
Instruction *BInst,
399
395
const DenseMap<Value *, SmallVector<const Value *, 16 >>
400
- &UnderlyingObjects,
401
- const SmallPtrSetImpl<const Value *> &HistogramPtrs);
396
+ &UnderlyingObjects);
402
397
};
403
398
404
399
class RuntimePointerChecking ;
@@ -450,15 +445,6 @@ struct PointerDiffInfo {
450
445
NeedsFreeze (NeedsFreeze) {}
451
446
};
452
447
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
-
462
448
// / Holds information about the memory runtime legality checks to verify
463
449
// / that a group of pointers do not overlap.
464
450
class RuntimePointerChecking {
@@ -639,13 +625,6 @@ class RuntimePointerChecking {
639
625
// / Checks for both memory dependences and the SCEV predicates contained in the
640
626
// / PSE must be emitted in order for the results of this analysis to be valid.
641
627
class 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
-
649
628
public:
650
629
LoopAccessInfo (Loop *L, ScalarEvolution *SE, const TargetTransformInfo *TTI,
651
630
const TargetLibraryInfo *TLI, AAResults *AA, DominatorTree *DT,
@@ -657,11 +636,7 @@ class LoopAccessInfo {
657
636
// / hasStoreStoreDependenceInvolvingLoopInvariantAddress and
658
637
// / hasLoadStoreDependenceInvolvingLoopInvariantAddress also need to be
659
638
// / 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; }
665
640
666
641
// / Return true if there is a convergent operation in the loop. There may
667
642
// / still be reported runtime pointer checks that would be required, but it is
@@ -689,10 +664,6 @@ class LoopAccessInfo {
689
664
unsigned getNumStores () const { return NumStores; }
690
665
unsigned getNumLoads () const { return NumLoads;}
691
666
692
- const SmallVectorImpl<HistogramInfo> &getHistograms () const {
693
- return Histograms;
694
- }
695
-
696
667
// / The diagnostics report generated for the analysis. E.g. why we
697
668
// / couldn't analyze the loop.
698
669
const OptimizationRemarkAnalysis *getReport () const { return Report.get (); }
@@ -744,8 +715,8 @@ class LoopAccessInfo {
744
715
private:
745
716
// / Analyze the loop. Returns true if all memory access in the loop can be
746
717
// / 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);
749
720
750
721
// / Check if the structure of the loop allows it to be analyzed by this
751
722
// / pass.
@@ -786,7 +757,7 @@ class LoopAccessInfo {
786
757
unsigned NumStores = 0 ;
787
758
788
759
// / Cache the result of analyzeLoop.
789
- VecMemPossible CanVecMem = CantVec ;
760
+ bool CanVecMem = false ;
790
761
bool HasConvergentOp = false ;
791
762
792
763
// / Indicator that there are two non vectorizable stores to the same uniform
@@ -806,13 +777,6 @@ class LoopAccessInfo {
806
777
// / If an access has a symbolic strides, this maps the pointer value to
807
778
// / the stride symbol.
808
779
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;
816
780
};
817
781
818
782
// / Return the SCEV corresponding to a pointer with the symbolic stride
0 commit comments