File tree 4 files changed +16
-13
lines changed 4 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -160,9 +160,9 @@ class MemoryDepChecker {
160
160
: Source(Source), Destination(Destination), Type(Type) {}
161
161
162
162
// / Return the source instruction of the dependence.
163
- Instruction *getSource (const LoopAccessInfo &LAI ) const ;
163
+ Instruction *getSource (const MemoryDepChecker &DepChecker ) const ;
164
164
// / Return the destination instruction of the dependence.
165
- Instruction *getDestination (const LoopAccessInfo &LAI ) const ;
165
+ Instruction *getDestination (const MemoryDepChecker &DepChecker ) const ;
166
166
167
167
// / Dependence types that don't prevent vectorization.
168
168
static VectorizationSafetyStatus isSafeForVectorization (DepType Type);
@@ -833,13 +833,13 @@ class LoopAccessAnalysis
833
833
};
834
834
835
835
inline Instruction *MemoryDepChecker::Dependence::getSource (
836
- const LoopAccessInfo &LAI ) const {
837
- return LAI. getDepChecker () .getMemoryInstructions ()[Source];
836
+ const MemoryDepChecker &DepChecker ) const {
837
+ return DepChecker .getMemoryInstructions ()[Source];
838
838
}
839
839
840
840
inline Instruction *MemoryDepChecker::Dependence::getDestination (
841
- const LoopAccessInfo &LAI ) const {
842
- return LAI. getDepChecker () .getMemoryInstructions ()[Destination];
841
+ const MemoryDepChecker &DepChecker ) const {
842
+ return DepChecker .getMemoryInstructions ()[Destination];
843
843
}
844
844
845
845
} // End llvm namespace
Original file line number Diff line number Diff line change @@ -795,9 +795,11 @@ class InterleavedAccessInfo {
795
795
void collectDependences () {
796
796
if (!areDependencesValid ())
797
797
return ;
798
- auto *Deps = LAI->getDepChecker ().getDependences ();
798
+ const auto &DepChecker = LAI->getDepChecker ();
799
+ auto *Deps = DepChecker.getDependences ();
799
800
for (auto Dep : *Deps)
800
- Dependences[Dep.getSource (*LAI)].insert (Dep.getDestination (*LAI));
801
+ Dependences[Dep.getSource (DepChecker)].insert (
802
+ Dep.getDestination (DepChecker));
801
803
}
802
804
};
803
805
Original file line number Diff line number Diff line change @@ -2726,7 +2726,7 @@ void LoopAccessInfo::emitUnsafeDependenceRemark() {
2726
2726
" to attempt to isolate the offending operations into a separate "
2727
2727
" loop" ;
2728
2728
OptimizationRemarkAnalysis &R =
2729
- recordAnalysis (" UnsafeDep" , Dep.getDestination (* this )) << Info;
2729
+ recordAnalysis (" UnsafeDep" , Dep.getDestination (getDepChecker () )) << Info;
2730
2730
2731
2731
switch (Dep.Type ) {
2732
2732
case MemoryDepChecker::Dependence::NoDep:
@@ -2752,7 +2752,7 @@ void LoopAccessInfo::emitUnsafeDependenceRemark() {
2752
2752
break ;
2753
2753
}
2754
2754
2755
- if (Instruction *I = Dep.getSource (* this )) {
2755
+ if (Instruction *I = Dep.getSource (getDepChecker () )) {
2756
2756
DebugLoc SourceLoc = I->getDebugLoc ();
2757
2757
if (auto *DD = dyn_cast_or_null<Instruction>(getPointerOperand (I)))
2758
2758
SourceLoc = DD->getDebugLoc ();
Original file line number Diff line number Diff line change @@ -183,7 +183,8 @@ class LoadEliminationForLoop {
183
183
findStoreToLoadDependences (const LoopAccessInfo &LAI) {
184
184
std::forward_list<StoreToLoadForwardingCandidate> Candidates;
185
185
186
- const auto *Deps = LAI.getDepChecker ().getDependences ();
186
+ const auto &DepChecker = LAI.getDepChecker ();
187
+ const auto *Deps = DepChecker.getDependences ();
187
188
if (!Deps)
188
189
return Candidates;
189
190
@@ -194,8 +195,8 @@ class LoadEliminationForLoop {
194
195
SmallPtrSet<Instruction *, 4 > LoadsWithUnknownDepedence;
195
196
196
197
for (const auto &Dep : *Deps) {
197
- Instruction *Source = Dep.getSource (LAI );
198
- Instruction *Destination = Dep.getDestination (LAI );
198
+ Instruction *Source = Dep.getSource (DepChecker );
199
+ Instruction *Destination = Dep.getDestination (DepChecker );
199
200
200
201
if (Dep.Type == MemoryDepChecker::Dependence::Unknown ||
201
202
Dep.Type == MemoryDepChecker::Dependence::IndirectUnsafe) {
You can’t perform that action at this time.
0 commit comments