llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-llvm-analysis Author: Ryotaro Kasuga (kasuga-fj) <details> <summary>Changes</summary> `isPeelFirst` and `isPeelLast` are updated only in the Weak Zero SIV tests, and they are not used by any clients. I don't think it's worth to keep them around. It would be better to remove them to reduce confusion and maintenance overhead. --- Full diff: https://github.com/llvm/llvm-project/pull/183737.diff 4 Files Affected: - (modified) llvm/include/llvm/Analysis/DependenceAnalysis.h (+1-24) - (modified) llvm/lib/Analysis/DependenceAnalysis.cpp (-20) - (modified) llvm/test/Analysis/DependenceAnalysis/WeakZeroDstSIV.ll (+3-3) - (modified) llvm/test/Analysis/DependenceAnalysis/WeakZeroSrcSIV.ll (+3-3) ``````````diff diff --git a/llvm/include/llvm/Analysis/DependenceAnalysis.h b/llvm/include/llvm/Analysis/DependenceAnalysis.h index 49e5b88d9a548..b99b2f5960049 100644 --- a/llvm/include/llvm/Analysis/DependenceAnalysis.h +++ b/llvm/include/llvm/Analysis/DependenceAnalysis.h @@ -105,11 +105,8 @@ class LLVM_ABI Dependence { }; unsigned char Direction : 3; // Init to ALL, then refine. bool Scalar : 1; // Init to true. - bool PeelFirst : 1; // Peeling the first iteration will break dependence. - bool PeelLast : 1; // Peeling the last iteration will break the dependence. const SCEV *Distance = nullptr; // NULL implies no distance available. - DVEntry() - : Direction(ALL), Scalar(true), PeelFirst(false), PeelLast(false) {} + DVEntry() : Direction(ALL), Scalar(true) {} }; /// getSrc - Returns the source instruction for this dependence. @@ -182,18 +179,6 @@ class LLVM_ABI Dependence { /// in the vector. virtual bool normalize(ScalarEvolution *SE) { return false; } - /// isPeelFirst - Returns true if peeling the first iteration from - /// this regular or SameSD loop level will break this dependence. - virtual bool isPeelFirst(unsigned Level, bool SameSD = false) const { - return false; - } - - /// isPeelLast - Returns true if peeling the last iteration from - /// this regular or SameSD loop level will break this dependence. - virtual bool isPeelLast(unsigned Level, bool SameSD = false) const { - return false; - } - /// inSameSDLoops - Returns true if this level is an SameSD level, i.e., /// performed across two separate loop nests that have the Same Iteration and /// Depth. @@ -304,14 +289,6 @@ class LLVM_ABI FullDependence final : public Dependence { /// in the vector. bool normalize(ScalarEvolution *SE) override; - /// isPeelFirst - Returns true if peeling the first iteration from - /// this regular or SameSD loop level will break this dependence. - bool isPeelFirst(unsigned Level, bool SameSD = false) const override; - - /// isPeelLast - Returns true if peeling the last iteration from - /// this regular or SameSD loop level will break this dependence. - bool isPeelLast(unsigned Level, bool SameSD = false) const override; - /// inSameSDLoops - Returns true if this level is an SameSD level, i.e., /// performed across two separate loop nests that have the Same Iteration and /// Depth. diff --git a/llvm/lib/Analysis/DependenceAnalysis.cpp b/llvm/lib/Analysis/DependenceAnalysis.cpp index 9ba451ba69a17..b9be42e5ad792 100644 --- a/llvm/lib/Analysis/DependenceAnalysis.cpp +++ b/llvm/lib/Analysis/DependenceAnalysis.cpp @@ -672,18 +672,6 @@ bool FullDependence::isScalar(unsigned Level, bool IsSameSD) const { return getDVEntry(Level, IsSameSD).Scalar; } -// Returns true if peeling the first iteration from this regular or SameSD -// loop level will break this dependence. -bool FullDependence::isPeelFirst(unsigned Level, bool IsSameSD) const { - return getDVEntry(Level, IsSameSD).PeelFirst; -} - -// Returns true if peeling the last iteration from this regular or SameSD -// loop level will break this dependence. -bool FullDependence::isPeelLast(unsigned Level, bool IsSameSD) const { - return getDVEntry(Level, IsSameSD).PeelLast; -} - // inSameSDLoops - Returns true if this level is an SameSD level, i.e., // performed across two separate loop nests that have the Same iteration space // and Depth. @@ -817,8 +805,6 @@ void Dependence::dumpImp(raw_ostream &OS, bool IsSameSD) const { for (unsigned II = 1; II <= LevelNum; ++II) { if (!OnSameSD && inSameSDLoops(II)) OnSameSD = true; - if (isPeelFirst(II, OnSameSD)) - OS << 'p'; const SCEV *Distance = getDistance(II, OnSameSD); if (Distance) OS << *Distance; @@ -837,8 +823,6 @@ void Dependence::dumpImp(raw_ostream &OS, bool IsSameSD) const { OS << ">"; } } - if (isPeelLast(II, OnSameSD)) - OS << 'p'; if (II < LevelNum) OS << " "; } @@ -1862,7 +1846,6 @@ bool DependenceInfo::weakZeroSrcSIVtest(const SCEV *DstCoeff, SE->isKnownNonZero(DstCoeff)) { if (Level < CommonLevels) { Result.DV[Level].Direction &= Dependence::DVEntry::GE; - Result.DV[Level].PeelFirst = true; ++WeakZeroSIVsuccesses; } return false; // dependences caused by first iteration @@ -1894,7 +1877,6 @@ bool DependenceInfo::weakZeroSrcSIVtest(const SCEV *DstCoeff, // dependences caused by last iteration if (Level < CommonLevels) { Result.DV[Level].Direction &= Dependence::DVEntry::LE; - Result.DV[Level].PeelLast = true; ++WeakZeroSIVsuccesses; } return false; @@ -1976,7 +1958,6 @@ bool DependenceInfo::weakZeroDstSIVtest(const SCEV *SrcCoeff, SE->isKnownNonZero(SrcCoeff)) { if (Level < CommonLevels) { Result.DV[Level].Direction &= Dependence::DVEntry::LE; - Result.DV[Level].PeelFirst = true; ++WeakZeroSIVsuccesses; } return false; // dependences caused by first iteration @@ -2008,7 +1989,6 @@ bool DependenceInfo::weakZeroDstSIVtest(const SCEV *SrcCoeff, // dependences caused by last iteration if (Level < CommonLevels) { Result.DV[Level].Direction &= Dependence::DVEntry::GE; - Result.DV[Level].PeelLast = true; ++WeakZeroSIVsuccesses; } return false; diff --git a/llvm/test/Analysis/DependenceAnalysis/WeakZeroDstSIV.ll b/llvm/test/Analysis/DependenceAnalysis/WeakZeroDstSIV.ll index f5318b36cca03..0bb5b0aaf7ec8 100644 --- a/llvm/test/Analysis/DependenceAnalysis/WeakZeroDstSIV.ll +++ b/llvm/test/Analysis/DependenceAnalysis/WeakZeroDstSIV.ll @@ -16,7 +16,7 @@ define void @dstzero(ptr nocapture %A, i32 %N) { ; CHECK-NEXT: Src: store i32 0, ptr %arrayidx, align 4 --> Dst: store i32 0, ptr %arrayidx, align 4 ; CHECK-NEXT: da analyze - none! ; CHECK-NEXT: Src: store i32 0, ptr %arrayidx, align 4 --> Dst: store i32 1, ptr %A, align 4 -; CHECK-NEXT: da analyze - output [p<=|<]! +; CHECK-NEXT: da analyze - output [<=|<]! ; CHECK-NEXT: Src: store i32 1, ptr %A, align 4 --> Dst: store i32 1, ptr %A, align 4 ; CHECK-NEXT: da analyze - consistent output [S]! ; @@ -49,7 +49,7 @@ define void @weakzerodst0(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp { ; CHECK-NEXT: Src: store i32 %conv, ptr %arrayidx, align 4 --> Dst: store i32 %conv, ptr %arrayidx, align 4 ; CHECK-NEXT: da analyze - none! ; CHECK-NEXT: Src: store i32 %conv, ptr %arrayidx, align 4 --> Dst: %0 = load i32, ptr %arrayidx1, align 4 -; CHECK-NEXT: da analyze - flow [p<=|<]! +; CHECK-NEXT: da analyze - flow [<=|<]! ; CHECK-NEXT: Src: store i32 %conv, ptr %arrayidx, align 4 --> Dst: store i32 %0, ptr %B.addr.01, align 4 ; CHECK-NEXT: da analyze - confused! ; CHECK-NEXT: Src: %0 = load i32, ptr %arrayidx1, align 4 --> Dst: %0 = load i32, ptr %arrayidx1, align 4 @@ -186,7 +186,7 @@ define void @weakzerodst3(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp { ; CHECK-NEXT: Src: store i32 %conv, ptr %arrayidx, align 4 --> Dst: store i32 %conv, ptr %arrayidx, align 4 ; CHECK-NEXT: da analyze - none! ; CHECK-NEXT: Src: store i32 %conv, ptr %arrayidx, align 4 --> Dst: %0 = load i32, ptr %arrayidx1, align 4 -; CHECK-NEXT: da analyze - flow [=>p|<]! +; CHECK-NEXT: da analyze - flow [=>|<]! ; CHECK-NEXT: Src: store i32 %conv, ptr %arrayidx, align 4 --> Dst: store i32 %0, ptr %B.addr.01, align 4 ; CHECK-NEXT: da analyze - confused! ; CHECK-NEXT: Src: %0 = load i32, ptr %arrayidx1, align 4 --> Dst: %0 = load i32, ptr %arrayidx1, align 4 diff --git a/llvm/test/Analysis/DependenceAnalysis/WeakZeroSrcSIV.ll b/llvm/test/Analysis/DependenceAnalysis/WeakZeroSrcSIV.ll index cf02307f83eb8..aac529760f50c 100644 --- a/llvm/test/Analysis/DependenceAnalysis/WeakZeroSrcSIV.ll +++ b/llvm/test/Analysis/DependenceAnalysis/WeakZeroSrcSIV.ll @@ -16,7 +16,7 @@ define void @dstzero(ptr nocapture %A, i32 %N) { ; CHECK-NEXT: Src: store i32 0, ptr %A, align 4 --> Dst: store i32 0, ptr %A, align 4 ; CHECK-NEXT: da analyze - consistent output [S]! ; CHECK-NEXT: Src: store i32 0, ptr %A, align 4 --> Dst: store i32 1, ptr %arrayidx1, align 4 -; CHECK-NEXT: da analyze - output [p=>|<]! +; CHECK-NEXT: da analyze - output [=>|<]! ; CHECK-NEXT: Src: store i32 1, ptr %arrayidx1, align 4 --> Dst: store i32 1, ptr %arrayidx1, align 4 ; CHECK-NEXT: da analyze - none! ; @@ -47,7 +47,7 @@ define void @weakzerosrc0(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp { ; CHECK-NEXT: Src: store i32 %conv, ptr %arrayidx, align 4 --> Dst: store i32 %conv, ptr %arrayidx, align 4 ; CHECK-NEXT: da analyze - consistent output [S]! ; CHECK-NEXT: Src: store i32 %conv, ptr %arrayidx, align 4 --> Dst: %0 = load i32, ptr %arrayidx1, align 4 -; CHECK-NEXT: da analyze - flow [p=>|<]! +; CHECK-NEXT: da analyze - flow [=>|<]! ; CHECK-NEXT: Src: store i32 %conv, ptr %arrayidx, align 4 --> Dst: store i32 %0, ptr %B.addr.01, align 4 ; CHECK-NEXT: da analyze - confused! ; CHECK-NEXT: Src: %0 = load i32, ptr %arrayidx1, align 4 --> Dst: %0 = load i32, ptr %arrayidx1, align 4 @@ -184,7 +184,7 @@ define void @weakzerosrc3(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp { ; CHECK-NEXT: Src: store i32 %conv, ptr %arrayidx, align 4 --> Dst: store i32 %conv, ptr %arrayidx, align 4 ; CHECK-NEXT: da analyze - consistent output [S]! ; CHECK-NEXT: Src: store i32 %conv, ptr %arrayidx, align 4 --> Dst: %0 = load i32, ptr %arrayidx1, align 4 -; CHECK-NEXT: da analyze - flow [<=p|<]! +; CHECK-NEXT: da analyze - flow [<=|<]! ; CHECK-NEXT: Src: store i32 %conv, ptr %arrayidx, align 4 --> Dst: store i32 %0, ptr %B.addr.01, align 4 ; CHECK-NEXT: da analyze - confused! ; CHECK-NEXT: Src: %0 = load i32, ptr %arrayidx1, align 4 --> Dst: %0 = load i32, ptr %arrayidx1, align 4 `````````` </details> https://github.com/llvm/llvm-project/pull/183737 _______________________________________________ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
