[llvm] [LoopInterchange] Update the direction of undistributed loop to EQ (PR #78951)
Madhur Amilkanthwar via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 17 10:30:59 PDT 2024
================
@@ -82,6 +82,101 @@ static void printDepMatrix(CharMatrix &DepMatrix) {
}
#endif
+static bool isDirectionNegative(std::vector<Dependence::DVEntry> &DV) {
+ for (unsigned Level = 1; Level <= DV.size(); ++Level) {
+ unsigned char Direction = DV[Level - 1].Direction;
+ if (Direction == Dependence::DVEntry::EQ)
+ continue;
+ if (Direction == Dependence::DVEntry::GT ||
+ Direction == Dependence::DVEntry::GE)
+ return true;
+ return false;
+ }
+ return false;
+}
+
+static void dumpDirection(raw_ostream &OS,
+ std::vector<Dependence::DVEntry> &DV) {
+ OS << " [";
+ for (unsigned II = 1; II <= DV.size(); ++II) {
----------------
madhur13490 wrote:
I feel that we can start from 0 and avoid subtracting 1 each time we access `DV` but I understand that this is practice in `DA`.
https://github.com/llvm/llvm-project/pull/78951
More information about the llvm-commits
mailing list