Skip to content

Add unit tests for size returning new funcs in the MemProf use pass. #105473

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
Aug 26, 2024

Conversation

snehasish
Copy link
Contributor

@snehasish snehasish commented Aug 21, 2024

We use a unit test to verify correctness since:
a) we don't have a text format profile
b) size returning new isn't supported natively
c) a raw profile will need to be manipulated artificially

The changes this test covers were made in #102258.

Add __size_returning_new LibFuncs as valid allocation calls which can be
replaced by the MemProfileUse pass. Use a unit test to verify
correctness since:
a) we don't have a text format profile
b) size returning new isn't supported natively
c) a raw profile will need to be manipulated artificially
@llvmbot llvmbot added PGO Profile Guided Optimizations llvm:transforms labels Aug 21, 2024
@llvmbot
Copy link
Member

llvmbot commented Aug 21, 2024

@llvm/pr-subscribers-llvm-transforms

@llvm/pr-subscribers-pgo

Author: Snehasish Kumar (snehasish)

Changes

Add __size_returning_new LibFuncs as valid allocation calls which can be replaced by the MemProfileUse pass. Use a unit test to verify correctness since:
a) we don't have a text format profile
b) size returning new isn't supported natively
c) a raw profile will need to be manipulated artificially


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

5 Files Affected:

  • (modified) llvm/include/llvm/ProfileData/InstrProfReader.h (+6-2)
  • (modified) llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h (+15-4)
  • (modified) llvm/lib/Transforms/Instrumentation/MemProfiler.cpp (+19-23)
  • (modified) llvm/unittests/Transforms/Instrumentation/CMakeLists.txt (+1)
  • (added) llvm/unittests/Transforms/Instrumentation/MemProfilerTest.cpp (+158)
diff --git a/llvm/include/llvm/ProfileData/InstrProfReader.h b/llvm/include/llvm/ProfileData/InstrProfReader.h
index 3b307d08359980..95c891442fd6e9 100644
--- a/llvm/include/llvm/ProfileData/InstrProfReader.h
+++ b/llvm/include/llvm/ProfileData/InstrProfReader.h
@@ -670,10 +670,11 @@ class IndexedMemProfReader {
 
 public:
   IndexedMemProfReader() = default;
+  virtual ~IndexedMemProfReader() = default;
 
   Error deserialize(const unsigned char *Start, uint64_t MemProfOffset);
 
-  Expected<memprof::MemProfRecord>
+  virtual Expected<memprof::MemProfRecord>
   getMemProfRecord(const uint64_t FuncNameHash) const;
 };
 
@@ -768,11 +769,14 @@ class IndexedInstrProfReader : public InstrProfReader {
                      uint64_t *MismatchedFuncSum = nullptr);
 
   /// Return the memprof record for the function identified by
-  /// llvm::md5(Name).
+  /// llvm::md5(Name). Marked virtual so that unit tests can mock this function.
   Expected<memprof::MemProfRecord> getMemProfRecord(uint64_t FuncNameHash) {
     return MemProfReader.getMemProfRecord(FuncNameHash);
   }
 
+  /// Return the underlying memprof reader.
+  IndexedMemProfReader &getIndexedMemProfReader() { return MemProfReader; }
+
   /// Fill Counts with the profile data for the given function name.
   Error getFunctionCounts(StringRef FuncName, uint64_t FuncHash,
                           std::vector<uint64_t> &Counts);
diff --git a/llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h b/llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h
index f92c6b4775a2a2..c5d03c98f41581 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h
@@ -13,15 +13,15 @@
 #define LLVM_TRANSFORMS_INSTRUMENTATION_MEMPROFILER_H
 
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
+#include "llvm/IR/ModuleSummaryIndex.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/ProfileData/InstrProfReader.h"
+#include "llvm/Support/VirtualFileSystem.h"
 
 namespace llvm {
 class Function;
 class Module;
-
-namespace vfs {
-class FileSystem;
-} // namespace vfs
+class TargetLibraryInfo;
 
 /// Public interface to the memory profiler pass for instrumenting code to
 /// profile memory accesses.
@@ -52,6 +52,17 @@ class MemProfUsePass : public PassInfoMixin<MemProfUsePass> {
                           IntrusiveRefCntPtr<vfs::FileSystem> FS = nullptr);
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 
+  struct AllocMatchInfo {
+    uint64_t TotalSize = 0;
+    AllocationType AllocType = AllocationType::None;
+    bool Matched = false;
+  };
+
+  void
+  readMemprof(Function &F, const IndexedMemProfReader &MemProfReader,
+              const TargetLibraryInfo &TLI,
+              std::map<uint64_t, AllocMatchInfo> &FullStackIdToAllocMatchInfo);
+
 private:
   std::string MemoryProfileFileName;
   IntrusiveRefCntPtr<vfs::FileSystem> FS;
diff --git a/llvm/lib/Transforms/Instrumentation/MemProfiler.cpp b/llvm/lib/Transforms/Instrumentation/MemProfiler.cpp
index 4a43120c9a9e7f..bd10c037ecf4ad 100644
--- a/llvm/lib/Transforms/Instrumentation/MemProfiler.cpp
+++ b/llvm/lib/Transforms/Instrumentation/MemProfiler.cpp
@@ -39,7 +39,6 @@
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/HashBuilder.h"
-#include "llvm/Support/VirtualFileSystem.h"
 #include "llvm/TargetParser/Triple.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
 #include "llvm/Transforms/Utils/ModuleUtils.h"
@@ -55,6 +54,7 @@ namespace llvm {
 extern cl::opt<bool> PGOWarnMissing;
 extern cl::opt<bool> NoPGOWarnMismatch;
 extern cl::opt<bool> NoPGOWarnMismatchComdatWeak;
+using AllocMatchInfo = ::llvm::MemProfUsePass::AllocMatchInfo;
 } // namespace llvm
 
 constexpr int LLVM_MEM_PROFILER_VERSION = 1;
@@ -148,10 +148,11 @@ static cl::opt<int> ClDebugMax("memprof-debug-max", cl::desc("Debug max inst"),
 
 // By default disable matching of allocation profiles onto operator new that
 // already explicitly pass a hot/cold hint, since we don't currently
-// override these hints anyway.
-static cl::opt<bool> ClMemProfMatchHotColdNew(
+// override these hints anyway. Not static so that it can be set in the unit
+// test too.
+cl::opt<bool> ClMemProfMatchHotColdNew(
     "memprof-match-hot-cold-new",
- cl::desc(
+    cl::desc(
         "Match allocation profiles onto existing hot/cold operator new calls"),
     cl::Hidden, cl::init(false));
 
@@ -789,17 +790,11 @@ static bool isAllocationWithHotColdVariant(Function *Callee,
   }
 }
 
-struct AllocMatchInfo {
-  uint64_t TotalSize = 0;
-  AllocationType AllocType = AllocationType::None;
-  bool Matched = false;
-};
-
-static void
-readMemprof(Module &M, Function &F, IndexedInstrProfReader *MemProfReader,
-            const TargetLibraryInfo &TLI,
-            std::map<uint64_t, AllocMatchInfo> &FullStackIdToAllocMatchInfo) {
-  auto &Ctx = M.getContext();
+void MemProfUsePass::readMemprof(
+    Function &F, const IndexedMemProfReader &MemProfReader,
+    const TargetLibraryInfo &TLI,
+    std::map<uint64_t, AllocMatchInfo> &FullStackIdToAllocMatchInfo) {
+  auto &Ctx = F.getContext();
   // Previously we used getIRPGOFuncName() here. If F is local linkage,
   // getIRPGOFuncName() returns FuncName with prefix 'FileName;'. But
   // llvm-profdata uses FuncName in dwarf to create GUID which doesn't
@@ -810,7 +805,7 @@ readMemprof(Module &M, Function &F, IndexedInstrProfReader *MemProfReader,
   auto FuncName = F.getName();
   auto FuncGUID = Function::getGUID(FuncName);
   std::optional<memprof::MemProfRecord> MemProfRec;
-  auto Err = MemProfReader->getMemProfRecord(FuncGUID).moveInto(MemProfRec);
+  auto Err = MemProfReader.getMemProfRecord(FuncGUID).moveInto(MemProfRec);
   if (Err) {
     handleAllErrors(std::move(Err), [&](const InstrProfError &IPE) {
       auto Err = IPE.get();
@@ -838,8 +833,8 @@ readMemprof(Module &M, Function &F, IndexedInstrProfReader *MemProfReader,
                          Twine(" Hash = ") + std::to_string(FuncGUID))
                             .str();
 
-      Ctx.diagnose(
-          DiagnosticInfoPGOProfile(M.getName().data(), Msg, DS_Warning));
+      Ctx.diagnose(DiagnosticInfoPGOProfile(F.getParent()->getName().data(),
+                                            Msg, DS_Warning));
     });
     return;
   }
@@ -1036,15 +1031,15 @@ PreservedAnalyses MemProfUsePass::run(Module &M, ModuleAnalysisManager &AM) {
     return PreservedAnalyses::all();
   }
 
-  std::unique_ptr<IndexedInstrProfReader> MemProfReader =
+  std::unique_ptr<IndexedInstrProfReader> IndexedReader =
       std::move(ReaderOrErr.get());
-  if (!MemProfReader) {
+  if (!IndexedReader) {
     Ctx.diagnose(DiagnosticInfoPGOProfile(
-        MemoryProfileFileName.data(), StringRef("Cannot get MemProfReader")));
+        MemoryProfileFileName.data(), StringRef("Cannot get IndexedReader")));
     return PreservedAnalyses::all();
   }
 
-  if (!MemProfReader->hasMemoryProfile()) {
+  if (!IndexedReader->hasMemoryProfile()) {
     Ctx.diagnose(DiagnosticInfoPGOProfile(MemoryProfileFileName.data(),
                                           "Not a memory profile"));
     return PreservedAnalyses::all();
@@ -1057,12 +1052,13 @@ PreservedAnalyses MemProfUsePass::run(Module &M, ModuleAnalysisManager &AM) {
   // it to an allocation in the IR.
   std::map<uint64_t, AllocMatchInfo> FullStackIdToAllocMatchInfo;
 
+  const auto &MemProfReader = IndexedReader->getIndexedMemProfReader();
   for (auto &F : M) {
     if (F.isDeclaration())
       continue;
 
     const TargetLibraryInfo &TLI = FAM.getResult<TargetLibraryAnalysis>(F);
-    readMemprof(M, F, MemProfReader.get(), TLI, FullStackIdToAllocMatchInfo);
+    readMemprof(F, MemProfReader, TLI, FullStackIdToAllocMatchInfo);
   }
 
   if (ClPrintMemProfMatchInfo) {
diff --git a/llvm/unittests/Transforms/Instrumentation/CMakeLists.txt b/llvm/unittests/Transforms/Instrumentation/CMakeLists.txt
index 1f249b0049d062..1afe1c339e4335 100644
--- a/llvm/unittests/Transforms/Instrumentation/CMakeLists.txt
+++ b/llvm/unittests/Transforms/Instrumentation/CMakeLists.txt
@@ -9,6 +9,7 @@ set(LLVM_LINK_COMPONENTS
 
 add_llvm_unittest(InstrumentationTests
   PGOInstrumentationTest.cpp
+  MemProfilerTest.cpp
   )
 
 target_link_libraries(InstrumentationTests PRIVATE LLVMTestingSupport)
diff --git a/llvm/unittests/Transforms/Instrumentation/MemProfilerTest.cpp b/llvm/unittests/Transforms/Instrumentation/MemProfilerTest.cpp
new file mode 100644
index 00000000000000..844867d676e8dd
--- /dev/null
+++ b/llvm/unittests/Transforms/Instrumentation/MemProfilerTest.cpp
@@ -0,0 +1,158 @@
+//===- MemProfilerTest.cpp - MemProfiler unit tests ------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Transforms/Instrumentation/MemProfiler.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Analysis/TargetLibraryInfo.h"
+#include "llvm/AsmParser/Parser.h"
+#include "llvm/IR/Attributes.h"
+#include "llvm/IR/Metadata.h"
+#include "llvm/IR/Module.h"
+#include "llvm/IR/PassManager.h"
+#include "llvm/Passes/PassBuilder.h"
+#include "llvm/ProfileData/InstrProfReader.h"
+#include "llvm/ProfileData/MemProf.h"
+#include "llvm/ProfileData/MemProfData.inc"
+#include "llvm/Support/Error.h"
+#include "llvm/Support/SourceMgr.h"
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+extern llvm::cl::opt<bool> ClMemProfMatchHotColdNew;
+
+namespace llvm {
+namespace memprof {
+namespace {
+
+using ::testing::Return;
+using ::testing::SizeIs;
+
+struct MemProfilerTest : public ::testing::Test {
+  LLVMContext Context;
+  std::unique_ptr<Module> M;
+
+  MemProfilerTest() { ClMemProfMatchHotColdNew = true; }
+
+  void parseAssembly(const StringRef IR) {
+    SMDiagnostic Error;
+    M = parseAssemblyString(IR, Error, Context);
+    std::string ErrMsg;
+    raw_string_ostream OS(ErrMsg);
+    Error.print("", OS);
+
+    // A failure here means that the test itself is buggy.
+    if (!M)
+      report_fatal_error(OS.str().c_str());
+  }
+};
+
+// A mock memprof reader we can inject into the function we are testing.
+class MockMemProfReader : public IndexedMemProfReader {
+public:
+  MOCK_METHOD(Expected<MemProfRecord>, getMemProfRecord,
+              (const uint64_t FuncNameHash), (const, override));
+
+  // A helper function to create mock records from frames.
+  static MemProfRecord makeRecord(ArrayRef<ArrayRef<Frame>> AllocFrames) {
+    MemProfRecord Record;
+    MemInfoBlock Info;
+    // Mimic values which will be below the cold threshold.
+    Info.AllocCount = 1, Info.TotalSize = 550;
+    Info.TotalLifetime = 1000 * 1000, Info.TotalLifetimeAccessDensity = 1;
+    for (const auto &Callstack : AllocFrames) {
+      AllocationInfo AI;
+      AI.Info = PortableMemInfoBlock(Info, getHotColdSchema());
+      AI.CallStack = std::vector(Callstack.begin(), Callstack.end());
+      Record.AllocSites.push_back(AI);
+    }
+    return Record;
+  }
+};
+
+TEST_F(MemProfilerTest, AnnotatesCall) {
+  parseAssembly(R"IR(
+    target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
+    target triple = "x86_64-unknown-linux-gnu"
+
+    define void @_Z3foov() !dbg !10 {
+    entry:
+      %c1 = call {ptr, i64} @__size_returning_new(i64 32), !dbg !13
+      %c2 = call {ptr, i64} @__size_returning_new_aligned(i64 32, i64 8), !dbg !14
+      %c3 = call {ptr, i64} @__size_returning_new_hot_cold(i64 32, i8 254), !dbg !15
+      %c4 = call {ptr, i64} @__size_returning_new_aligned_hot_cold(i64 32, i64 8, i8 254), !dbg !16
+      ret void
+    }
+
+    declare {ptr, i64} @__size_returning_new(i64)
+    declare {ptr, i64} @__size_returning_new_aligned(i64, i64)
+    declare {ptr, i64} @__size_returning_new_hot_cold(i64, i8)
+    declare {ptr, i64} @__size_returning_new_aligned_hot_cold(i64, i64, i8)
+
+    !llvm.dbg.cu = !{!0}
+    !llvm.module.flags = !{!2, !3}
+
+    !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1)
+    !1 = !DIFile(filename: "mock_file.cc", directory: "mock_dir")
+    !2 = !{i32 7, !"Dwarf Version", i32 5}
+    !3 = !{i32 2, !"Debug Info Version", i32 3}
+    !10 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !1, file: !1, line: 4, type: !11, scopeLine: 4, unit: !0, retainedNodes: !12)
+    !11 = !DISubroutineType(types: !12)
+    !12 = !{}
+    !13 = !DILocation(line: 5, column: 10, scope: !10)
+    !14 = !DILocation(line: 6, column: 10, scope: !10)
+    !15 = !DILocation(line: 7, column: 10, scope: !10)
+    !16 = !DILocation(line: 8, column: 10, scope: !10)
+  )IR");
+
+  auto *F = M->getFunction("_Z3foov");
+  ASSERT_NE(F, nullptr);
+
+  TargetLibraryInfoWrapperPass WrapperPass;
+  auto &TLI = WrapperPass.getTLI(*F);
+
+  auto Guid = Function::getGUID("_Z3foov");
+  // All the allocation sites are in foo().
+  MemProfRecord MockRecord =
+      MockMemProfReader::makeRecord({{Frame(Guid, 1, 10, false)},
+                                     {Frame(Guid, 2, 10, false)},
+                                     {Frame(Guid, 3, 10, false)},
+                                     {Frame(Guid, 4, 10, false)}});
+  // Set up mocks for the reader.
+  MockMemProfReader Reader;
+  EXPECT_CALL(Reader, getMemProfRecord(Guid)).WillOnce(Return(MockRecord));
+
+  MemProfUsePass Pass("/unused/profile/path");
+  std::map<uint64_t, MemProfUsePass::AllocMatchInfo> Unused;
+  Pass.readMemprof(*F, Reader, TLI, Unused);
+
+  // Since we only have a single type of behaviour for each allocation site, we
+  // only get function attributes.
+  std::vector<llvm::Attribute> CallsiteAttrs;
+  for (const auto &BB : *F) {
+    for (const auto &I : BB) {
+      if (auto *CI = dyn_cast<CallInst>(&I)) {
+        if (!CI->getCalledFunction()->getName().starts_with(
+                "__size_returning_new"))
+          continue;
+        Attribute Attr = CI->getFnAttr("memprof");
+        // The attribute will be invalid if it didn't find one named memprof.
+        ASSERT_TRUE(Attr.isValid());
+        CallsiteAttrs.push_back(Attr);
+      }
+    }
+  }
+
+  // We match all the variants including ones with the hint since we set
+  // ClMemProfMatchHotColdNew to true.
+  EXPECT_THAT(CallsiteAttrs, SizeIs(4));
+}
+
+} // namespace
+} // namespace memprof
+} // namespace llvm

Copy link
Contributor

@teresajohnson teresajohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm having trouble seeing where the changes to support the size returning new variants are - I just see a lot of restructuring to enable the unit testing and mocking.

@snehasish
Copy link
Contributor Author

I'm having trouble seeing where the changes to support the size returning new variants are - I just see a lot of restructuring to enable the unit testing and mocking.

Good catch, I didn't notice that my changes intended for this pull request actually sneaked into #102258. In particular, I meant to include the changes to MemProfiler.cpp extending the switch case statement in this pull request. I'll retitle this change to reflect that it adds test coverage for __size_returning_new LibFuncs in MemProfiler.cpp.

@snehasish snehasish changed the title Extend memprof matching to support __size_returning_new variants. Add unit tests for size returning new funcs in the MemProf use pass. Aug 23, 2024
Copy link
Contributor

@teresajohnson teresajohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@snehasish
Copy link
Contributor Author

Thanks for the review. I'll wait till Monday to merge this (also in case @kazutakahirata has any comments).

@snehasish snehasish merged commit 2e426fe into llvm:main Aug 26, 2024
11 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 26, 2024

LLVM Buildbot has detected a new failure on builder libc-x86_64-debian-dbg running on libc-x86_64-debian while building llvm at step 4 "annotate".

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

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcBzeroTest.SizeSweep
[       OK ] LlvmLibcBzeroTest.SizeSweep (892 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[880/1003] Running unit test libc.test.src.string.bzero_test.__unit__
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcBzeroTest.SizeSweep
[       OK ] LlvmLibcBzeroTest.SizeSweep (953 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[881/1003] Running unit test libc.test.src.stdio.fscanf_test.__unit__
FAILED: projects/libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fscanf_test.__unit__ /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/build/projects/libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fscanf_test.__unit__ 
cd /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/build/projects/libc/test/src/stdio && /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/build/projects/libc/test/src/stdio/libc.test.src.stdio.fscanf_test.__unit__.__build__
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcFScanfTest.WriteToFile
Segmentation fault
[882/1003] Running unit test libc.test.src.stdlib.strfroml_test.__unit__
[==========] Running 7 tests from 1 test suite.
[ RUN      ] LlvmLibcStrfromlTest.FloatDecimalFormat
[       OK ] LlvmLibcStrfromlTest.FloatDecimalFormat (150 us)
[ RUN      ] LlvmLibcStrfromlTest.FloatHexExpFormat
[       OK ] LlvmLibcStrfromlTest.FloatHexExpFormat (12 us)
[ RUN      ] LlvmLibcStrfromlTest.FloatDecimalAutoFormat
[       OK ] LlvmLibcStrfromlTest.FloatDecimalAutoFormat (32 ms)
[ RUN      ] LlvmLibcStrfromlTest.FloatDecimalExpFormat
[       OK ] LlvmLibcStrfromlTest.FloatDecimalExpFormat (16 ms)
[ RUN      ] LlvmLibcStrfromlTest.ImproperFormatString
[       OK ] LlvmLibcStrfromlTest.ImproperFormatString (12 us)
[ RUN      ] LlvmLibcStrfromlTest.InsufficientBufferSize
[       OK ] LlvmLibcStrfromlTest.InsufficientBufferSize (269 us)
[ RUN      ] LlvmLibcStrfromlTest.InfAndNanValues
[       OK ] LlvmLibcStrfromlTest.InfAndNanValues (6 us)
Ran 7 tests.  PASS: 7  FAIL: 0
[883/1003] Running unit test libc.test.src.string.memcmp_x86_64_opt_sse2_test.__unit__
[==========] Running 6 tests from 1 test suite.
[ RUN      ] LlvmLibcMemcmpTest.CmpZeroByte
[       OK ] LlvmLibcMemcmpTest.CmpZeroByte (3 us)
[ RUN      ] LlvmLibcMemcmpTest.LhsRhsAreTheSame
[       OK ] LlvmLibcMemcmpTest.LhsRhsAreTheSame (1 us)
[ RUN      ] LlvmLibcMemcmpTest.LhsBeforeRhsLexically
[       OK ] LlvmLibcMemcmpTest.LhsBeforeRhsLexically (1 us)
[ RUN      ] LlvmLibcMemcmpTest.LhsAfterRhsLexically
[       OK ] LlvmLibcMemcmpTest.LhsAfterRhsLexically (1 us)
[ RUN      ] LlvmLibcMemcmpTest.Issue77080
[       OK ] LlvmLibcMemcmpTest.Issue77080 (10 us)
[ RUN      ] LlvmLibcMemcmpTest.SizeSweep
[       OK ] LlvmLibcMemcmpTest.SizeSweep (13 ms)
Ran 6 tests.  PASS: 6  FAIL: 0
[884/1003] Running unit test libc.test.src.string.memcmp_x86_64_opt_sse4_test.__unit__
[==========] Running 6 tests from 1 test suite.
Step 7 (libc-unit-tests) failure: libc-unit-tests (failure)
...
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcBzeroTest.SizeSweep
[       OK ] LlvmLibcBzeroTest.SizeSweep (892 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[880/1003] Running unit test libc.test.src.string.bzero_test.__unit__
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcBzeroTest.SizeSweep
[       OK ] LlvmLibcBzeroTest.SizeSweep (953 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[881/1003] Running unit test libc.test.src.stdio.fscanf_test.__unit__
FAILED: projects/libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fscanf_test.__unit__ /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/build/projects/libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fscanf_test.__unit__ 
cd /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/build/projects/libc/test/src/stdio && /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/build/projects/libc/test/src/stdio/libc.test.src.stdio.fscanf_test.__unit__.__build__
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcFScanfTest.WriteToFile
Segmentation fault
[882/1003] Running unit test libc.test.src.stdlib.strfroml_test.__unit__
[==========] Running 7 tests from 1 test suite.
[ RUN      ] LlvmLibcStrfromlTest.FloatDecimalFormat
[       OK ] LlvmLibcStrfromlTest.FloatDecimalFormat (150 us)
[ RUN      ] LlvmLibcStrfromlTest.FloatHexExpFormat
[       OK ] LlvmLibcStrfromlTest.FloatHexExpFormat (12 us)
[ RUN      ] LlvmLibcStrfromlTest.FloatDecimalAutoFormat
[       OK ] LlvmLibcStrfromlTest.FloatDecimalAutoFormat (32 ms)
[ RUN      ] LlvmLibcStrfromlTest.FloatDecimalExpFormat
[       OK ] LlvmLibcStrfromlTest.FloatDecimalExpFormat (16 ms)
[ RUN      ] LlvmLibcStrfromlTest.ImproperFormatString
[       OK ] LlvmLibcStrfromlTest.ImproperFormatString (12 us)
[ RUN      ] LlvmLibcStrfromlTest.InsufficientBufferSize
[       OK ] LlvmLibcStrfromlTest.InsufficientBufferSize (269 us)
[ RUN      ] LlvmLibcStrfromlTest.InfAndNanValues
[       OK ] LlvmLibcStrfromlTest.InfAndNanValues (6 us)
Ran 7 tests.  PASS: 7  FAIL: 0
[883/1003] Running unit test libc.test.src.string.memcmp_x86_64_opt_sse2_test.__unit__
[==========] Running 6 tests from 1 test suite.
[ RUN      ] LlvmLibcMemcmpTest.CmpZeroByte
[       OK ] LlvmLibcMemcmpTest.CmpZeroByte (3 us)
[ RUN      ] LlvmLibcMemcmpTest.LhsRhsAreTheSame
[       OK ] LlvmLibcMemcmpTest.LhsRhsAreTheSame (1 us)
[ RUN      ] LlvmLibcMemcmpTest.LhsBeforeRhsLexically
[       OK ] LlvmLibcMemcmpTest.LhsBeforeRhsLexically (1 us)
[ RUN      ] LlvmLibcMemcmpTest.LhsAfterRhsLexically
[       OK ] LlvmLibcMemcmpTest.LhsAfterRhsLexically (1 us)
[ RUN      ] LlvmLibcMemcmpTest.Issue77080
[       OK ] LlvmLibcMemcmpTest.Issue77080 (10 us)
[ RUN      ] LlvmLibcMemcmpTest.SizeSweep
[       OK ] LlvmLibcMemcmpTest.SizeSweep (13 ms)
Ran 6 tests.  PASS: 6  FAIL: 0
[884/1003] Running unit test libc.test.src.string.memcmp_x86_64_opt_sse4_test.__unit__
[==========] Running 6 tests from 1 test suite.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 26, 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/5100

Here is the relevant piece of the build log for the reference
Step 8 (Add check check-llvm) failure: test (failure)
...
            ~~~~~~~~~~~^~~~
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/include/llvm/ProfileData/InstrProf.h: In member function ‘std::vector<llvm::InstrProfValueSiteRecord>& llvm::InstrProfRecord::getOrCreateValueSitesForKind(uint32_t)’:
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/include/llvm/ProfileData/InstrProf.h:972:23: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     assert(IPVK_First <= ValueKind && ValueKind <= IPVK_Last &&
            ~~~~~~~~~~~^~~~
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/unittests/ProfileData/CoverageMappingTest.cpp: In member function ‘virtual void {anonymous}::CoverageMappingTest_TVIdxBuilder_Test::TestBody()’:
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/unittests/ProfileData/CoverageMappingTest.cpp:1116:10: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else]
       if (Node.NextIDs[C] < 0)
          ^
[649/654] Building CXX object unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o
FAILED: unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o 
ccache /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Iunittests/Transforms/Instrumentation -I/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/unittests/Transforms/Instrumentation -Iinclude -I/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/include -I/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/third-party/unittest/googletest/include -I/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/third-party/unittest/googlemock/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG  -Wno-variadic-macros -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -Wno-suggest-override -std=c++1z -MD -MT unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o -MF unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o.d -o unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o -c /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/unittests/Transforms/Instrumentation/MemProfilerTest.cpp
In file included from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h:16:0,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/unittests/Transforms/Instrumentation/MemProfilerTest.cpp:9:
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/include/llvm/IR/ModuleSummaryIndex.h: In member function ‘llvm::TypeIdSummary& llvm::ModuleSummaryIndex::getOrInsertTypeIdSummary(llvm::StringRef)’:
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/include/llvm/IR/ModuleSummaryIndex.h:1815:33: warning: unused variable ‘GUID’ [-Wunused-variable]
     for (auto &[GUID, TypeIdPair] : make_range(TidIter))
                                 ^
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/include/llvm/IR/ModuleSummaryIndex.h: In member function ‘const llvm::TypeIdSummary* llvm::ModuleSummaryIndex::getTypeIdSummary(llvm::StringRef) const’:
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/include/llvm/IR/ModuleSummaryIndex.h:1827:39: warning: unused variable ‘GUID’ [-Wunused-variable]
     for (const auto &[GUID, TypeIdPair] : make_range(TidIter))
                                       ^
In file included from /usr/include/c++/7/cassert:44:0,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/include/llvm/ProfileData/InstrProf.h:39,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/include/llvm/ProfileData/InstrProfReader.h:21,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h:18,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/unittests/Transforms/Instrumentation/MemProfilerTest.cpp:9:
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/include/llvm/ProfileData/InstrProf.h: In member function ‘llvm::ArrayRef<llvm::InstrProfValueSiteRecord> llvm::InstrProfRecord::getValueSitesForKind(uint32_t) const’:
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/include/llvm/ProfileData/InstrProf.h:963:23: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     assert(IPVK_First <= ValueKind && ValueKind <= IPVK_Last &&
            ~~~~~~~~~~~^~~~
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/include/llvm/ProfileData/InstrProf.h: In member function ‘std::vector<llvm::InstrProfValueSiteRecord>& llvm::InstrProfRecord::getOrCreateValueSitesForKind(uint32_t)’:
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/include/llvm/ProfileData/InstrProf.h:972:23: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     assert(IPVK_First <= ValueKind && ValueKind <= IPVK_Last &&
            ~~~~~~~~~~~^~~~
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/unittests/Transforms/Instrumentation/MemProfilerTest.cpp: In static member function ‘static llvm::memprof::MemProfRecord llvm::memprof::{anonymous}::MockMemProfReader::makeRecord(llvm::ArrayRef<llvm::ArrayRef<llvm::memprof::Frame> >)’:
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/unittests/Transforms/Instrumentation/MemProfilerTest.cpp:71:68: error: class template argument deduction failed:
       AI.CallStack = std::vector(Callstack.begin(), Callstack.end());
                                                                    ^
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/unittests/Transforms/Instrumentation/MemProfilerTest.cpp:71:68: error: no matching function for call to ‘vector(llvm::ArrayRef<llvm::memprof::Frame>::iterator, llvm::ArrayRef<llvm::memprof::Frame>::iterator)’
In file included from /usr/include/c++/7/vector:64:0,
                 from /usr/include/c++/7/functional:61,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/include/llvm/ADT/SmallVector.h:24,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/include/llvm/ADT/ArrayRef.h:13,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/include/llvm/IR/ModuleSummaryIndex.h:18,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h:16,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/unittests/Transforms/Instrumentation/MemProfilerTest.cpp:9:
/usr/include/c++/7/bits/stl_vector.h:411:2: note: candidate: template<class _Tp, class _Alloc, class _InputIterator, class> vector(_InputIterator, _InputIterator, const _Alloc&)-> std::vector<_Tp, _Alloc>
  vector(_InputIterator __first, _InputIterator __last,

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 26, 2024

LLVM Buildbot has detected a new failure on builder libc-riscv64-debian-dbg running on libc-riscv64-debian while building llvm at step 4 "annotate".

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

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[ RUN      ] LlvmLibcVASPrintfTest.PercentConv
[       OK ] LlvmLibcVASPrintfTest.PercentConv (18 us)
[ RUN      ] LlvmLibcVASPrintfTest.CharConv
[       OK ] LlvmLibcVASPrintfTest.CharConv (20 us)
[ RUN      ] LlvmLibcVASPrintfTest.LargeStringNoConv
[       OK ] LlvmLibcVASPrintfTest.LargeStringNoConv (116 us)
[ RUN      ] LlvmLibcVASPrintfTest.ManyReAlloc
[       OK ] LlvmLibcVASPrintfTest.ManyReAlloc (42 us)
Ran 5 tests.  PASS: 5  FAIL: 0
[953/1124] Running unit test libc.test.src.stdio.fscanf_test.__unit__
FAILED: projects/libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fscanf_test.__unit__ /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/build/projects/libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fscanf_test.__unit__ 
cd /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/build/projects/libc/test/src/stdio && /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/build/projects/libc/test/src/stdio/libc.test.src.stdio.fscanf_test.__unit__.__build__
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcFScanfTest.WriteToFile
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/llvm-project/libc/test/src/stdio/fscanf_test.cpp:73: FAILURE
      Expected: read
      Which is: 0
To be equal to: 1
      Which is: 1
[  FAILED  ] LlvmLibcFScanfTest.WriteToFile
Ran 1 tests.  PASS: 0  FAIL: 1
[954/1124] Running unit test libc.test.src.stdio.vfscanf_test.__unit__
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcFScanfTest.WriteToFile
[       OK ] LlvmLibcFScanfTest.WriteToFile (236 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[955/1124] Running unit test libc.test.src.stdio.sprintf_test.__unit__
[==========] Running 19 tests from 1 test suite.
[ RUN      ] LlvmLibcSPrintfTest.Macros
[       OK ] LlvmLibcSPrintfTest.Macros (76 us)
[ RUN      ] LlvmLibcSPrintfTest.SimpleNoConv
[       OK ] LlvmLibcSPrintfTest.SimpleNoConv (8 us)
[ RUN      ] LlvmLibcSPrintfTest.PercentConv
[       OK ] LlvmLibcSPrintfTest.PercentConv (13 us)
[ RUN      ] LlvmLibcSPrintfTest.CharConv
[       OK ] LlvmLibcSPrintfTest.CharConv (17 us)
[ RUN      ] LlvmLibcSPrintfTest.StringConv
[       OK ] LlvmLibcSPrintfTest.StringConv (34 us)
[ RUN      ] LlvmLibcSPrintfTest.IntConv
[       OK ] LlvmLibcSPrintfTest.IntConv (384 us)
[ RUN      ] LlvmLibcSPrintfTest.HexConv
[       OK ] LlvmLibcSPrintfTest.HexConv (169 us)
[ RUN      ] LlvmLibcSPrintfTest.BinConv
[       OK ] LlvmLibcSPrintfTest.BinConv (145 us)
[ RUN      ] LlvmLibcSPrintfTest.PointerConv
[       OK ] LlvmLibcSPrintfTest.PointerConv (75 us)
[ RUN      ] LlvmLibcSPrintfTest.OctConv
[       OK ] LlvmLibcSPrintfTest.OctConv (169 us)
[ RUN      ] LlvmLibcSPrintfTest.FloatHexExpConv
Step 7 (libc-unit-tests) failure: libc-unit-tests (failure)
...
[ RUN      ] LlvmLibcVASPrintfTest.PercentConv
[       OK ] LlvmLibcVASPrintfTest.PercentConv (18 us)
[ RUN      ] LlvmLibcVASPrintfTest.CharConv
[       OK ] LlvmLibcVASPrintfTest.CharConv (20 us)
[ RUN      ] LlvmLibcVASPrintfTest.LargeStringNoConv
[       OK ] LlvmLibcVASPrintfTest.LargeStringNoConv (116 us)
[ RUN      ] LlvmLibcVASPrintfTest.ManyReAlloc
[       OK ] LlvmLibcVASPrintfTest.ManyReAlloc (42 us)
Ran 5 tests.  PASS: 5  FAIL: 0
[953/1124] Running unit test libc.test.src.stdio.fscanf_test.__unit__
FAILED: projects/libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fscanf_test.__unit__ /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/build/projects/libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.fscanf_test.__unit__ 
cd /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/build/projects/libc/test/src/stdio && /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/build/projects/libc/test/src/stdio/libc.test.src.stdio.fscanf_test.__unit__.__build__
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcFScanfTest.WriteToFile
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-dbg/llvm-project/libc/test/src/stdio/fscanf_test.cpp:73: FAILURE
      Expected: read
      Which is: 0
To be equal to: 1
      Which is: 1
[  FAILED  ] LlvmLibcFScanfTest.WriteToFile
Ran 1 tests.  PASS: 0  FAIL: 1
[954/1124] Running unit test libc.test.src.stdio.vfscanf_test.__unit__
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcFScanfTest.WriteToFile
[       OK ] LlvmLibcFScanfTest.WriteToFile (236 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[955/1124] Running unit test libc.test.src.stdio.sprintf_test.__unit__
[==========] Running 19 tests from 1 test suite.
[ RUN      ] LlvmLibcSPrintfTest.Macros
[       OK ] LlvmLibcSPrintfTest.Macros (76 us)
[ RUN      ] LlvmLibcSPrintfTest.SimpleNoConv
[       OK ] LlvmLibcSPrintfTest.SimpleNoConv (8 us)
[ RUN      ] LlvmLibcSPrintfTest.PercentConv
[       OK ] LlvmLibcSPrintfTest.PercentConv (13 us)
[ RUN      ] LlvmLibcSPrintfTest.CharConv
[       OK ] LlvmLibcSPrintfTest.CharConv (17 us)
[ RUN      ] LlvmLibcSPrintfTest.StringConv
[       OK ] LlvmLibcSPrintfTest.StringConv (34 us)
[ RUN      ] LlvmLibcSPrintfTest.IntConv
[       OK ] LlvmLibcSPrintfTest.IntConv (384 us)
[ RUN      ] LlvmLibcSPrintfTest.HexConv
[       OK ] LlvmLibcSPrintfTest.HexConv (169 us)
[ RUN      ] LlvmLibcSPrintfTest.BinConv
[       OK ] LlvmLibcSPrintfTest.BinConv (145 us)
[ RUN      ] LlvmLibcSPrintfTest.PointerConv
[       OK ] LlvmLibcSPrintfTest.PointerConv (75 us)
[ RUN      ] LlvmLibcSPrintfTest.OctConv
[       OK ] LlvmLibcSPrintfTest.OctConv (169 us)
[ RUN      ] LlvmLibcSPrintfTest.FloatHexExpConv

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 26, 2024

LLVM Buildbot has detected a new failure on builder llvm-nvptx-nvidia-ubuntu running on as-builder-7 while building llvm at step 6 "test-build-unified-tree-check-llvm".

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

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-llvm) failure: test (failure)
...
1.189 [3/6/652] Linking CXX executable unittests/Support/SupportTests
1.205 [3/5/653] Linking CXX executable unittests/ADT/ADTTests
10.207 [3/4/654] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/CoverageMappingTest.cpp.o
/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/unittests/ProfileData/CoverageMappingTest.cpp: In member function ‘virtual void {anonymous}::CoverageMappingTest_TVIdxBuilder_Test::TestBody()’:
/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/unittests/ProfileData/CoverageMappingTest.cpp:1116:10: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else]
 1116 |       if (Node.NextIDs[C] < 0)
      |          ^
11.574 [3/3/655] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/MemProfTest.cpp.o
12.284 [3/2/656] Building CXX object unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o
12.393 [2/2/657] Linking CXX executable unittests/Transforms/Instrumentation/InstrumentationTests
FAILED: unittests/Transforms/Instrumentation/InstrumentationTests 
: && /usr/bin/c++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -fuse-ld=gold     -Wl,--gc-sections unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/PGOInstrumentationTest.cpp.o unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o -o unittests/Transforms/Instrumentation/InstrumentationTests  -Wl,-rpath,/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/build/lib  lib/libLLVMPasses.so.20.0git  lib/libllvm_gtest_main.so.20.0git  lib/libLLVMTestingSupport.so.20.0git  lib/libLLVMInstrumentation.so.20.0git  lib/libLLVMAnalysis.so.20.0git  lib/libLLVMAsmParser.so.20.0git  lib/libLLVMCore.so.20.0git  lib/libllvm_gtest.so.20.0git  lib/libLLVMSupport.so.20.0git  -Wl,-rpath-link,/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/build/lib && :
unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o:MemProfilerTest.cpp:function llvm::memprof::(anonymous namespace)::MockMemProfReader::~MockMemProfReader(): error: undefined reference to 'vtable for llvm::IndexedMemProfReader'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o:MemProfilerTest.cpp:function llvm::memprof::(anonymous namespace)::MockMemProfReader::~MockMemProfReader(): error: undefined reference to 'vtable for llvm::IndexedMemProfReader'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o:MemProfilerTest.cpp:function llvm::IndexedMemProfReader::~IndexedMemProfReader(): error: undefined reference to 'vtable for llvm::IndexedMemProfReader'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o:MemProfilerTest.cpp:function llvm::memprof::(anonymous namespace)::MemProfilerTest_AnnotatesCall_Test::TestBody(): error: undefined reference to 'llvm::memprof::getHotColdSchema()'
collect2: error: ld returned 1 exit status
18.578 [2/1/658] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/InstrProfTest.cpp.o
ninja: build stopped: subcommand failed.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 26, 2024

LLVM Buildbot has detected a new failure on builder llvm-nvptx64-nvidia-ubuntu running on as-builder-7 while building llvm at step 6 "test-build-unified-tree-check-llvm".

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

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-llvm) failure: test (failure)
...
1.326 [3/6/652] Linking CXX executable unittests/Support/SupportTests
1.337 [3/5/653] Linking CXX executable unittests/ADT/ADTTests
10.493 [3/4/654] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/CoverageMappingTest.cpp.o
/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/unittests/ProfileData/CoverageMappingTest.cpp: In member function ‘virtual void {anonymous}::CoverageMappingTest_TVIdxBuilder_Test::TestBody()’:
/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/unittests/ProfileData/CoverageMappingTest.cpp:1116:10: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else]
 1116 |       if (Node.NextIDs[C] < 0)
      |          ^
11.679 [3/3/655] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/MemProfTest.cpp.o
11.935 [3/2/656] Building CXX object unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o
12.041 [2/2/657] Linking CXX executable unittests/Transforms/Instrumentation/InstrumentationTests
FAILED: unittests/Transforms/Instrumentation/InstrumentationTests 
: && /usr/bin/c++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -fuse-ld=gold     -Wl,--gc-sections unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/PGOInstrumentationTest.cpp.o unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o -o unittests/Transforms/Instrumentation/InstrumentationTests  -Wl,-rpath,/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/lib  lib/libLLVMPasses.so.20.0git  lib/libllvm_gtest_main.so.20.0git  lib/libLLVMTestingSupport.so.20.0git  lib/libLLVMInstrumentation.so.20.0git  lib/libLLVMAnalysis.so.20.0git  lib/libLLVMAsmParser.so.20.0git  lib/libLLVMCore.so.20.0git  lib/libllvm_gtest.so.20.0git  lib/libLLVMSupport.so.20.0git  -Wl,-rpath-link,/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/lib && :
unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o:MemProfilerTest.cpp:function llvm::memprof::(anonymous namespace)::MockMemProfReader::~MockMemProfReader(): error: undefined reference to 'vtable for llvm::IndexedMemProfReader'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o:MemProfilerTest.cpp:function llvm::memprof::(anonymous namespace)::MockMemProfReader::~MockMemProfReader(): error: undefined reference to 'vtable for llvm::IndexedMemProfReader'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o:MemProfilerTest.cpp:function llvm::IndexedMemProfReader::~IndexedMemProfReader(): error: undefined reference to 'vtable for llvm::IndexedMemProfReader'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o:MemProfilerTest.cpp:function llvm::memprof::(anonymous namespace)::MemProfilerTest_AnnotatesCall_Test::TestBody(): error: undefined reference to 'llvm::memprof::getHotColdSchema()'
collect2: error: ld returned 1 exit status
21.034 [2/1/658] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/InstrProfTest.cpp.o
ninja: build stopped: subcommand failed.

@snehasish
Copy link
Contributor Author

Looking into the failures that were reported --

  • The libc-x86_64-debian-dbg and libc-riscv64-debian-dbg buildbot failures are unrelated.
  • The llvm-nvptx64-nvidia-ubuntu and llvm-nvptx-nvidia-ubuntu builders have linker undefined errors but they are using gold.
  • The openmp-offload-sles-build-only has a CTAD error which doesn't reproduce locally for me.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 26, 2024

LLVM Buildbot has detected a new failure on builder clang-ppc64le-rhel running on ppc64le-clang-rhel-test while building llvm at step 7 "test-build-unified-tree-check-all".

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

Here is the relevant piece of the build log for the reference
Step 7 (test-build-unified-tree-check-all) failure: test (failure)
...
0.163 [1/2/2] Building CXX object compiler-rt/lib/ubsan/CMakeFiles/RTUbsan_dynamic_version_script_dummy.powerpc64le.dir/dummy.cpp.o
0.361 [0/2/3] Linking CXX shared library /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/lib/clang/20/lib/powerpc64le-unknown-linux-gnu/libclang_rt.ubsan_standalone.so
0.387 [0/1/4] Linking CXX shared library /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/lib/clang/20/lib/powerpc64le-unknown-linux-gnu/libclang_rt.asan.so
23.933 [5/5/1167] cd /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/runtimes/runtimes-bins && /home/buildbots/llvm-external-buildbots/cmake-3.28.2/bin/cmake --build /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/runtimes/runtimes-bins/ --target runtimes-test-depends --config Release
ninja: no work to do.
23.997 [4/5/1168] No install step for 'runtimes'
24.020 [3/5/1170] Completed 'runtimes'
35.449 [3/4/1171] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/CoverageMappingTest.cpp.o
37.778 [3/3/1172] Building CXX object unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o
37.833 [2/3/1173] Linking CXX executable unittests/Transforms/Instrumentation/InstrumentationTests
FAILED: unittests/Transforms/Instrumentation/InstrumentationTests 
: && /home/docker/llvm-external-buildbots/clang.17.0.6/bin/clang++ --gcc-toolchain=/gcc-toolchain/usr -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -Wl,--color-diagnostics     -Wl,--gc-sections unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/PGOInstrumentationTest.cpp.o unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o -o unittests/Transforms/Instrumentation/InstrumentationTests  -Wl,-rpath,/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/lib  lib/libLLVMPasses.so.20.0git  -lpthread  lib/libllvm_gtest_main.so.20.0git  -lpthread  lib/libLLVMTestingSupport.so.20.0git  lib/libLLVMInstrumentation.so.20.0git  lib/libLLVMAnalysis.so.20.0git  lib/libLLVMAsmParser.so.20.0git  lib/libLLVMCore.so.20.0git  lib/libllvm_gtest.so.20.0git  lib/libLLVMSupport.so.20.0git  -Wl,-rpath-link,/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/lib && :
ld.lld: error: undefined symbol: llvm::memprof::getHotColdSchema()
>>> referenced by MemProfilerTest.cpp
>>>               unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o:(llvm::memprof::(anonymous namespace)::MemProfilerTest_AnnotatesCall_Test::TestBody())

ld.lld: error: undefined symbol: vtable for llvm::IndexedMemProfReader
>>> referenced by MemProfilerTest.cpp
>>>               unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o:(.toc+0x38)
>>> the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
38.153 [2/2/1174] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/MemProfTest.cpp.o
45.778 [2/1/1175] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/InstrProfTest.cpp.o
ninja: build stopped: subcommand failed.

snehasish added a commit to snehasish/llvm-project that referenced this pull request Aug 26, 2024
@snehasish
Copy link
Contributor Author

I'll revert for now (#106114) and test with ld.gold before I resubmit.

snehasish added a commit that referenced this pull request Aug 26, 2024
@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 26, 2024

LLVM Buildbot has detected a new failure on builder clang-ppc64le-linux-multistage running on ppc64le-clang-multistage-test while building llvm at step 5 "ninja check 1".

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

Here is the relevant piece of the build log for the reference
Step 5 (ninja check 1) failure: stage 1 checked (failure)
...
                 from /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/llvm/unittests/Transforms/Instrumentation/MemProfilerTest.cpp:9:
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/llvm/include/llvm/ProfileData/InstrProf.h: In member function ‘llvm::ArrayRef<llvm::InstrProfValueSiteRecord> llvm::InstrProfRecord::getValueSitesForKind(uint32_t) const’:
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/llvm/include/llvm/ProfileData/InstrProf.h:963:23: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     assert(IPVK_First <= ValueKind && ValueKind <= IPVK_Last &&
            ~~~~~~~~~~~^~~~~~~~~~~~
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/llvm/include/llvm/ProfileData/InstrProf.h: In member function ‘std::vector<llvm::InstrProfValueSiteRecord>& llvm::InstrProfRecord::getOrCreateValueSitesForKind(uint32_t)’:
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/llvm/include/llvm/ProfileData/InstrProf.h:972:23: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     assert(IPVK_First <= ValueKind && ValueKind <= IPVK_Last &&
            ~~~~~~~~~~~^~~~~~~~~~~~
[1164/1173] Linking CXX executable unittests/Transforms/Instrumentation/InstrumentationTests
FAILED: unittests/Transforms/Instrumentation/InstrumentationTests 
: && /usr/lib64/ccache/c++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -Wl,--gc-sections unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/PGOInstrumentationTest.cpp.o unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o -o unittests/Transforms/Instrumentation/InstrumentationTests  -Wl,-rpath,/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/lib  lib/libLLVMPasses.so.20.0git  -lpthread  lib/libllvm_gtest_main.so.20.0git  -lpthread  lib/libLLVMTestingSupport.so.20.0git  lib/libLLVMInstrumentation.so.20.0git  lib/libLLVMAnalysis.so.20.0git  lib/libLLVMAsmParser.so.20.0git  lib/libLLVMCore.so.20.0git  lib/libllvm_gtest.so.20.0git  lib/libLLVMSupport.so.20.0git  -Wl,-rpath-link,/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/lib && :
/usr/bin/ld: unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o: undefined reference to symbol '_ZTVN4llvm20IndexedMemProfReaderE'
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/lib/libLLVMProfileData.so.20.0git: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
[1165/1173] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/CoverageMappingTest.cpp.o
In file included from /usr/include/c++/8/cassert:44,
                 from /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/llvm/include/llvm/ProfileData/InstrProf.h:39,
                 from /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h:27,
                 from /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/llvm/unittests/ProfileData/CoverageMappingTest.cpp:9:
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/llvm/include/llvm/ProfileData/InstrProf.h: In member function ‘llvm::ArrayRef<llvm::InstrProfValueSiteRecord> llvm::InstrProfRecord::getValueSitesForKind(uint32_t) const’:
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/llvm/include/llvm/ProfileData/InstrProf.h:963:23: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     assert(IPVK_First <= ValueKind && ValueKind <= IPVK_Last &&
            ~~~~~~~~~~~^~~~~~~~~~~~
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/llvm/include/llvm/ProfileData/InstrProf.h: In member function ‘std::vector<llvm::InstrProfValueSiteRecord>& llvm::InstrProfRecord::getOrCreateValueSitesForKind(uint32_t)’:
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/llvm/include/llvm/ProfileData/InstrProf.h:972:23: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     assert(IPVK_First <= ValueKind && ValueKind <= IPVK_Last &&
            ~~~~~~~~~~~^~~~~~~~~~~~
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/llvm/unittests/ProfileData/CoverageMappingTest.cpp: In member function ‘virtual void {anonymous}::CoverageMappingTest_TVIdxBuilder_Test::TestBody()’:
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/llvm/unittests/ProfileData/CoverageMappingTest.cpp:1116:10: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else]
       if (Node.NextIDs[C] < 0)
          ^
[1166/1173] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/MemProfTest.cpp.o
In file included from /usr/include/c++/8/cassert:44,
                 from /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/llvm/include/llvm/ProfileData/InstrProf.h:39,
                 from /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/llvm/include/llvm/ProfileData/InstrProfReader.h:21,
                 from /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/llvm/include/llvm/ProfileData/MemProfReader.h:24,
                 from /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/llvm/unittests/ProfileData/MemProfTest.cpp:18:
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/llvm/include/llvm/ProfileData/InstrProf.h: In member function ‘llvm::ArrayRef<llvm::InstrProfValueSiteRecord> llvm::InstrProfRecord::getValueSitesForKind(uint32_t) const’:
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/llvm/include/llvm/ProfileData/InstrProf.h:963:23: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     assert(IPVK_First <= ValueKind && ValueKind <= IPVK_Last &&
            ~~~~~~~~~~~^~~~~~~~~~~~
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/llvm/include/llvm/ProfileData/InstrProf.h: In member function ‘std::vector<llvm::InstrProfValueSiteRecord>& llvm::InstrProfRecord::getOrCreateValueSitesForKind(uint32_t)’:
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/llvm/include/llvm/ProfileData/InstrProf.h:972:23: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     assert(IPVK_First <= ValueKind && ValueKind <= IPVK_Last &&
            ~~~~~~~~~~~^~~~~~~~~~~~
[1167/1173] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/InstrProfTest.cpp.o
In file included from /usr/include/c++/8/cassert:44,
                 from /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/llvm/include/llvm/ProfileData/InstrProf.h:39,
Step 11 (ninja check 2) failure: stage 2 checked (failure)
...
2 warning(s) in tests

Testing Time: 176.43s

Total Discovered Tests: 4242
  Skipped          :    9 (0.21%)
  Unsupported      : 1150 (27.11%)
  Passed           : 3042 (71.71%)
  Expectedly Failed:   41 (0.97%)
[763/1173] Linking CXX executable unittests/Transforms/Instrumentation/InstrumentationTests
FAILED: unittests/Transforms/Instrumentation/InstrumentationTests 
: && /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1.install/bin/clang++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -Wl,--gc-sections unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/PGOInstrumentationTest.cpp.o unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o -o unittests/Transforms/Instrumentation/InstrumentationTests  -Wl,-rpath,/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage2/lib  lib/libLLVMPasses.so.20.0git  -lpthread  lib/libllvm_gtest_main.so.20.0git  -lpthread  lib/libLLVMTestingSupport.so.20.0git  lib/libLLVMInstrumentation.so.20.0git  lib/libLLVMAnalysis.so.20.0git  lib/libLLVMAsmParser.so.20.0git  lib/libLLVMCore.so.20.0git  lib/libllvm_gtest.so.20.0git  lib/libLLVMSupport.so.20.0git  -Wl,-rpath-link,/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage2/lib && :
/usr/bin/ld: unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o: undefined reference to symbol '_ZTVN4llvm20IndexedMemProfReaderE'
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage2/lib/libLLVMProfileData.so.20.0git: error adding symbols: DSO missing from command line
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[1117/1173] Building CXX object unittests/ADT/CMakeFiles/ADTTests.dir/SmallVectorTest.cpp.o
[1119/1173] Building CXX object tools/clang/unittests/AST/CMakeFiles/ASTTests.dir/ASTImporterTest.cpp.o
[1120/1173] Building CXX object tools/clang/unittests/ASTMatchers/CMakeFiles/ASTMatchersTests.dir/ASTMatchersTraversalTest.cpp.o
[1121/1173] Building CXX object tools/clang/unittests/Tooling/CMakeFiles/ToolingTests.dir/SourceCodeTest.cpp.o
ninja: build stopped: subcommand failed.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Feb 25, 2025

LLVM Buildbot has detected a new failure on builder openmp-offload-amdgpu-runtime-2 running on rocm-worker-hw-02 while building llvm at step 8 "Add check check-llvm".

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

Here is the relevant piece of the build log for the reference
Step 8 (Add check check-llvm) failure: test (failure)
...
[646/654] Linking CXX executable unittests/Target/AMDGPU/AMDGPUTests
[647/654] Linking CXX executable unittests/Support/SupportTests
[648/654] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/CoverageMappingTest.cpp.o
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/unittests/ProfileData/CoverageMappingTest.cpp: In member function ‘virtual void {anonymous}::CoverageMappingTest_TVIdxBuilder_Test::TestBody()’:
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/unittests/ProfileData/CoverageMappingTest.cpp:1116:10: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else]
 1116 |       if (Node.NextIDs[C] < 0)
      |          ^
[649/654] Building CXX object unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o
[650/654] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/MemProfTest.cpp.o
[651/654] Linking CXX executable unittests/Transforms/Instrumentation/InstrumentationTests
FAILED: unittests/Transforms/Instrumentation/InstrumentationTests 
: && /usr/bin/c++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -Wl,--gc-sections unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/PGOInstrumentationTest.cpp.o unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o -o unittests/Transforms/Instrumentation/InstrumentationTests  -Wl,-rpath,/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib  lib/libLLVMPasses.so.20.0git  lib/libllvm_gtest_main.so.20.0git  lib/libLLVMTestingSupport.so.20.0git  lib/libLLVMInstrumentation.so.20.0git  lib/libLLVMAnalysis.so.20.0git  lib/libLLVMAsmParser.so.20.0git  lib/libLLVMCore.so.20.0git  lib/libllvm_gtest.so.20.0git  lib/libLLVMSupport.so.20.0git  -Wl,-rpath-link,/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib && :
/usr/bin/ld: unittests/Transforms/Instrumentation/CMakeFiles/InstrumentationTests.dir/MemProfilerTest.cpp.o: undefined reference to symbol '_ZTVN4llvm20IndexedMemProfReaderE'
/usr/bin/ld: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/libLLVMProfileData.so.20.0git: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
[652/654] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/InstrProfTest.cpp.o
ninja: build stopped: subcommand failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
llvm:transforms PGO Profile Guided Optimizations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants