[llvm] 267e852 - [SandboxVec][DAG][NFC] Rename enumerators

Vasileios Porpodas via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 8 20:23:15 PDT 2024


Author: Vasileios Porpodas
Date: 2024-10-08T20:01:43-07:00
New Revision: 267e852109381fe35cff0a92915a0418b872213f

URL: https://github.com/llvm/llvm-project/commit/267e852109381fe35cff0a92915a0418b872213f
DIFF: https://github.com/llvm/llvm-project/commit/267e852109381fe35cff0a92915a0418b872213f.diff

LOG: [SandboxVec][DAG][NFC] Rename enumerators

Added: 
    

Modified: 
    llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h
    llvm/lib/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h
index ab49c3aa27143c..b1fe67d446be0a 100644
--- a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h
+++ b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h
@@ -171,13 +171,13 @@ class DependencyGraph {
   std::unique_ptr<BatchAAResults> BatchAA;
 
   enum class DependencyType {
-    RAW,   ///> Read After Write
-    WAW,   ///> Write After Write
-    RAR,   ///> Read After Read
-    WAR,   ///> Write After Read
-    CTRL,  ///> Control-related dependencies, like with PHIs/Terminators
-    OTHER, ///> Currently used for stack related instrs
-    NONE,  ///> No memory/other dependency
+    ReadAfterWrite,  ///> Memory dependency write -> read
+    WriteAfterWrite, ///> Memory dependency write -> write
+    ReadAfterRead,   ///> Memory dependency read -> read
+    WriteAfterRead,  ///> Memory dependency read -> write
+    Control,         ///> Control-related dependency, like with PHI/Terminator
+    Other,           ///> Currently used for stack related instrs
+    None,            ///> No memory/other dependency
   };
   /// \Returns the dependency type depending on whether instructions may
   /// read/write memory or whether they are some specific opcode-related

diff  --git a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.cpp b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.cpp
index 845fadefc9bf03..35ea28697424a6 100644
--- a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.cpp
+++ b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.cpp
@@ -56,23 +56,23 @@ DependencyGraph::getRoughDepType(Instruction *FromI, Instruction *ToI) {
   // TODO: Perhaps compile-time improvement by skipping if neither is mem?
   if (FromI->mayWriteToMemory()) {
     if (ToI->mayReadFromMemory())
-      return DependencyType::RAW;
+      return DependencyType::ReadAfterWrite;
     if (ToI->mayWriteToMemory())
-      return DependencyType::WAW;
+      return DependencyType::WriteAfterWrite;
   } else if (FromI->mayReadFromMemory()) {
     if (ToI->mayWriteToMemory())
-      return DependencyType::WAR;
+      return DependencyType::WriteAfterRead;
     if (ToI->mayReadFromMemory())
-      return DependencyType::RAR;
+      return DependencyType::ReadAfterRead;
   }
   if (isa<sandboxir::PHINode>(FromI) || isa<sandboxir::PHINode>(ToI))
-    return DependencyType::CTRL;
+    return DependencyType::Control;
   if (ToI->isTerminator())
-    return DependencyType::CTRL;
+    return DependencyType::Control;
   if (DGNode::isStackSaveOrRestoreIntrinsic(FromI) ||
       DGNode::isStackSaveOrRestoreIntrinsic(ToI))
-    return DependencyType::OTHER;
-  return DependencyType::NONE;
+    return DependencyType::Other;
+  return DependencyType::None;
 }
 
 static bool isOrdered(Instruction *I) {
@@ -106,10 +106,10 @@ bool DependencyGraph::alias(Instruction *SrcI, Instruction *DstI,
           ? ModRefInfo::Mod
           : Utils::aliasAnalysisGetModRefInfo(*BatchAA, SrcI, *DstLocOpt);
   switch (DepType) {
-  case DependencyType::RAW:
-  case DependencyType::WAW:
+  case DependencyType::ReadAfterWrite:
+  case DependencyType::WriteAfterWrite:
     return isModSet(SrcModRef);
-  case DependencyType::WAR:
+  case DependencyType::WriteAfterRead:
     return isRefSet(SrcModRef);
   default:
     llvm_unreachable("Expected only RAW, WAW and WAR!");
@@ -119,21 +119,21 @@ bool DependencyGraph::alias(Instruction *SrcI, Instruction *DstI,
 bool DependencyGraph::hasDep(Instruction *SrcI, Instruction *DstI) {
   DependencyType RoughDepType = getRoughDepType(SrcI, DstI);
   switch (RoughDepType) {
-  case DependencyType::RAR:
+  case DependencyType::ReadAfterRead:
     return false;
-  case DependencyType::RAW:
-  case DependencyType::WAW:
-  case DependencyType::WAR:
+  case DependencyType::ReadAfterWrite:
+  case DependencyType::WriteAfterWrite:
+  case DependencyType::WriteAfterRead:
     return alias(SrcI, DstI, RoughDepType);
-  case DependencyType::CTRL:
+  case DependencyType::Control:
     // Adding actual dep edges from PHIs/to terminator would just create too
     // many edges, which would be bad for compile-time.
     // So we ignore them in the DAG formation but handle them in the
     // scheduler, while sorting the ready list.
     return false;
-  case DependencyType::OTHER:
+  case DependencyType::Other:
     return true;
-  case DependencyType::NONE:
+  case DependencyType::None:
     return false;
   }
 }


        


More information about the llvm-commits mailing list