Skip to content

[SandboxVec][DAG] Refactoring: Move MemPreds from DGNode to MemDGNode #111897

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

vporpo
Copy link
Contributor

@vporpo vporpo commented Oct 10, 2024

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Oct 10, 2024

@llvm/pr-subscribers-llvm-transforms

Author: vporpo (vporpo)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/111897.diff

3 Files Affected:

  • (modified) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h (+20-16)
  • (modified) llvm/lib/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.cpp (+11-9)
  • (modified) llvm/unittests/Transforms/Vectorize/SandboxVectorizer/DependencyGraphTest.cpp (+41-32)
diff --git a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h
index eba6d7562e41de..da50e5326ea069 100644
--- a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h
+++ b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h
@@ -1,4 +1,4 @@
-//===- DependencyGraph.h ----------------------------------*- C++ -*-===//
+//===- DependencyGraph.h ----------------------------------------*- C++ -*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -96,9 +96,6 @@ class DGNode {
   // TODO: Use a PointerIntPair for SubclassID and I.
   /// For isa/dyn_cast etc.
   DGNodeID SubclassID;
-  // TODO: Move MemPreds to MemDGNode.
-  /// Memory predecessors.
-  DenseSet<MemDGNode *> MemPreds;
 
   DGNode(Instruction *I, DGNodeID ID) : I(I), SubclassID(ID) {}
   friend class MemDGNode; // For constructor.
@@ -170,17 +167,6 @@ class DGNode {
   }
 
   Instruction *getInstruction() const { return I; }
-  void addMemPred(MemDGNode *PredN) { MemPreds.insert(PredN); }
-  /// \Returns all memory dependency predecessors.
-  iterator_range<DenseSet<MemDGNode *>::const_iterator> memPreds() const {
-    return make_range(MemPreds.begin(), MemPreds.end());
-  }
-  /// \Returns true if there is a memory dependency N->this.
-  bool hasMemPred(DGNode *N) const {
-    if (auto *MN = dyn_cast<MemDGNode>(N))
-      return MemPreds.count(MN);
-    return false;
-  }
 
 #ifndef NDEBUG
   virtual void print(raw_ostream &OS, bool PrintDeps = true) const;
@@ -198,6 +184,9 @@ class DGNode {
 class MemDGNode final : public DGNode {
   MemDGNode *PrevMemN = nullptr;
   MemDGNode *NextMemN = nullptr;
+  /// Memory predecessors.
+  DenseSet<MemDGNode *> MemPreds;
+  friend class PredIterator; // For MemPreds.
 
   void setNextNode(MemDGNode *N) { NextMemN = N; }
   void setPrevNode(MemDGNode *N) { PrevMemN = N; }
@@ -222,6 +211,21 @@ class MemDGNode final : public DGNode {
   MemDGNode *getPrevNode() const { return PrevMemN; }
   /// \Returns the next Mem DGNode in instruction order.
   MemDGNode *getNextNode() const { return NextMemN; }
+  /// Adds the mem dependency edge PredN->this.
+  void addMemPred(MemDGNode *PredN) { MemPreds.insert(PredN); }
+  /// \Returns true if there is a memory dependency N->this.
+  bool hasMemPred(DGNode *N) const {
+    if (auto *MN = dyn_cast<MemDGNode>(N))
+      return MemPreds.count(MN);
+    return false;
+  }
+  /// \Returns all memory dependency predecessors. Used by tests.
+  iterator_range<DenseSet<MemDGNode *>::const_iterator> memPreds() const {
+    return make_range(MemPreds.begin(), MemPreds.end());
+  }
+#ifndef NDEBUG
+  virtual void print(raw_ostream &OS, bool PrintDeps = true) const override;
+#endif // NDEBUG
 };
 
 /// Convenience builders for a MemDGNode interval.
@@ -266,7 +270,7 @@ class DependencyGraph {
 
   /// Go through all mem nodes in \p SrcScanRange and try to add dependencies to
   /// \p DstN.
-  void scanAndAddDeps(DGNode &DstN, const Interval<MemDGNode> &SrcScanRange);
+  void scanAndAddDeps(MemDGNode &DstN, const Interval<MemDGNode> &SrcScanRange);
 
 public:
   DependencyGraph(AAResults &AA)
diff --git a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.cpp b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.cpp
index 7aea466ed6d8db..70843812ff65bc 100644
--- a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.cpp
+++ b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.cpp
@@ -23,7 +23,8 @@ PredIterator::value_type PredIterator::operator*() {
   // or a mem predecessor.
   if (OpIt != OpItE)
     return DAG->getNode(cast<Instruction>((Value *)*OpIt));
-  assert(MemIt != cast<MemDGNode>(N)->memPreds().end() &&
+  // It's a MemDGNode with OpIt == end, so we need to use MemIt.
+  assert(MemIt != cast<MemDGNode>(N)->MemPreds.end() &&
          "Cant' dereference end iterator!");
   return *MemIt;
 }
@@ -45,7 +46,8 @@ PredIterator &PredIterator::operator++() {
     OpIt = skipNonInstr(OpIt, OpItE);
     return *this;
   }
-  assert(MemIt != cast<MemDGNode>(N)->memPreds().end() && "Already at end!");
+  // It's a MemDGNode with OpIt == end, so we need to increment MemIt.
+  assert(MemIt != cast<MemDGNode>(N)->MemPreds.end() && "Already at end!");
   ++MemIt;
   return *this;
 }
@@ -57,10 +59,14 @@ bool PredIterator::operator==(const PredIterator &Other) const {
 }
 
 #ifndef NDEBUG
-void DGNode::print(raw_ostream &OS, bool PrintDeps) const {
+void DGNode::print(raw_ostream &OS, bool PrintDeps) const { I->dumpOS(OS); }
+void DGNode::dump() const {
+  print(dbgs());
+  dbgs() << "\n";
+}
+void MemDGNode::print(raw_ostream &OS, bool PrintDeps) const {
   I->dumpOS(OS);
   if (PrintDeps) {
-    OS << "\n";
     // Print memory preds.
     static constexpr const unsigned Indent = 4;
     for (auto *Pred : MemPreds) {
@@ -70,10 +76,6 @@ void DGNode::print(raw_ostream &OS, bool PrintDeps) const {
     }
   }
 }
-void DGNode::dump() const {
-  print(dbgs());
-  dbgs() << "\n";
-}
 #endif // NDEBUG
 
 Interval<MemDGNode>
@@ -179,7 +181,7 @@ bool DependencyGraph::hasDep(Instruction *SrcI, Instruction *DstI) {
   llvm_unreachable("Unknown DependencyType enum");
 }
 
-void DependencyGraph::scanAndAddDeps(DGNode &DstN,
+void DependencyGraph::scanAndAddDeps(MemDGNode &DstN,
                                      const Interval<MemDGNode> &SrcScanRange) {
   assert(isa<MemDGNode>(DstN) &&
          "DstN is the mem dep destination, so it must be mem");
diff --git a/llvm/unittests/Transforms/Vectorize/SandboxVectorizer/DependencyGraphTest.cpp b/llvm/unittests/Transforms/Vectorize/SandboxVectorizer/DependencyGraphTest.cpp
index 6b3d9cc77c9955..5a9c9815ca42fa 100644
--- a/llvm/unittests/Transforms/Vectorize/SandboxVectorizer/DependencyGraphTest.cpp
+++ b/llvm/unittests/Transforms/Vectorize/SandboxVectorizer/DependencyGraphTest.cpp
@@ -50,10 +50,10 @@ struct DependencyGraphTest : public testing::Test {
     return *AA;
   }
   /// \Returns true if there is a dependency: SrcN->DstN.
-  bool dependency(sandboxir::DGNode *SrcN, sandboxir::DGNode *DstN) {
-    const auto &Preds = DstN->memPreds();
-    auto It = find(Preds, SrcN);
-    return It != Preds.end();
+  bool memDependency(sandboxir::DGNode *SrcN, sandboxir::DGNode *DstN) {
+    if (auto *MemDstN = dyn_cast<sandboxir::MemDGNode>(DstN))
+      return MemDstN->hasMemPred(SrcN);
+    return false;
   }
 };
 
@@ -230,9 +230,10 @@ define void @foo(ptr %ptr, i8 %v0, i8 %v1) {
   EXPECT_EQ(Span.top(), &*BB->begin());
   EXPECT_EQ(Span.bottom(), BB->getTerminator());
 
-  sandboxir::DGNode *N0 = DAG.getNode(S0);
-  sandboxir::DGNode *N1 = DAG.getNode(S1);
-  sandboxir::DGNode *N2 = DAG.getNode(Ret);
+  auto *N0 = cast<sandboxir::MemDGNode>(DAG.getNode(S0));
+  auto *N1 = cast<sandboxir::MemDGNode>(DAG.getNode(S1));
+  auto *N2 = DAG.getNode(Ret);
+
   // Check getInstruction().
   EXPECT_EQ(N0->getInstruction(), S0);
   EXPECT_EQ(N1->getInstruction(), S1);
@@ -247,7 +248,7 @@ define void @foo(ptr %ptr, i8 %v0, i8 %v1) {
   // Check memPreds().
   EXPECT_TRUE(N0->memPreds().empty());
   EXPECT_THAT(N1->memPreds(), testing::ElementsAre(N0));
-  EXPECT_TRUE(N2->memPreds().empty());
+  EXPECT_TRUE(N2->preds(DAG).empty());
 }
 
 TEST_F(DependencyGraphTest, Preds) {
@@ -399,12 +400,14 @@ define void @foo(ptr %ptr, i8 %v0, i8 %v1) {
   sandboxir::DependencyGraph DAG(getAA(*LLVMF));
   DAG.extend({&*BB->begin(), BB->getTerminator()});
   auto It = BB->begin();
-  auto *Store0N = DAG.getNode(cast<sandboxir::StoreInst>(&*It++));
-  auto *Store1N = DAG.getNode(cast<sandboxir::StoreInst>(&*It++));
+  auto *Store0N = cast<sandboxir::MemDGNode>(
+      DAG.getNode(cast<sandboxir::StoreInst>(&*It++)));
+  auto *Store1N = cast<sandboxir::MemDGNode>(
+      DAG.getNode(cast<sandboxir::StoreInst>(&*It++)));
   auto *RetN = DAG.getNode(cast<sandboxir::ReturnInst>(&*It++));
   EXPECT_TRUE(Store0N->memPreds().empty());
   EXPECT_THAT(Store1N->memPreds(), testing::ElementsAre(Store0N));
-  EXPECT_TRUE(RetN->memPreds().empty());
+  EXPECT_TRUE(RetN->preds(DAG).empty());
 }
 
 TEST_F(DependencyGraphTest, NonAliasingStores) {
@@ -422,13 +425,15 @@ define void @foo(ptr noalias %ptr0, ptr noalias %ptr1, i8 %v0, i8 %v1) {
   sandboxir::DependencyGraph DAG(getAA(*LLVMF));
   DAG.extend({&*BB->begin(), BB->getTerminator()});
   auto It = BB->begin();
-  auto *Store0N = DAG.getNode(cast<sandboxir::StoreInst>(&*It++));
-  auto *Store1N = DAG.getNode(cast<sandboxir::StoreInst>(&*It++));
+  auto *Store0N = cast<sandboxir::MemDGNode>(
+      DAG.getNode(cast<sandboxir::StoreInst>(&*It++)));
+  auto *Store1N = cast<sandboxir::MemDGNode>(
+      DAG.getNode(cast<sandboxir::StoreInst>(&*It++)));
   auto *RetN = DAG.getNode(cast<sandboxir::ReturnInst>(&*It++));
   // We expect no dependencies because the stores don't alias.
   EXPECT_TRUE(Store0N->memPreds().empty());
   EXPECT_TRUE(Store1N->memPreds().empty());
-  EXPECT_TRUE(RetN->memPreds().empty());
+  EXPECT_TRUE(RetN->preds(DAG).empty());
 }
 
 TEST_F(DependencyGraphTest, VolatileLoads) {
@@ -446,12 +451,14 @@ define void @foo(ptr noalias %ptr0, ptr noalias %ptr1) {
   sandboxir::DependencyGraph DAG(getAA(*LLVMF));
   DAG.extend({&*BB->begin(), BB->getTerminator()});
   auto It = BB->begin();
-  auto *Ld0N = DAG.getNode(cast<sandboxir::LoadInst>(&*It++));
-  auto *Ld1N = DAG.getNode(cast<sandboxir::LoadInst>(&*It++));
+  auto *Ld0N = cast<sandboxir::MemDGNode>(
+      DAG.getNode(cast<sandboxir::LoadInst>(&*It++)));
+  auto *Ld1N = cast<sandboxir::MemDGNode>(
+      DAG.getNode(cast<sandboxir::LoadInst>(&*It++)));
   auto *RetN = DAG.getNode(cast<sandboxir::ReturnInst>(&*It++));
   EXPECT_TRUE(Ld0N->memPreds().empty());
   EXPECT_THAT(Ld1N->memPreds(), testing::ElementsAre(Ld0N));
-  EXPECT_TRUE(RetN->memPreds().empty());
+  EXPECT_TRUE(RetN->preds(DAG).empty());
 }
 
 TEST_F(DependencyGraphTest, VolatileSotres) {
@@ -469,12 +476,14 @@ define void @foo(ptr noalias %ptr0, ptr noalias %ptr1, i8 %v) {
   sandboxir::DependencyGraph DAG(getAA(*LLVMF));
   DAG.extend({&*BB->begin(), BB->getTerminator()});
   auto It = BB->begin();
-  auto *Store0N = DAG.getNode(cast<sandboxir::StoreInst>(&*It++));
-  auto *Store1N = DAG.getNode(cast<sandboxir::StoreInst>(&*It++));
+  auto *Store0N = cast<sandboxir::MemDGNode>(
+      DAG.getNode(cast<sandboxir::StoreInst>(&*It++)));
+  auto *Store1N = cast<sandboxir::MemDGNode>(
+      DAG.getNode(cast<sandboxir::StoreInst>(&*It++)));
   auto *RetN = DAG.getNode(cast<sandboxir::ReturnInst>(&*It++));
   EXPECT_TRUE(Store0N->memPreds().empty());
   EXPECT_THAT(Store1N->memPreds(), testing::ElementsAre(Store0N));
-  EXPECT_TRUE(RetN->memPreds().empty());
+  EXPECT_TRUE(RetN->preds(DAG).empty());
 }
 
 TEST_F(DependencyGraphTest, Call) {
@@ -498,12 +507,12 @@ define void @foo(float %v1, float %v2) {
   DAG.extend({&*BB->begin(), BB->getTerminator()->getPrevNode()});
 
   auto It = BB->begin();
-  auto *Call1N = DAG.getNode(&*It++);
+  auto *Call1N = cast<sandboxir::MemDGNode>(DAG.getNode(&*It++));
   auto *AddN = DAG.getNode(&*It++);
-  auto *Call2N = DAG.getNode(&*It++);
+  auto *Call2N = cast<sandboxir::MemDGNode>(DAG.getNode(&*It++));
 
   EXPECT_THAT(Call1N->memPreds(), testing::ElementsAre());
-  EXPECT_THAT(AddN->memPreds(), testing::ElementsAre());
+  EXPECT_THAT(AddN->preds(DAG), testing::ElementsAre());
   EXPECT_THAT(Call2N->memPreds(), testing::ElementsAre(Call1N));
 }
 
@@ -534,8 +543,8 @@ define void @foo() {
   auto *AllocaN = DAG.getNode(&*It++);
   auto *StackRestoreN = DAG.getNode(&*It++);
 
-  EXPECT_TRUE(dependency(AllocaN, StackRestoreN));
-  EXPECT_TRUE(dependency(StackSaveN, AllocaN));
+  EXPECT_TRUE(memDependency(AllocaN, StackRestoreN));
+  EXPECT_TRUE(memDependency(StackSaveN, AllocaN));
 }
 
 // Checks that stacksave and stackrestore depend on other mem instrs.
@@ -567,9 +576,9 @@ define void @foo(i8 %v0, i8 %v1, ptr %ptr) {
   auto *StackRestoreN = DAG.getNode(&*It++);
   auto *Store1N = DAG.getNode(&*It++);
 
-  EXPECT_TRUE(dependency(Store0N, StackSaveN));
-  EXPECT_TRUE(dependency(StackSaveN, StackRestoreN));
-  EXPECT_TRUE(dependency(StackRestoreN, Store1N));
+  EXPECT_TRUE(memDependency(Store0N, StackSaveN));
+  EXPECT_TRUE(memDependency(StackSaveN, StackRestoreN));
+  EXPECT_TRUE(memDependency(StackRestoreN, Store1N));
 }
 
 // Make sure there is a dependency between a stackrestore and an alloca.
@@ -596,7 +605,7 @@ define void @foo(ptr %ptr) {
   auto *StackRestoreN = DAG.getNode(&*It++);
   auto *AllocaN = DAG.getNode(&*It++);
 
-  EXPECT_TRUE(dependency(StackRestoreN, AllocaN));
+  EXPECT_TRUE(memDependency(StackRestoreN, AllocaN));
 }
 
 // Make sure there is a dependency between the alloca and stacksave
@@ -623,7 +632,7 @@ define void @foo(ptr %ptr) {
   auto *AllocaN = DAG.getNode(&*It++);
   auto *StackSaveN = DAG.getNode(&*It++);
 
-  EXPECT_TRUE(dependency(AllocaN, StackSaveN));
+  EXPECT_TRUE(memDependency(AllocaN, StackSaveN));
 }
 
 // A non-InAlloca in a stacksave-stackrestore region does not need extra
@@ -655,6 +664,6 @@ define void @foo() {
   auto *AllocaN = DAG.getNode(&*It++);
   auto *StackRestoreN = DAG.getNode(&*It++);
 
-  EXPECT_FALSE(dependency(StackSaveN, AllocaN));
-  EXPECT_FALSE(dependency(AllocaN, StackRestoreN));
+  EXPECT_FALSE(memDependency(StackSaveN, AllocaN));
+  EXPECT_FALSE(memDependency(AllocaN, StackRestoreN));
 }

@llvmbot
Copy link
Member

llvmbot commented Oct 10, 2024

@llvm/pr-subscribers-vectorizers

Author: vporpo (vporpo)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/111897.diff

3 Files Affected:

  • (modified) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h (+20-16)
  • (modified) llvm/lib/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.cpp (+11-9)
  • (modified) llvm/unittests/Transforms/Vectorize/SandboxVectorizer/DependencyGraphTest.cpp (+41-32)
diff --git a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h
index eba6d7562e41de..da50e5326ea069 100644
--- a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h
+++ b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h
@@ -1,4 +1,4 @@
-//===- DependencyGraph.h ----------------------------------*- C++ -*-===//
+//===- DependencyGraph.h ----------------------------------------*- C++ -*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -96,9 +96,6 @@ class DGNode {
   // TODO: Use a PointerIntPair for SubclassID and I.
   /// For isa/dyn_cast etc.
   DGNodeID SubclassID;
-  // TODO: Move MemPreds to MemDGNode.
-  /// Memory predecessors.
-  DenseSet<MemDGNode *> MemPreds;
 
   DGNode(Instruction *I, DGNodeID ID) : I(I), SubclassID(ID) {}
   friend class MemDGNode; // For constructor.
@@ -170,17 +167,6 @@ class DGNode {
   }
 
   Instruction *getInstruction() const { return I; }
-  void addMemPred(MemDGNode *PredN) { MemPreds.insert(PredN); }
-  /// \Returns all memory dependency predecessors.
-  iterator_range<DenseSet<MemDGNode *>::const_iterator> memPreds() const {
-    return make_range(MemPreds.begin(), MemPreds.end());
-  }
-  /// \Returns true if there is a memory dependency N->this.
-  bool hasMemPred(DGNode *N) const {
-    if (auto *MN = dyn_cast<MemDGNode>(N))
-      return MemPreds.count(MN);
-    return false;
-  }
 
 #ifndef NDEBUG
   virtual void print(raw_ostream &OS, bool PrintDeps = true) const;
@@ -198,6 +184,9 @@ class DGNode {
 class MemDGNode final : public DGNode {
   MemDGNode *PrevMemN = nullptr;
   MemDGNode *NextMemN = nullptr;
+  /// Memory predecessors.
+  DenseSet<MemDGNode *> MemPreds;
+  friend class PredIterator; // For MemPreds.
 
   void setNextNode(MemDGNode *N) { NextMemN = N; }
   void setPrevNode(MemDGNode *N) { PrevMemN = N; }
@@ -222,6 +211,21 @@ class MemDGNode final : public DGNode {
   MemDGNode *getPrevNode() const { return PrevMemN; }
   /// \Returns the next Mem DGNode in instruction order.
   MemDGNode *getNextNode() const { return NextMemN; }
+  /// Adds the mem dependency edge PredN->this.
+  void addMemPred(MemDGNode *PredN) { MemPreds.insert(PredN); }
+  /// \Returns true if there is a memory dependency N->this.
+  bool hasMemPred(DGNode *N) const {
+    if (auto *MN = dyn_cast<MemDGNode>(N))
+      return MemPreds.count(MN);
+    return false;
+  }
+  /// \Returns all memory dependency predecessors. Used by tests.
+  iterator_range<DenseSet<MemDGNode *>::const_iterator> memPreds() const {
+    return make_range(MemPreds.begin(), MemPreds.end());
+  }
+#ifndef NDEBUG
+  virtual void print(raw_ostream &OS, bool PrintDeps = true) const override;
+#endif // NDEBUG
 };
 
 /// Convenience builders for a MemDGNode interval.
@@ -266,7 +270,7 @@ class DependencyGraph {
 
   /// Go through all mem nodes in \p SrcScanRange and try to add dependencies to
   /// \p DstN.
-  void scanAndAddDeps(DGNode &DstN, const Interval<MemDGNode> &SrcScanRange);
+  void scanAndAddDeps(MemDGNode &DstN, const Interval<MemDGNode> &SrcScanRange);
 
 public:
   DependencyGraph(AAResults &AA)
diff --git a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.cpp b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.cpp
index 7aea466ed6d8db..70843812ff65bc 100644
--- a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.cpp
+++ b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.cpp
@@ -23,7 +23,8 @@ PredIterator::value_type PredIterator::operator*() {
   // or a mem predecessor.
   if (OpIt != OpItE)
     return DAG->getNode(cast<Instruction>((Value *)*OpIt));
-  assert(MemIt != cast<MemDGNode>(N)->memPreds().end() &&
+  // It's a MemDGNode with OpIt == end, so we need to use MemIt.
+  assert(MemIt != cast<MemDGNode>(N)->MemPreds.end() &&
          "Cant' dereference end iterator!");
   return *MemIt;
 }
@@ -45,7 +46,8 @@ PredIterator &PredIterator::operator++() {
     OpIt = skipNonInstr(OpIt, OpItE);
     return *this;
   }
-  assert(MemIt != cast<MemDGNode>(N)->memPreds().end() && "Already at end!");
+  // It's a MemDGNode with OpIt == end, so we need to increment MemIt.
+  assert(MemIt != cast<MemDGNode>(N)->MemPreds.end() && "Already at end!");
   ++MemIt;
   return *this;
 }
@@ -57,10 +59,14 @@ bool PredIterator::operator==(const PredIterator &Other) const {
 }
 
 #ifndef NDEBUG
-void DGNode::print(raw_ostream &OS, bool PrintDeps) const {
+void DGNode::print(raw_ostream &OS, bool PrintDeps) const { I->dumpOS(OS); }
+void DGNode::dump() const {
+  print(dbgs());
+  dbgs() << "\n";
+}
+void MemDGNode::print(raw_ostream &OS, bool PrintDeps) const {
   I->dumpOS(OS);
   if (PrintDeps) {
-    OS << "\n";
     // Print memory preds.
     static constexpr const unsigned Indent = 4;
     for (auto *Pred : MemPreds) {
@@ -70,10 +76,6 @@ void DGNode::print(raw_ostream &OS, bool PrintDeps) const {
     }
   }
 }
-void DGNode::dump() const {
-  print(dbgs());
-  dbgs() << "\n";
-}
 #endif // NDEBUG
 
 Interval<MemDGNode>
@@ -179,7 +181,7 @@ bool DependencyGraph::hasDep(Instruction *SrcI, Instruction *DstI) {
   llvm_unreachable("Unknown DependencyType enum");
 }
 
-void DependencyGraph::scanAndAddDeps(DGNode &DstN,
+void DependencyGraph::scanAndAddDeps(MemDGNode &DstN,
                                      const Interval<MemDGNode> &SrcScanRange) {
   assert(isa<MemDGNode>(DstN) &&
          "DstN is the mem dep destination, so it must be mem");
diff --git a/llvm/unittests/Transforms/Vectorize/SandboxVectorizer/DependencyGraphTest.cpp b/llvm/unittests/Transforms/Vectorize/SandboxVectorizer/DependencyGraphTest.cpp
index 6b3d9cc77c9955..5a9c9815ca42fa 100644
--- a/llvm/unittests/Transforms/Vectorize/SandboxVectorizer/DependencyGraphTest.cpp
+++ b/llvm/unittests/Transforms/Vectorize/SandboxVectorizer/DependencyGraphTest.cpp
@@ -50,10 +50,10 @@ struct DependencyGraphTest : public testing::Test {
     return *AA;
   }
   /// \Returns true if there is a dependency: SrcN->DstN.
-  bool dependency(sandboxir::DGNode *SrcN, sandboxir::DGNode *DstN) {
-    const auto &Preds = DstN->memPreds();
-    auto It = find(Preds, SrcN);
-    return It != Preds.end();
+  bool memDependency(sandboxir::DGNode *SrcN, sandboxir::DGNode *DstN) {
+    if (auto *MemDstN = dyn_cast<sandboxir::MemDGNode>(DstN))
+      return MemDstN->hasMemPred(SrcN);
+    return false;
   }
 };
 
@@ -230,9 +230,10 @@ define void @foo(ptr %ptr, i8 %v0, i8 %v1) {
   EXPECT_EQ(Span.top(), &*BB->begin());
   EXPECT_EQ(Span.bottom(), BB->getTerminator());
 
-  sandboxir::DGNode *N0 = DAG.getNode(S0);
-  sandboxir::DGNode *N1 = DAG.getNode(S1);
-  sandboxir::DGNode *N2 = DAG.getNode(Ret);
+  auto *N0 = cast<sandboxir::MemDGNode>(DAG.getNode(S0));
+  auto *N1 = cast<sandboxir::MemDGNode>(DAG.getNode(S1));
+  auto *N2 = DAG.getNode(Ret);
+
   // Check getInstruction().
   EXPECT_EQ(N0->getInstruction(), S0);
   EXPECT_EQ(N1->getInstruction(), S1);
@@ -247,7 +248,7 @@ define void @foo(ptr %ptr, i8 %v0, i8 %v1) {
   // Check memPreds().
   EXPECT_TRUE(N0->memPreds().empty());
   EXPECT_THAT(N1->memPreds(), testing::ElementsAre(N0));
-  EXPECT_TRUE(N2->memPreds().empty());
+  EXPECT_TRUE(N2->preds(DAG).empty());
 }
 
 TEST_F(DependencyGraphTest, Preds) {
@@ -399,12 +400,14 @@ define void @foo(ptr %ptr, i8 %v0, i8 %v1) {
   sandboxir::DependencyGraph DAG(getAA(*LLVMF));
   DAG.extend({&*BB->begin(), BB->getTerminator()});
   auto It = BB->begin();
-  auto *Store0N = DAG.getNode(cast<sandboxir::StoreInst>(&*It++));
-  auto *Store1N = DAG.getNode(cast<sandboxir::StoreInst>(&*It++));
+  auto *Store0N = cast<sandboxir::MemDGNode>(
+      DAG.getNode(cast<sandboxir::StoreInst>(&*It++)));
+  auto *Store1N = cast<sandboxir::MemDGNode>(
+      DAG.getNode(cast<sandboxir::StoreInst>(&*It++)));
   auto *RetN = DAG.getNode(cast<sandboxir::ReturnInst>(&*It++));
   EXPECT_TRUE(Store0N->memPreds().empty());
   EXPECT_THAT(Store1N->memPreds(), testing::ElementsAre(Store0N));
-  EXPECT_TRUE(RetN->memPreds().empty());
+  EXPECT_TRUE(RetN->preds(DAG).empty());
 }
 
 TEST_F(DependencyGraphTest, NonAliasingStores) {
@@ -422,13 +425,15 @@ define void @foo(ptr noalias %ptr0, ptr noalias %ptr1, i8 %v0, i8 %v1) {
   sandboxir::DependencyGraph DAG(getAA(*LLVMF));
   DAG.extend({&*BB->begin(), BB->getTerminator()});
   auto It = BB->begin();
-  auto *Store0N = DAG.getNode(cast<sandboxir::StoreInst>(&*It++));
-  auto *Store1N = DAG.getNode(cast<sandboxir::StoreInst>(&*It++));
+  auto *Store0N = cast<sandboxir::MemDGNode>(
+      DAG.getNode(cast<sandboxir::StoreInst>(&*It++)));
+  auto *Store1N = cast<sandboxir::MemDGNode>(
+      DAG.getNode(cast<sandboxir::StoreInst>(&*It++)));
   auto *RetN = DAG.getNode(cast<sandboxir::ReturnInst>(&*It++));
   // We expect no dependencies because the stores don't alias.
   EXPECT_TRUE(Store0N->memPreds().empty());
   EXPECT_TRUE(Store1N->memPreds().empty());
-  EXPECT_TRUE(RetN->memPreds().empty());
+  EXPECT_TRUE(RetN->preds(DAG).empty());
 }
 
 TEST_F(DependencyGraphTest, VolatileLoads) {
@@ -446,12 +451,14 @@ define void @foo(ptr noalias %ptr0, ptr noalias %ptr1) {
   sandboxir::DependencyGraph DAG(getAA(*LLVMF));
   DAG.extend({&*BB->begin(), BB->getTerminator()});
   auto It = BB->begin();
-  auto *Ld0N = DAG.getNode(cast<sandboxir::LoadInst>(&*It++));
-  auto *Ld1N = DAG.getNode(cast<sandboxir::LoadInst>(&*It++));
+  auto *Ld0N = cast<sandboxir::MemDGNode>(
+      DAG.getNode(cast<sandboxir::LoadInst>(&*It++)));
+  auto *Ld1N = cast<sandboxir::MemDGNode>(
+      DAG.getNode(cast<sandboxir::LoadInst>(&*It++)));
   auto *RetN = DAG.getNode(cast<sandboxir::ReturnInst>(&*It++));
   EXPECT_TRUE(Ld0N->memPreds().empty());
   EXPECT_THAT(Ld1N->memPreds(), testing::ElementsAre(Ld0N));
-  EXPECT_TRUE(RetN->memPreds().empty());
+  EXPECT_TRUE(RetN->preds(DAG).empty());
 }
 
 TEST_F(DependencyGraphTest, VolatileSotres) {
@@ -469,12 +476,14 @@ define void @foo(ptr noalias %ptr0, ptr noalias %ptr1, i8 %v) {
   sandboxir::DependencyGraph DAG(getAA(*LLVMF));
   DAG.extend({&*BB->begin(), BB->getTerminator()});
   auto It = BB->begin();
-  auto *Store0N = DAG.getNode(cast<sandboxir::StoreInst>(&*It++));
-  auto *Store1N = DAG.getNode(cast<sandboxir::StoreInst>(&*It++));
+  auto *Store0N = cast<sandboxir::MemDGNode>(
+      DAG.getNode(cast<sandboxir::StoreInst>(&*It++)));
+  auto *Store1N = cast<sandboxir::MemDGNode>(
+      DAG.getNode(cast<sandboxir::StoreInst>(&*It++)));
   auto *RetN = DAG.getNode(cast<sandboxir::ReturnInst>(&*It++));
   EXPECT_TRUE(Store0N->memPreds().empty());
   EXPECT_THAT(Store1N->memPreds(), testing::ElementsAre(Store0N));
-  EXPECT_TRUE(RetN->memPreds().empty());
+  EXPECT_TRUE(RetN->preds(DAG).empty());
 }
 
 TEST_F(DependencyGraphTest, Call) {
@@ -498,12 +507,12 @@ define void @foo(float %v1, float %v2) {
   DAG.extend({&*BB->begin(), BB->getTerminator()->getPrevNode()});
 
   auto It = BB->begin();
-  auto *Call1N = DAG.getNode(&*It++);
+  auto *Call1N = cast<sandboxir::MemDGNode>(DAG.getNode(&*It++));
   auto *AddN = DAG.getNode(&*It++);
-  auto *Call2N = DAG.getNode(&*It++);
+  auto *Call2N = cast<sandboxir::MemDGNode>(DAG.getNode(&*It++));
 
   EXPECT_THAT(Call1N->memPreds(), testing::ElementsAre());
-  EXPECT_THAT(AddN->memPreds(), testing::ElementsAre());
+  EXPECT_THAT(AddN->preds(DAG), testing::ElementsAre());
   EXPECT_THAT(Call2N->memPreds(), testing::ElementsAre(Call1N));
 }
 
@@ -534,8 +543,8 @@ define void @foo() {
   auto *AllocaN = DAG.getNode(&*It++);
   auto *StackRestoreN = DAG.getNode(&*It++);
 
-  EXPECT_TRUE(dependency(AllocaN, StackRestoreN));
-  EXPECT_TRUE(dependency(StackSaveN, AllocaN));
+  EXPECT_TRUE(memDependency(AllocaN, StackRestoreN));
+  EXPECT_TRUE(memDependency(StackSaveN, AllocaN));
 }
 
 // Checks that stacksave and stackrestore depend on other mem instrs.
@@ -567,9 +576,9 @@ define void @foo(i8 %v0, i8 %v1, ptr %ptr) {
   auto *StackRestoreN = DAG.getNode(&*It++);
   auto *Store1N = DAG.getNode(&*It++);
 
-  EXPECT_TRUE(dependency(Store0N, StackSaveN));
-  EXPECT_TRUE(dependency(StackSaveN, StackRestoreN));
-  EXPECT_TRUE(dependency(StackRestoreN, Store1N));
+  EXPECT_TRUE(memDependency(Store0N, StackSaveN));
+  EXPECT_TRUE(memDependency(StackSaveN, StackRestoreN));
+  EXPECT_TRUE(memDependency(StackRestoreN, Store1N));
 }
 
 // Make sure there is a dependency between a stackrestore and an alloca.
@@ -596,7 +605,7 @@ define void @foo(ptr %ptr) {
   auto *StackRestoreN = DAG.getNode(&*It++);
   auto *AllocaN = DAG.getNode(&*It++);
 
-  EXPECT_TRUE(dependency(StackRestoreN, AllocaN));
+  EXPECT_TRUE(memDependency(StackRestoreN, AllocaN));
 }
 
 // Make sure there is a dependency between the alloca and stacksave
@@ -623,7 +632,7 @@ define void @foo(ptr %ptr) {
   auto *AllocaN = DAG.getNode(&*It++);
   auto *StackSaveN = DAG.getNode(&*It++);
 
-  EXPECT_TRUE(dependency(AllocaN, StackSaveN));
+  EXPECT_TRUE(memDependency(AllocaN, StackSaveN));
 }
 
 // A non-InAlloca in a stacksave-stackrestore region does not need extra
@@ -655,6 +664,6 @@ define void @foo() {
   auto *AllocaN = DAG.getNode(&*It++);
   auto *StackRestoreN = DAG.getNode(&*It++);
 
-  EXPECT_FALSE(dependency(StackSaveN, AllocaN));
-  EXPECT_FALSE(dependency(AllocaN, StackRestoreN));
+  EXPECT_FALSE(memDependency(StackSaveN, AllocaN));
+  EXPECT_FALSE(memDependency(AllocaN, StackRestoreN));
 }

@vporpo vporpo merged commit a4916d2 into llvm:main Oct 10, 2024
8 of 10 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 10, 2024

LLVM Buildbot has detected a new failure on builder clang-hip-vega20 running on hip-vega20-0 while building llvm at step 3 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/123/builds/7306

Here is the relevant piece of the build log for the reference
Step 3 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/hip-build.sh --jobs=' (failure)
...
[38/40] : && /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/clang++ -O3 -DNDEBUG  External/HIP/CMakeFiles/InOneWeekend-hip-6.0.2.dir/workload/ray-tracing/InOneWeekend/main.cc.o -o External/HIP/InOneWeekend-hip-6.0.2  --rocm-path=/buildbot/Externals/hip/rocm-6.0.2 --hip-link -rtlib=compiler-rt -unwindlib=libgcc -frtlib-add-rpath && cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP && /usr/local/bin/cmake -E create_symlink /buildbot/llvm-test-suite/External/HIP/InOneWeekend.reference_output /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/InOneWeekend.reference_output-hip-6.0.2
[39/40] /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/clang++ -DNDEBUG  -O3 -DNDEBUG   -w -Werror=date-time --rocm-path=/buildbot/Externals/hip/rocm-6.0.2 --offload-arch=gfx908 --offload-arch=gfx90a --offload-arch=gfx1030 --offload-arch=gfx1100 -xhip -mfma -MD -MT External/HIP/CMakeFiles/TheNextWeek-hip-6.0.2.dir/workload/ray-tracing/TheNextWeek/main.cc.o -MF External/HIP/CMakeFiles/TheNextWeek-hip-6.0.2.dir/workload/ray-tracing/TheNextWeek/main.cc.o.d -o External/HIP/CMakeFiles/TheNextWeek-hip-6.0.2.dir/workload/ray-tracing/TheNextWeek/main.cc.o -c /buildbot/llvm-test-suite/External/HIP/workload/ray-tracing/TheNextWeek/main.cc
[40/40] : && /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/clang++ -O3 -DNDEBUG  External/HIP/CMakeFiles/TheNextWeek-hip-6.0.2.dir/workload/ray-tracing/TheNextWeek/main.cc.o -o External/HIP/TheNextWeek-hip-6.0.2  --rocm-path=/buildbot/Externals/hip/rocm-6.0.2 --hip-link -rtlib=compiler-rt -unwindlib=libgcc -frtlib-add-rpath && cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP && /usr/local/bin/cmake -E create_symlink /buildbot/llvm-test-suite/External/HIP/TheNextWeek.reference_output /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/TheNextWeek.reference_output-hip-6.0.2
+ build_step 'Testing HIP test-suite'
+ echo '@@@BUILD_STEP Testing HIP test-suite@@@'
@@@BUILD_STEP Testing HIP test-suite@@@
+ ninja -v check-hip-simple
[0/1] cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP && /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/llvm-lit -sv empty-hip-6.0.2.test with-fopenmp-hip-6.0.2.test saxpy-hip-6.0.2.test memmove-hip-6.0.2.test InOneWeekend-hip-6.0.2.test TheNextWeek-hip-6.0.2.test blender.test
-- Testing: 7 tests, 7 workers --
Testing:  0.. 10.. 20.. 30.. 40
FAIL: test-suite :: External/HIP/InOneWeekend-hip-6.0.2.test (4 of 7)
******************** TEST 'test-suite :: External/HIP/InOneWeekend-hip-6.0.2.test' FAILED ********************

/buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/timeit-target --timeout 7200 --limit-core 0 --limit-cpu 7200 --limit-file-size 209715200 --limit-rss-size 838860800 --append-exitstatus --redirect-output /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/InOneWeekend-hip-6.0.2.test.out --redirect-input /dev/null --summary /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/InOneWeekend-hip-6.0.2.test.time /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/InOneWeekend-hip-6.0.2
cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP ; /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/fpcmp-target /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/InOneWeekend-hip-6.0.2.test.out InOneWeekend.reference_output-hip-6.0.2

+ cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP
+ /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/fpcmp-target /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/InOneWeekend-hip-6.0.2.test.out InOneWeekend.reference_output-hip-6.0.2
/buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/fpcmp-target: Comparison failed, textual difference between 'M' and 'i'

Input 1:
Memory access fault by GPU node-1 (Agent handle: 0x55b99890fac0) on address (nil). Reason: Page not present or supervisor privilege.
exit 134

Input 2:
image width = 1200 height = 675
block size = (16, 16) grid size = (75, 43)
Start rendering by GPU.
Done.
gpu.ppm and ref.ppm are the same.
exit 0

********************
/usr/bin/strip: /bin/bash.stripped: Bad file descriptor
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
********************
Failed Tests (1):
  test-suite :: External/HIP/InOneWeekend-hip-6.0.2.test


Testing Time: 367.24s

Total Discovered Tests: 7
  Passed: 6 (85.71%)
  Failed: 1 (14.29%)
FAILED: External/HIP/CMakeFiles/check-hip-simple-hip-6.0.2 
cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP && /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/llvm-lit -sv empty-hip-6.0.2.test with-fopenmp-hip-6.0.2.test saxpy-hip-6.0.2.test memmove-hip-6.0.2.test InOneWeekend-hip-6.0.2.test TheNextWeek-hip-6.0.2.test blender.test
ninja: build stopped: subcommand failed.
Step 12 (Testing HIP test-suite) failure: Testing HIP test-suite (failure)
@@@BUILD_STEP Testing HIP test-suite@@@
+ ninja -v check-hip-simple
[0/1] cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP && /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/llvm-lit -sv empty-hip-6.0.2.test with-fopenmp-hip-6.0.2.test saxpy-hip-6.0.2.test memmove-hip-6.0.2.test InOneWeekend-hip-6.0.2.test TheNextWeek-hip-6.0.2.test blender.test
-- Testing: 7 tests, 7 workers --
Testing:  0.. 10.. 20.. 30.. 40
FAIL: test-suite :: External/HIP/InOneWeekend-hip-6.0.2.test (4 of 7)
******************** TEST 'test-suite :: External/HIP/InOneWeekend-hip-6.0.2.test' FAILED ********************

/buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/timeit-target --timeout 7200 --limit-core 0 --limit-cpu 7200 --limit-file-size 209715200 --limit-rss-size 838860800 --append-exitstatus --redirect-output /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/InOneWeekend-hip-6.0.2.test.out --redirect-input /dev/null --summary /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/InOneWeekend-hip-6.0.2.test.time /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/InOneWeekend-hip-6.0.2
cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP ; /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/fpcmp-target /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/InOneWeekend-hip-6.0.2.test.out InOneWeekend.reference_output-hip-6.0.2

+ cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP
+ /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/fpcmp-target /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/InOneWeekend-hip-6.0.2.test.out InOneWeekend.reference_output-hip-6.0.2
/buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/fpcmp-target: Comparison failed, textual difference between 'M' and 'i'

Input 1:
Memory access fault by GPU node-1 (Agent handle: 0x55b99890fac0) on address (nil). Reason: Page not present or supervisor privilege.
exit 134

Input 2:
image width = 1200 height = 675
block size = (16, 16) grid size = (75, 43)
Start rendering by GPU.
Done.
gpu.ppm and ref.ppm are the same.
exit 0

********************
/usr/bin/strip: /bin/bash.stripped: Bad file descriptor
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
********************
Failed Tests (1):
  test-suite :: External/HIP/InOneWeekend-hip-6.0.2.test


Testing Time: 367.24s

Total Discovered Tests: 7
  Passed: 6 (85.71%)
  Failed: 1 (14.29%)
FAILED: External/HIP/CMakeFiles/check-hip-simple-hip-6.0.2 
cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP && /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/llvm-lit -sv empty-hip-6.0.2.test with-fopenmp-hip-6.0.2.test saxpy-hip-6.0.2.test memmove-hip-6.0.2.test InOneWeekend-hip-6.0.2.test TheNextWeek-hip-6.0.2.test blender.test
ninja: build stopped: subcommand failed.
program finished with exit code 1
elapsedTime=480.619822

@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 10, 2024

LLVM Buildbot has detected a new failure on builder openmp-offload-sles-build-only running on rocm-worker-hw-04-sles while building llvm at step 8 "Add check check-llvm".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/140/builds/8521

Here is the relevant piece of the build log for the reference
Step 8 (Add check check-llvm) failure: 1200 seconds without output running [b'ninja', b'-j 32', b'check-llvm'], attempting to kill
...
[663/667] Linking CXX executable unittests/tools/llvm-mca/LLVMMCATests
[664/667] Linking CXX executable unittests/tools/llvm-exegesis/LLVMExegesisTests
[665/667] Building CXX object unittests/Transforms/Vectorize/SandboxVectorizer/CMakeFiles/SandboxVectorizerTests.dir/DependencyGraphTest.cpp.o
[666/667] Linking CXX executable unittests/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizerTests
[666/667] Running the LLVM regression tests
llvm-lit: /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/utils/lit/lit/llvm/config.py:506: note: using ld.lld: /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/bin/ld.lld
llvm-lit: /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/utils/lit/lit/llvm/config.py:506: note: using lld-link: /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/bin/lld-link
llvm-lit: /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/utils/lit/lit/llvm/config.py:506: note: using ld64.lld: /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/bin/ld64.lld
llvm-lit: /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/utils/lit/lit/llvm/config.py:506: note: using wasm-ld: /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/bin/wasm-ld
-- Testing: 55282 tests, 32 workers --
command timed out: 1200 seconds without output running [b'ninja', b'-j 32', b'check-llvm'], attempting to kill
process killed by signal 9
program finished with exit code -1
elapsedTime=1287.099834
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..

DanielCChen pushed a commit to DanielCChen/llvm-project that referenced this pull request Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants