File tree Expand file tree Collapse file tree 4 files changed +16
-13
lines changed Expand file tree Collapse file tree 4 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -160,9 +160,9 @@ class MemoryDepChecker {
160160 : Source(Source), Destination(Destination), Type(Type) {}
161161
162162 // / Return the source instruction of the dependence.
163- Instruction *getSource (const LoopAccessInfo &LAI ) const ;
163+ Instruction *getSource (const MemoryDepChecker &DepChecker ) const ;
164164 // / Return the destination instruction of the dependence.
165- Instruction *getDestination (const LoopAccessInfo &LAI ) const ;
165+ Instruction *getDestination (const MemoryDepChecker &DepChecker ) const ;
166166
167167 // / Dependence types that don't prevent vectorization.
168168 static VectorizationSafetyStatus isSafeForVectorization (DepType Type);
@@ -833,13 +833,13 @@ class LoopAccessAnalysis
833833};
834834
835835inline 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];
838838}
839839
840840inline 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];
843843}
844844
845845} // End llvm namespace
Original file line number Diff line number Diff line change @@ -795,9 +795,11 @@ class InterleavedAccessInfo {
795795 void collectDependences () {
796796 if (!areDependencesValid ())
797797 return ;
798- auto *Deps = LAI->getDepChecker ().getDependences ();
798+ const auto &DepChecker = LAI->getDepChecker ();
799+ auto *Deps = DepChecker.getDependences ();
799800 for (auto Dep : *Deps)
800- Dependences[Dep.getSource (*LAI)].insert (Dep.getDestination (*LAI));
801+ Dependences[Dep.getSource (DepChecker)].insert (
802+ Dep.getDestination (DepChecker));
801803 }
802804};
803805
Original file line number Diff line number Diff line change @@ -2726,7 +2726,7 @@ void LoopAccessInfo::emitUnsafeDependenceRemark() {
27262726 " to attempt to isolate the offending operations into a separate "
27272727 " loop" ;
27282728 OptimizationRemarkAnalysis &R =
2729- recordAnalysis (" UnsafeDep" , Dep.getDestination (* this )) << Info;
2729+ recordAnalysis (" UnsafeDep" , Dep.getDestination (getDepChecker () )) << Info;
27302730
27312731 switch (Dep.Type ) {
27322732 case MemoryDepChecker::Dependence::NoDep:
@@ -2752,7 +2752,7 @@ void LoopAccessInfo::emitUnsafeDependenceRemark() {
27522752 break ;
27532753 }
27542754
2755- if (Instruction *I = Dep.getSource (* this )) {
2755+ if (Instruction *I = Dep.getSource (getDepChecker () )) {
27562756 DebugLoc SourceLoc = I->getDebugLoc ();
27572757 if (auto *DD = dyn_cast_or_null<Instruction>(getPointerOperand (I)))
27582758 SourceLoc = DD->getDebugLoc ();
Original file line number Diff line number Diff line change @@ -183,7 +183,8 @@ class LoadEliminationForLoop {
183183 findStoreToLoadDependences (const LoopAccessInfo &LAI) {
184184 std::forward_list<StoreToLoadForwardingCandidate> Candidates;
185185
186- const auto *Deps = LAI.getDepChecker ().getDependences ();
186+ const auto &DepChecker = LAI.getDepChecker ();
187+ const auto *Deps = DepChecker.getDependences ();
187188 if (!Deps)
188189 return Candidates;
189190
@@ -194,8 +195,8 @@ class LoadEliminationForLoop {
194195 SmallPtrSet<Instruction *, 4 > LoadsWithUnknownDepedence;
195196
196197 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 );
199200
200201 if (Dep.Type == MemoryDepChecker::Dependence::Unknown ||
201202 Dep.Type == MemoryDepChecker::Dependence::IndirectUnsafe) {
You can’t perform that action at this time.
0 commit comments