Skip to content
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

[llvm] Use llvm::sort (NFC) #96434

Merged
merged 2 commits into from
Jun 23, 2024

Conversation

kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Collaborator

llvmbot commented Jun 23, 2024

@llvm/pr-subscribers-llvm-transforms
@llvm/pr-subscribers-backend-nvptx
@llvm/pr-subscribers-pgo
@llvm/pr-subscribers-backend-amdgpu

@llvm/pr-subscribers-backend-arm

Author: Kazu Hirata (kazutakahirata)

Changes

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

15 Files Affected:

  • (modified) llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp (+4-5)
  • (modified) llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp (+3-3)
  • (modified) llvm/lib/DWARFLinker/Parallel/ArrayList.h (+1-1)
  • (modified) llvm/lib/ExecutionEngine/Orc/Core.cpp (+3-2)
  • (modified) llvm/lib/ExecutionEngine/Orc/Debugging/DebugInfoSupport.cpp (+1-1)
  • (modified) llvm/lib/ProfileData/InstrProfReader.cpp (+1-1)
  • (modified) llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp (+3-4)
  • (modified) llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp (+2-2)
  • (modified) llvm/lib/Target/NVPTX/NVVMReflect.cpp (+1-1)
  • (modified) llvm/lib/Target/PowerPC/PPCMergeStringPool.cpp (+1-1)
  • (modified) llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp (+3-3)
  • (modified) llvm/lib/Transforms/Utils/CodeLayout.cpp (+15-18)
  • (modified) llvm/tools/llvm-jitlink/llvm-jitlink.cpp (+3-4)
  • (modified) llvm/utils/TableGen/ARMTargetDefEmitter.cpp (+1-1)
  • (modified) llvm/utils/TableGen/ExegesisEmitter.cpp (+1-2)
diff --git a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
index 8afd75069589e..012417553ff19 100644
--- a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
+++ b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
@@ -2231,11 +2231,10 @@ static AssignmentTrackingLowering::OverlapMap buildOverlapMapAndRecordDeclares(
   // order of fragment size - there should be no duplicates.
   for (auto &Pair : FragmentMap) {
     SmallVector<DebugVariable, 8> &Frags = Pair.second;
-    std::sort(Frags.begin(), Frags.end(),
-              [](const DebugVariable &Next, const DebugVariable &Elmt) {
-                return Elmt.getFragmentOrDefault().SizeInBits >
-                       Next.getFragmentOrDefault().SizeInBits;
-              });
+    llvm::sort(Frags, [](const DebugVariable &Next, const DebugVariable &Elmt) {
+      return Elmt.getFragmentOrDefault().SizeInBits >
+             Next.getFragmentOrDefault().SizeInBits;
+    });
     // Check for duplicates.
     assert(std::adjacent_find(Frags.begin(), Frags.end()) == Frags.end());
   }
diff --git a/llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp b/llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp
index f3a961f883517..b8b46791b47e9 100644
--- a/llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp
+++ b/llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp
@@ -963,9 +963,9 @@ void extractInstructionFeatures(
   // frequency vector, mapping each instruction to its associated MBB.
 
   // Start off by sorting the segments based on the beginning slot index.
-  std::sort(
-      LRPosInfo.begin(), LRPosInfo.end(),
-      [](LRStartEndInfo A, LRStartEndInfo B) { return A.Begin < B.Begin; });
+  llvm::sort(LRPosInfo, [](LRStartEndInfo A, LRStartEndInfo B) {
+    return A.Begin < B.Begin;
+  });
   size_t InstructionIndex = 0;
   size_t CurrentSegmentIndex = 0;
   SlotIndex CurrentIndex = LRPosInfo[0].Begin;
diff --git a/llvm/lib/DWARFLinker/Parallel/ArrayList.h b/llvm/lib/DWARFLinker/Parallel/ArrayList.h
index c48f828609be2..1dc7bfa11d106 100644
--- a/llvm/lib/DWARFLinker/Parallel/ArrayList.h
+++ b/llvm/lib/DWARFLinker/Parallel/ArrayList.h
@@ -82,7 +82,7 @@ template <typename T, size_t ItemsGroupSize = 512> class ArrayList {
     forEach([&](T &Item) { SortedItems.push_back(Item); });
 
     if (SortedItems.size()) {
-      std::sort(SortedItems.begin(), SortedItems.end(), Comparator);
+      llvm::sort(SortedItems, Comparator);
 
       size_t SortedItemIdx = 0;
       forEach([&](T &Item) { Item = SortedItems[SortedItemIdx++]; });
diff --git a/llvm/lib/ExecutionEngine/Orc/Core.cpp b/llvm/lib/ExecutionEngine/Orc/Core.cpp
index f03dd434b704b..6ff009aec1390 100644
--- a/llvm/lib/ExecutionEngine/Orc/Core.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/Core.cpp
@@ -1155,8 +1155,9 @@ void JITDylib::dump(raw_ostream &OS) {
     std::vector<std::pair<SymbolStringPtr, SymbolTableEntry *>> SymbolsSorted;
     for (auto &KV : Symbols)
       SymbolsSorted.emplace_back(KV.first, &KV.second);
-    std::sort(SymbolsSorted.begin(), SymbolsSorted.end(),
-              [](const auto &L, const auto &R) { return *L.first < *R.first; });
+    llvm::sort(SymbolsSorted, [](const auto &L, const auto &R) {
+      return *L.first < *R.first;
+    });
 
     for (auto &KV : SymbolsSorted) {
       OS << "    \"" << *KV.first << "\": ";
diff --git a/llvm/lib/ExecutionEngine/Orc/Debugging/DebugInfoSupport.cpp b/llvm/lib/ExecutionEngine/Orc/Debugging/DebugInfoSupport.cpp
index 5a058bd712a3e..60efa0cb6f53a 100644
--- a/llvm/lib/ExecutionEngine/Orc/Debugging/DebugInfoSupport.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/Debugging/DebugInfoSupport.cpp
@@ -50,7 +50,7 @@ static void preserveDWARFSection(LinkGraph &G, Section &Sec) {
 static SmallVector<char, 0> getSectionData(Section &Sec) {
   SmallVector<char, 0> SecData;
   SmallVector<Block *, 8> SecBlocks(Sec.blocks().begin(), Sec.blocks().end());
-  std::sort(SecBlocks.begin(), SecBlocks.end(), [](Block *LHS, Block *RHS) {
+  llvm::sort(SecBlocks, [](Block *LHS, Block *RHS) {
     return LHS->getAddress() < RHS->getAddress();
   });
   // Convert back to what object file would have, one blob of section content
diff --git a/llvm/lib/ProfileData/InstrProfReader.cpp b/llvm/lib/ProfileData/InstrProfReader.cpp
index e18ce5d373d1c..987fbad30720b 100644
--- a/llvm/lib/ProfileData/InstrProfReader.cpp
+++ b/llvm/lib/ProfileData/InstrProfReader.cpp
@@ -476,7 +476,7 @@ RawInstrProfReader<IntPtrT>::getTemporalProfTraces(
     return TemporalProfTraces;
   }
   // Sort functions by their timestamps to build the trace.
-  std::sort(TemporalProfTimestamps.begin(), TemporalProfTimestamps.end());
+  llvm::sort(TemporalProfTimestamps);
   TemporalProfTraceTy Trace;
   if (Weight)
     Trace.Weight = *Weight;
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp b/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp
index 86f28a5057694..d65087edc6dc9 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp
@@ -612,10 +612,9 @@ void PipelineSolver::populateReadyList(
   }
 
   if (UseCostHeur) {
-    std::sort(ReadyList.begin(), ReadyList.end(),
-              [](std::pair<int, int> A, std::pair<int, int> B) {
-                return A.second < B.second;
-              });
+    llvm::sort(ReadyList, [](std::pair<int, int> A, std::pair<int, int> B) {
+      return A.second < B.second;
+    });
   }
 
   assert(ReadyList.size() == CurrSU.second.size());
diff --git a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
index e81e6bb697588..ccb60348df3e2 100644
--- a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
+++ b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
@@ -6886,8 +6886,8 @@ bool ARMPipelinerLoopInfo::tooMuchRegisterPressure(SwingSchedulerDAG &SSD,
          ++Stage) {
       std::deque<SUnit *> Instrs =
           SMS.getInstructions(Cycle + Stage * SMS.getInitiationInterval());
-      std::sort(Instrs.begin(), Instrs.end(),
-                [](SUnit *A, SUnit *B) { return A->NodeNum > B->NodeNum; });
+      llvm::sort(Instrs,
+                 [](SUnit *A, SUnit *B) { return A->NodeNum > B->NodeNum; });
       for (SUnit *SU : Instrs)
         ProposedSchedule.push_back(SU);
     }
diff --git a/llvm/lib/Target/NVPTX/NVVMReflect.cpp b/llvm/lib/Target/NVPTX/NVVMReflect.cpp
index 4024953bb51db..c02e4872e4b1a 100644
--- a/llvm/lib/Target/NVPTX/NVVMReflect.cpp
+++ b/llvm/lib/Target/NVPTX/NVVMReflect.cpp
@@ -208,7 +208,7 @@ static bool runNVVMReflect(Function &F, unsigned SmVersion) {
 
   // Removing via isInstructionTriviallyDead may add duplicates to the ToRemove
   // array. Filter out the duplicates before starting to erase from parent.
-  std::sort(ToRemove.begin(), ToRemove.end());
+  llvm::sort(ToRemove);
   auto NewLastIter = llvm::unique(ToRemove);
   ToRemove.erase(NewLastIter, ToRemove.end());
 
diff --git a/llvm/lib/Target/PowerPC/PPCMergeStringPool.cpp b/llvm/lib/Target/PowerPC/PPCMergeStringPool.cpp
index 309938accdf4c..af028de47d937 100644
--- a/llvm/lib/Target/PowerPC/PPCMergeStringPool.cpp
+++ b/llvm/lib/Target/PowerPC/PPCMergeStringPool.cpp
@@ -244,7 +244,7 @@ bool PPCMergeStringPool::mergeModuleStringPool(Module &M) {
     return false;
 
   // Sort the global constants to make access more efficient.
-  std::sort(MergeableStrings.begin(), MergeableStrings.end(), CompareConstants);
+  llvm::sort(MergeableStrings, CompareConstants);
 
   SmallVector<Constant *> ConstantsInStruct;
   for (GlobalVariable *GV : MergeableStrings)
diff --git a/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp b/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
index c1e5ab1a2b561..0001d0750d9c1 100644
--- a/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
+++ b/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
@@ -2203,7 +2203,7 @@ void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::ContextNode::print(
   // Make a copy of the computed context ids that we can sort for stability.
   auto ContextIds = getContextIds();
   std::vector<uint32_t> SortedIds(ContextIds.begin(), ContextIds.end());
-  std::sort(SortedIds.begin(), SortedIds.end());
+  llvm::sort(SortedIds);
   for (auto Id : SortedIds)
     OS << " " << Id;
   OS << "\n";
@@ -2238,7 +2238,7 @@ void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::ContextEdge::print(
      << " AllocTypes: " << getAllocTypeString(AllocTypes);
   OS << " ContextIds:";
   std::vector<uint32_t> SortedIds(ContextIds.begin(), ContextIds.end());
-  std::sort(SortedIds.begin(), SortedIds.end());
+  llvm::sort(SortedIds);
   for (auto Id : SortedIds)
     OS << " " << Id;
 }
@@ -2380,7 +2380,7 @@ struct DOTGraphTraits<const CallsiteContextGraph<DerivedCCG, FuncTy, CallTy> *>
     std::string IdString = "ContextIds:";
     if (ContextIds.size() < 100) {
       std::vector<uint32_t> SortedIds(ContextIds.begin(), ContextIds.end());
-      std::sort(SortedIds.begin(), SortedIds.end());
+      llvm::sort(SortedIds);
       for (auto Id : SortedIds)
         IdString += (" " + Twine(Id)).str();
     } else {
diff --git a/llvm/lib/Transforms/Utils/CodeLayout.cpp b/llvm/lib/Transforms/Utils/CodeLayout.cpp
index 95edd27c675d2..dbadad3905ac7 100644
--- a/llvm/lib/Transforms/Utils/CodeLayout.cpp
+++ b/llvm/lib/Transforms/Utils/CodeLayout.cpp
@@ -986,16 +986,15 @@ class ExtTSPImpl {
     }
 
     // Sorting chains by density in the decreasing order.
-    std::sort(SortedChains.begin(), SortedChains.end(),
-              [&](const ChainT *L, const ChainT *R) {
-                // Place the entry point at the beginning of the order.
-                if (L->isEntry() != R->isEntry())
-                  return L->isEntry();
-
-                // Compare by density and break ties by chain identifiers.
-                return std::make_tuple(-L->density(), L->Id) <
-                       std::make_tuple(-R->density(), R->Id);
-              });
+    llvm::sort(SortedChains, [&](const ChainT *L, const ChainT *R) {
+      // Place the entry point at the beginning of the order.
+      if (L->isEntry() != R->isEntry())
+        return L->isEntry();
+
+      // Compare by density and break ties by chain identifiers.
+      return std::make_tuple(-L->density(), L->Id) <
+             std::make_tuple(-R->density(), R->Id);
+    });
 
     // Collect the nodes in the order specified by their chains.
     std::vector<uint64_t> Order;
@@ -1355,14 +1354,12 @@ class CDSortImpl {
     }
 
     // Sort chains by density in the decreasing order.
-    std::sort(SortedChains.begin(), SortedChains.end(),
-              [&](const ChainT *L, const ChainT *R) {
-                const double DL = ChainDensity[L];
-                const double DR = ChainDensity[R];
-                // Compare by density and break ties by chain identifiers.
-                return std::make_tuple(-DL, L->Id) <
-                       std::make_tuple(-DR, R->Id);
-              });
+    llvm::sort(SortedChains, [&](const ChainT *L, const ChainT *R) {
+      const double DL = ChainDensity[L];
+      const double DR = ChainDensity[R];
+      // Compare by density and break ties by chain identifiers.
+      return std::make_tuple(-DL, L->Id) < std::make_tuple(-DR, R->Id);
+    });
 
     // Collect the nodes in the order specified by their chains.
     std::vector<uint64_t> Order;
diff --git a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
index bff05b9ca4beb..acf663a6c0e8f 100644
--- a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
+++ b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
@@ -1259,10 +1259,9 @@ Error Session::FileInfo::registerMultiStubEntry(
                      Sym.getTargetFlags());
 
   // Let's keep stubs ordered by ascending address.
-  std::sort(Entry.begin(), Entry.end(),
-            [](const MemoryRegionInfo &L, const MemoryRegionInfo &R) {
-              return L.getTargetAddress() < R.getTargetAddress();
-            });
+  llvm::sort(Entry, [](const MemoryRegionInfo &L, const MemoryRegionInfo &R) {
+    return L.getTargetAddress() < R.getTargetAddress();
+  });
 
   return Error::success();
 }
diff --git a/llvm/utils/TableGen/ARMTargetDefEmitter.cpp b/llvm/utils/TableGen/ARMTargetDefEmitter.cpp
index e22f353b451f9..c4143747f3770 100644
--- a/llvm/utils/TableGen/ARMTargetDefEmitter.cpp
+++ b/llvm/utils/TableGen/ARMTargetDefEmitter.cpp
@@ -45,7 +45,7 @@ static void EmitARMTargetDef(RecordKeeper &RK, raw_ostream &OS) {
     const auto MarchB = B->getValueAsString("MArchName");
     return MarchA.compare(MarchB) < 0; // A lexographically less than B
   };
-  std::sort(SortedExtensions.begin(), SortedExtensions.end(), Alphabetical);
+  llvm::sort(SortedExtensions, Alphabetical);
 
   // The ARMProcFamilyEnum values are initialised by SubtargetFeature defs
   // which set the ARMProcFamily field. We can generate the enum from these defs
diff --git a/llvm/utils/TableGen/ExegesisEmitter.cpp b/llvm/utils/TableGen/ExegesisEmitter.cpp
index d48c7f3a480f2..be2c43047f6c0 100644
--- a/llvm/utils/TableGen/ExegesisEmitter.cpp
+++ b/llvm/utils/TableGen/ExegesisEmitter.cpp
@@ -140,8 +140,7 @@ void ExegesisEmitter::emitPfmCountersInfo(const Record &Def,
            ValidationCounter->getValueAsDef("EventType")->getName(),
            getPfmCounterId(ValidationCounter->getValueAsString("Counter"))});
     }
-    std::sort(ValidationCounters.begin(), ValidationCounters.end(),
-              EventNumberLess);
+    llvm::sort(ValidationCounters, EventNumberLess);
     OS << "\nstatic const std::pair<ValidationEvent, const char*> " << Target
        << Def.getName() << "ValidationCounters[] = {\n";
     for (const ValidationCounterInfo &VCI : ValidationCounters) {

@kazutakahirata kazutakahirata merged commit 05d167f into llvm:main Jun 23, 2024
4 of 7 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_llvm_sort_llvm branch June 23, 2024 17:38
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 23, 2024

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-expensive-checks-debian running on gribozavr4 while building llvm at step 6 "test-build-unified-tree-check-all".

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

Here is the relevant piece of the build log for the reference:

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/AMDGPU/sched-group-barrier-pre-RA.mir' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llc -mtriple=amdgcn -mcpu=gfx908 -misched-cluster=false -run-pass=machine-scheduler -verify-misched -o - /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/AMDGPU/sched-group-barrier-pre-RA.mir | /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/FileCheck /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/AMDGPU/sched-group-barrier-pre-RA.mir
+ /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llc -mtriple=amdgcn -mcpu=gfx908 -misched-cluster=false -run-pass=machine-scheduler -verify-misched -o - /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/AMDGPU/sched-group-barrier-pre-RA.mir
+ /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/FileCheck /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/AMDGPU/sched-group-barrier-pre-RA.mir
RUN: at line 3: /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llc -mtriple=amdgcn -mcpu=gfx908 -misched-cluster=false -run-pass=machine-scheduler -amdgpu-igrouplp-exact-solver -verify-misched -o - /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/AMDGPU/sched-group-barrier-pre-RA.mir | /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/FileCheck -check-prefix=EXACT /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/AMDGPU/sched-group-barrier-pre-RA.mir
+ /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/FileCheck -check-prefix=EXACT /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/AMDGPU/sched-group-barrier-pre-RA.mir
+ /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llc -mtriple=amdgcn -mcpu=gfx908 -misched-cluster=false -run-pass=machine-scheduler -amdgpu-igrouplp-exact-solver -verify-misched -o - /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/AMDGPU/sched-group-barrier-pre-RA.mir
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/AMDGPU/sched-group-barrier-pre-RA.mir:201:16: error: EXACT-NEXT: is not on the line after the previous match
 ; EXACT-NEXT: [[DEF2:%[0-9]+]]:areg_128 = IMPLICIT_DEF
               ^
<stdin>:376:2: note: 'next' match was here
 %2:areg_128 = IMPLICIT_DEF
 ^
<stdin>:372:58: note: previous match ended here
 %4:vgpr_32 = nsw V_MUL_LO_U32_e64 %3, %3, implicit $exec
                                                         ^
<stdin>:373:1: note: non-matching line after previous match is here
 GLOBAL_STORE_DWORD_SADDR %1, %4, %0, 0, 0, implicit $exec :: (store (s32) into %ir.out, !noalias !0, addrspace 1)
^
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/AMDGPU/sched-group-barrier-pre-RA.mir:293:16: error: EXACT-NEXT: is not on the line after the previous match
 ; EXACT-NEXT: [[V_MUL_LO_U32_e64_1:%[0-9]+]]:vgpr_32 = nsw V_MUL_LO_U32_e64 [[GLOBAL_LOAD_DWORD_SADDR]], [[DEF1]], implicit $exec
               ^
<stdin>:503:2: note: 'next' match was here
 %5:vgpr_32 = nsw V_MUL_LO_U32_e64 %3, %1, implicit $exec
 ^
<stdin>:499:91: note: previous match ended here
 %8:areg_128 = V_MFMA_F32_4X4X1F32_e64 %1, %3, %7, 0, 0, 0, implicit $mode, implicit $exec
                                                                                          ^
<stdin>:500:1: note: non-matching line after previous match is here
 S_NOP 0
^

Input file: <stdin>
Check file: /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/AMDGPU/sched-group-barrier-pre-RA.mir

-dump-input=help explains the following input dump.

Input was:
<<<<<<
          .
          .
          .
        371:  %3:vgpr_32 = GLOBAL_LOAD_DWORD_SADDR %0, %1, 0, 0, implicit $exec :: (load (s32) from %ir.in, !alias.scope !0, addrspace 1) 
        372:  %4:vgpr_32 = nsw V_MUL_LO_U32_e64 %3, %3, implicit $exec 
        373:  GLOBAL_STORE_DWORD_SADDR %1, %4, %0, 0, 0, implicit $exec :: (store (s32) into %ir.out, !noalias !0, addrspace 1) 
        374:  S_NOP 0 
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 23, 2024

LLVM Buildbot has detected a new failure on builder sanitizer-ppc64le-linux running on ppc64le-sanitizer while building llvm at step 2 "annotate".

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

Here is the relevant piece of the build log for the reference:

Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
PASS: LeakSanitizer-Standalone-powerpc64le :: TestCases/use_globals_initialized.cpp (373 of 2450)
PASS: ThreadSanitizer-powerpc64le :: atomic_norace.cpp (374 of 2450)
PASS: Profile-powerpc64le :: Linux/coverage-weak-lld.cpp (375 of 2450)
XFAIL: SanitizerCommon-tsan-powerpc64le-Linux :: Linux/allow_user_segv.cpp (376 of 2450)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Linux/allow_user_segv.cpp (377 of 2450)
PASS: SanitizerCommon-msan-powerpc64le-Linux :: Linux/allow_user_segv.cpp (378 of 2450)
PASS: LeakSanitizer-Standalone-powerpc64le :: TestCases/thread_context_crash.cpp (379 of 2450)
PASS: ThreadSanitizer-powerpc64le :: atomic_norace2.cpp (380 of 2450)
PASS: MemorySanitizer-POWERPC64LE :: sigaction.cpp (381 of 2450)
PASS: SanitizerCommon-tsan-powerpc64le-Linux :: Linux/deepbind.cpp (382 of 2450)
FAIL: ThreadSanitizer-powerpc64le :: signal_block.cpp (383 of 2450)
******************** TEST 'ThreadSanitizer-powerpc64le :: signal_block.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_debug/./bin/clang  -fsanitize=thread -Wall  -m64 -fno-function-sections   -gline-tables-only -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/tsan/../ -O1 /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/tsan/signal_block.cpp -o /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_debug/runtimes/runtimes-bins/compiler-rt/test/tsan/POWERPC64LEConfig/Output/signal_block.cpp.tmp &&  /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_debug/runtimes/runtimes-bins/compiler-rt/test/tsan/POWERPC64LEConfig/Output/signal_block.cpp.tmp 2>&1 | FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/tsan/signal_block.cpp
+ /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_debug/./bin/clang -fsanitize=thread -Wall -m64 -fno-function-sections -gline-tables-only -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/tsan/../ -O1 /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/tsan/signal_block.cpp -o /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_debug/runtimes/runtimes-bins/compiler-rt/test/tsan/POWERPC64LEConfig/Output/signal_block.cpp.tmp
+ /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_debug/runtimes/runtimes-bins/compiler-rt/test/tsan/POWERPC64LEConfig/Output/signal_block.cpp.tmp
+ FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/tsan/signal_block.cpp
/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/tsan/signal_block.cpp:59:15: error: CHECK-NOT: excluded string found in input
// CHECK-NOT: WARNING: ThreadSanitizer:
              ^
<stdin>:2:1: note: found here
WARNING: ThreadSanitizer: signal handler spoils errno (pid=831498)
^~~~~~~~~~~~~~~~~~~~~~~~~

Input file: <stdin>
Check file: /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/tsan/signal_block.cpp

-dump-input=help explains the following input dump.

Input was:
<<<<<<
        1: ================== 
        2: WARNING: ThreadSanitizer: signal handler spoils errno (pid=831498) 
not:59     !~~~~~~~~~~~~~~~~~~~~~~~~                                           error: no match expected
        3:  Signal 10 handler invoked at: 
        4:  #0 handler(int) /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/tsan/signal_block.cpp:13 (signal_block.cpp.tmp+0xfe900) 
        5:  #1 thread(void*) /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/tsan/signal_block.cpp:25:5 (signal_block.cpp.tmp+0xfea50) 
        6:  
        7: SUMMARY: ThreadSanitizer: signal handler spoils errno /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/tsan/signal_block.cpp:13 in handler(int) 
        8: ================== 
        9: DONE 
       10: ThreadSanitizer: reported 1 warnings 
>>>>>>

--

Step 11 (test compiler-rt debug) failure: test compiler-rt debug (failure)
...
PASS: LeakSanitizer-Standalone-powerpc64le :: TestCases/use_globals_initialized.cpp (373 of 2450)
PASS: ThreadSanitizer-powerpc64le :: atomic_norace.cpp (374 of 2450)
PASS: Profile-powerpc64le :: Linux/coverage-weak-lld.cpp (375 of 2450)
XFAIL: SanitizerCommon-tsan-powerpc64le-Linux :: Linux/allow_user_segv.cpp (376 of 2450)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Linux/allow_user_segv.cpp (377 of 2450)
PASS: SanitizerCommon-msan-powerpc64le-Linux :: Linux/allow_user_segv.cpp (378 of 2450)
PASS: LeakSanitizer-Standalone-powerpc64le :: TestCases/thread_context_crash.cpp (379 of 2450)
PASS: ThreadSanitizer-powerpc64le :: atomic_norace2.cpp (380 of 2450)
PASS: MemorySanitizer-POWERPC64LE :: sigaction.cpp (381 of 2450)
PASS: SanitizerCommon-tsan-powerpc64le-Linux :: Linux/deepbind.cpp (382 of 2450)
FAIL: ThreadSanitizer-powerpc64le :: signal_block.cpp (383 of 2450)
******************** TEST 'ThreadSanitizer-powerpc64le :: signal_block.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_debug/./bin/clang  -fsanitize=thread -Wall  -m64 -fno-function-sections   -gline-tables-only -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/tsan/../ -O1 /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/tsan/signal_block.cpp -o /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_debug/runtimes/runtimes-bins/compiler-rt/test/tsan/POWERPC64LEConfig/Output/signal_block.cpp.tmp &&  /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_debug/runtimes/runtimes-bins/compiler-rt/test/tsan/POWERPC64LEConfig/Output/signal_block.cpp.tmp 2>&1 | FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/tsan/signal_block.cpp
+ /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_debug/./bin/clang -fsanitize=thread -Wall -m64 -fno-function-sections -gline-tables-only -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/tsan/../ -O1 /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/tsan/signal_block.cpp -o /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_debug/runtimes/runtimes-bins/compiler-rt/test/tsan/POWERPC64LEConfig/Output/signal_block.cpp.tmp
+ /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_debug/runtimes/runtimes-bins/compiler-rt/test/tsan/POWERPC64LEConfig/Output/signal_block.cpp.tmp
+ FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/tsan/signal_block.cpp
/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/tsan/signal_block.cpp:59:15: error: CHECK-NOT: excluded string found in input
// CHECK-NOT: WARNING: ThreadSanitizer:
              ^
<stdin>:2:1: note: found here
WARNING: ThreadSanitizer: signal handler spoils errno (pid=831498)
^~~~~~~~~~~~~~~~~~~~~~~~~

Input file: <stdin>
Check file: /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/tsan/signal_block.cpp

-dump-input=help explains the following input dump.

Input was:
<<<<<<
        1: ================== 
        2: WARNING: ThreadSanitizer: signal handler spoils errno (pid=831498) 
not:59     !~~~~~~~~~~~~~~~~~~~~~~~~                                           error: no match expected
        3:  Signal 10 handler invoked at: 
        4:  #0 handler(int) /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/tsan/signal_block.cpp:13 (signal_block.cpp.tmp+0xfe900) 
        5:  #1 thread(void*) /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/tsan/signal_block.cpp:25:5 (signal_block.cpp.tmp+0xfea50) 
        6:  
        7: SUMMARY: ThreadSanitizer: signal handler spoils errno /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/tsan/signal_block.cpp:13 in handler(int) 
        8: ================== 
        9: DONE 
       10: ThreadSanitizer: reported 1 warnings 
>>>>>>

--


@RKSimon
Copy link
Collaborator

RKSimon commented Jun 25, 2024

@kazutakahirata Please can you take a look at the test failures on EXPENSIVE_CHECKS builds?

https://lab.llvm.org/buildbot/#/builders/16/builds/500

@kazutakahirata
Copy link
Contributor Author

@kazutakahirata Please can you take a look at the test failures on EXPENSIVE_CHECKS builds?

https://lab.llvm.org/buildbot/#/builders/16/builds/500

Will do.

kazutakahirata added a commit that referenced this pull request Jun 25, 2024
This reverts commit 05d167f.

Reverting the patch fixes the following under EXPENSIVE_CHECKS:

  LLVM :: CodeGen/AMDGPU/sched-group-barrier-pipeline-solver.mir
  LLVM :: CodeGen/AMDGPU/sched-group-barrier-pre-RA.mir
  LLVM :: CodeGen/PowerPC/aix-xcoff-used-with-stringpool.ll
  LLVM :: CodeGen/PowerPC/merge-string-used-by-metadata.mir
  LLVM :: CodeGen/PowerPC/mergeable-string-pool-large.ll
  LLVM :: CodeGen/PowerPC/mergeable-string-pool-pass-only.mir
  LLVM :: CodeGen/PowerPC/mergeable-string-pool.ll
@kazutakahirata
Copy link
Contributor Author

@kazutakahirata Please can you take a look at the test failures on EXPENSIVE_CHECKS builds?
https://lab.llvm.org/buildbot/#/builders/16/builds/500

Will do.

I've reverted the whole thing as fef144c for simplicity even though the culprit is under those hunks under llvm/lib/Target.

AlexisPerry pushed a commit to llvm-project-tlp/llvm-project that referenced this pull request Jul 9, 2024
AlexisPerry pushed a commit to llvm-project-tlp/llvm-project that referenced this pull request Jul 9, 2024
This reverts commit 05d167f.

Reverting the patch fixes the following under EXPENSIVE_CHECKS:

  LLVM :: CodeGen/AMDGPU/sched-group-barrier-pipeline-solver.mir
  LLVM :: CodeGen/AMDGPU/sched-group-barrier-pre-RA.mir
  LLVM :: CodeGen/PowerPC/aix-xcoff-used-with-stringpool.ll
  LLVM :: CodeGen/PowerPC/merge-string-used-by-metadata.mir
  LLVM :: CodeGen/PowerPC/mergeable-string-pool-large.ll
  LLVM :: CodeGen/PowerPC/mergeable-string-pool-pass-only.mir
  LLVM :: CodeGen/PowerPC/mergeable-string-pool.ll
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.

5 participants