[llvm-branch-commits] [llvm] RuntimeLibcalls: Add definitions for vector math functions (PR #167026)

2025-11-11 Thread Paul Walker via llvm-branch-commits


@@ -182,10 +182,63 @@ foreach FPTy = ["F32", "F64", "F80", "F128", "PPCF128"] 
in {
   def MODF_#FPTy : RuntimeLibcall;
 }
 
-foreach VecTy = ["V4F32", "V2F64", "NXV4F32", "NXV2F64"] in {
-  def MODF_#VecTy : RuntimeLibcall;
-  def SINCOS_#VecTy : RuntimeLibcall;
-  def SINCOSPI_#VecTy : RuntimeLibcall;
+defvar F32VectorSuffixes = ["V2F32", "V4F32", "V8F32", "V16F32", "NXV4F32"];
+defvar F64VectorSuffixes = ["V2F64", "V4F64", "V8F64", "NXV2F64"];

paulwalker-arm wrote:

Sure, but properties like whether a vector function is masked are now in active 
use, and once this PR lands `hasVectorMaskArgument` becomes out of sync/broken. 
 Manually updating/verifying that function is fine when there's only a few 
entries and you just want to get the structure down. However, while the 
properties are separated like this I don't want to have to do it for all 
functions.

https://github.com/llvm/llvm-project/pull/167026
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [SpecialCaseList] Add backward compatible dot-slash handling (PR #162511)

2025-11-11 Thread Vitaly Buka via llvm-branch-commits

https://github.com/vitalybuka updated 
https://github.com/llvm/llvm-project/pull/162511

>From 8122ad974f18892e829843710958fbd4bac0926e Mon Sep 17 00:00:00 2001
From: Vitaly Buka 
Date: Wed, 8 Oct 2025 09:41:04 -0700
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20change?=
 =?UTF-8?q?s=20to=20main=20this=20commit=20is=20based=20on?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.6

[skip ci]
---
 llvm/include/llvm/Support/SpecialCaseList.h   |  1 +
 llvm/lib/Support/SpecialCaseList.cpp  |  9 +++
 .../unittests/Support/SpecialCaseListTest.cpp | 62 +++
 3 files changed, 60 insertions(+), 12 deletions(-)

diff --git a/llvm/include/llvm/Support/SpecialCaseList.h 
b/llvm/include/llvm/Support/SpecialCaseList.h
index 64cad804ad911..d8dd1c4ec4bbc 100644
--- a/llvm/include/llvm/Support/SpecialCaseList.h
+++ b/llvm/include/llvm/Support/SpecialCaseList.h
@@ -156,6 +156,7 @@ class SpecialCaseList {
 
 std::vector> Globs;
 std::vector> RegExes;
+bool RemoveDotSlash = false;
   };
 
   using SectionEntries = StringMap>;
diff --git a/llvm/lib/Support/SpecialCaseList.cpp 
b/llvm/lib/Support/SpecialCaseList.cpp
index 6ad8d7d4e7ffa..636dc5e651f56 100644
--- a/llvm/lib/Support/SpecialCaseList.cpp
+++ b/llvm/lib/Support/SpecialCaseList.cpp
@@ -22,6 +22,7 @@
 #include "llvm/Support/VirtualFileSystem.h"
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -72,6 +73,8 @@ Error SpecialCaseList::Matcher::insert(StringRef Pattern, 
unsigned LineNumber,
 void SpecialCaseList::Matcher::match(
 StringRef Query,
 llvm::function_ref Cb) const {
+  if (RemoveDotSlash)
+Query = llvm::sys::path::remove_leading_dotslash(Query);
   for (const auto &Glob : reverse(Globs))
 if (Glob->Pattern.match(Query))
   Cb(Glob->Name, Glob->LineNo);
@@ -164,12 +167,16 @@ bool SpecialCaseList::parse(unsigned FileIdx, const 
MemoryBuffer *MB,
   // 
https://discourse.llvm.org/t/use-glob-instead-of-regex-for-specialcaselists/71666
   bool UseGlobs = Version > 1;
 
+  bool RemoveDotSlash = Version > 2;
+
   Section *CurrentSection;
   if (auto Err = addSection("*", FileIdx, 1).moveInto(CurrentSection)) {
 Error = toString(std::move(Err));
 return false;
   }
 
+  constexpr StringRef PathPrefixes[] = {"src", "!src", "mainfile", "source"};
+
   for (line_iterator LineIt(*MB, /*SkipBlanks=*/true, /*CommentMarker=*/'#');
!LineIt.is_at_eof(); LineIt++) {
 unsigned LineNo = LineIt.line_number();
@@ -205,6 +212,8 @@ bool SpecialCaseList::parse(unsigned FileIdx, const 
MemoryBuffer *MB,
 
 auto [Pattern, Category] = Postfix.split("=");
 auto &Entry = CurrentSection->Entries[Prefix][Category];
+Entry.RemoveDotSlash =
+RemoveDotSlash && llvm::is_contained(PathPrefixes, Prefix);
 if (auto Err = Entry.insert(Pattern, LineNo, UseGlobs)) {
   Error =
   (Twine("malformed ") + (UseGlobs ? "glob" : "regex") + " in line " +
diff --git a/llvm/unittests/Support/SpecialCaseListTest.cpp 
b/llvm/unittests/Support/SpecialCaseListTest.cpp
index 5be2b9e3a7a5d..750fedaf0a436 100644
--- a/llvm/unittests/Support/SpecialCaseListTest.cpp
+++ b/llvm/unittests/Support/SpecialCaseListTest.cpp
@@ -22,33 +22,31 @@ namespace {
 
 class SpecialCaseListTest : public ::testing::Test {
 protected:
-  std::unique_ptr makeSpecialCaseList(StringRef List,
-   std::string &Error,
-   bool UseGlobs = true) {
+  std::unique_ptr
+  makeSpecialCaseList(StringRef List, std::string &Error, int Version = 0) {
 auto S = List.str();
-if (!UseGlobs)
-  S = (Twine("#!special-case-list-v1\n") + S).str();
+if (Version)
+  S = (Twine("#!special-case-list-v") + Twine(Version) + "\n" + S).str();
 std::unique_ptr MB = MemoryBuffer::getMemBuffer(S);
 return SpecialCaseList::create(MB.get(), Error);
   }
 
   std::unique_ptr makeSpecialCaseList(StringRef List,
-   bool UseGlobs = true) {
+   int Version = 0) {
 std::string Error;
-auto SCL = makeSpecialCaseList(List, Error, UseGlobs);
+auto SCL = makeSpecialCaseList(List, Error, Version);
 assert(SCL);
 assert(Error == "");
 return SCL;
   }
 
-  std::string makeSpecialCaseListFile(StringRef Contents,
-  bool UseGlobs = true) {
+  std::string makeSpecialCaseListFile(StringRef Contents, int Version = 0) {
 int FD;
 SmallString<64> Path;
 sys::fs::createTemporaryFile("SpecialCaseListTest", "temp", FD, Path);
 raw_fd_ostream OF(FD, true, true);
-if (!UseGlobs)
-  OF << "#!special-case-list-v1\n";
+if (Version)
+  OF << "#!special-case-list-v" << Version << "\n";
 OF << Contents;
 OF.close();
 return std::string(Path.str());
@@ -26

[llvm-branch-commits] [clang] [llvm] [clang] Switch warning suppression multi-match rule to "last match takes precedence" (PR #162237)

2025-11-11 Thread Hans Wennborg via llvm-branch-commits

https://github.com/zmodem approved this pull request.

This makes sense to me. LGTM

https://github.com/llvm/llvm-project/pull/162237
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [LoopVectorize] Support vectorization of compressing patterns in VPlan (PR #140723)

2025-11-11 Thread Sergey Kachkov via llvm-branch-commits

https://github.com/skachkov-sc edited 
https://github.com/llvm/llvm-project/pull/140723
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [LoopVectorize] Support vectorization of compressing patterns in VPlan (PR #140723)

2025-11-11 Thread Luke Lau via llvm-branch-commits


@@ -8430,6 +8479,46 @@ VPlanPtr 
LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(
   // bring the VPlan to its final state.
   // 
---
 
+  // Adjust the recipes for any monotonic phis.
+  for (VPRecipeBase &R : HeaderVPBB->phis()) {
+auto *MonotonicPhi = dyn_cast(&R);

lukel97 wrote:

If you use a regular VPInstruction::PHI instead of VPMonotonicPHIRecipe and set 
the underlying value to the monotonic phi, could you avoid the need for an 
extra recipe?

Would you be able to detect the monotonic phis by just calling 
`Legal->getMonotonicPHIs().find(Phi->getUnderlyingValue())`?

https://github.com/llvm/llvm-project/pull/140723
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lldb] release/21.x: [debugserver] Fix debugserver build on < macOS 10.15 (#166599) (PR #166614)

2025-11-11 Thread via llvm-branch-commits

https://github.com/dyung closed https://github.com/llvm/llvm-project/pull/166614
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [flang][OpenMP] Semantic checks for DYN_GROUPPRIVATE (PR #166214)

2025-11-11 Thread Krzysztof Parzyszek via llvm-branch-commits

https://github.com/kparzysz updated 
https://github.com/llvm/llvm-project/pull/166214

>From ebe00ba9ee15119b2ce127971ab4e038ddf62308 Mon Sep 17 00:00:00 2001
From: Krzysztof Parzyszek 
Date: Thu, 14 Aug 2025 13:26:23 -0500
Subject: [PATCH] [flang][OpenMP] Semantic checks for DYN_GROUPPRIVATE

---
 .../flang/Semantics/openmp-modifiers.h|  2 ++
 flang/lib/Semantics/check-omp-structure.cpp   | 34 ++-
 flang/lib/Semantics/openmp-modifiers.cpp  | 32 +
 .../Semantics/OpenMP/dyn-groupprivate.f90 |  8 +
 4 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 flang/test/Semantics/OpenMP/dyn-groupprivate.f90

diff --git a/flang/include/flang/Semantics/openmp-modifiers.h 
b/flang/include/flang/Semantics/openmp-modifiers.h
index bfa3aa4939cb1..283bf2a4c895e 100644
--- a/flang/include/flang/Semantics/openmp-modifiers.h
+++ b/flang/include/flang/Semantics/openmp-modifiers.h
@@ -67,6 +67,7 @@ template  const OmpModifierDescriptor 
&OmpGetDescriptor();
 #define DECLARE_DESCRIPTOR(name) \
   template <> const OmpModifierDescriptor &OmpGetDescriptor()
 
+DECLARE_DESCRIPTOR(parser::OmpAccessGroup);
 DECLARE_DESCRIPTOR(parser::OmpAlignment);
 DECLARE_DESCRIPTOR(parser::OmpAlignModifier);
 DECLARE_DESCRIPTOR(parser::OmpAllocatorComplexModifier);
@@ -82,6 +83,7 @@ DECLARE_DESCRIPTOR(parser::OmpDependenceType);
 DECLARE_DESCRIPTOR(parser::OmpDeviceModifier);
 DECLARE_DESCRIPTOR(parser::OmpDirectiveNameModifier);
 DECLARE_DESCRIPTOR(parser::OmpExpectation);
+DECLARE_DESCRIPTOR(parser::OmpFallbackModifier);
 DECLARE_DESCRIPTOR(parser::OmpInteropPreference);
 DECLARE_DESCRIPTOR(parser::OmpInteropType);
 DECLARE_DESCRIPTOR(parser::OmpIterator);
diff --git a/flang/lib/Semantics/check-omp-structure.cpp 
b/flang/lib/Semantics/check-omp-structure.cpp
index d7db15dd37949..4c46aba7391d6 100644
--- a/flang/lib/Semantics/check-omp-structure.cpp
+++ b/flang/lib/Semantics/check-omp-structure.cpp
@@ -682,6 +682,13 @@ void OmpStructureChecker::Enter(const 
parser::OmpClause::Hint &x) {
   }
 }
 
+void OmpStructureChecker::Enter(const parser::OmpClause::DynGroupprivate &x) {
+  CheckAllowedClause(llvm::omp::Clause::OMPC_dyn_groupprivate);
+  parser::CharBlock source{GetContext().clauseSource};
+
+  OmpVerifyModifiers(x.v, llvm::omp::OMPC_dyn_groupprivate, source, context_);
+}
+
 void OmpStructureChecker::Enter(const parser::OmpDirectiveSpecification &x) {
   // OmpDirectiveSpecification exists on its own only in METADIRECTIVE.
   // In other cases it's a part of other constructs that handle directive
@@ -3316,6 +3323,32 @@ void OmpStructureChecker::Leave(const 
parser::OmpClauseList &) {
 }
   }
 
+  // Default access-group for DYN_GROUPPRIVATE is "cgroup". On a given
+  // construct there can be at most one DYN_GROUPPRIVATE with a given
+  // access-group.
+  const parser::OmpClause
+  *accGrpClause[parser::OmpAccessGroup::Value_enumSize] = {nullptr};
+  for (auto [_, clause] :
+  FindClauses(llvm::omp::Clause::OMPC_dyn_groupprivate)) {
+auto &wrapper{std::get(clause->u)};
+auto &modifiers{OmpGetModifiers(wrapper.v)};
+auto accGrp{parser::OmpAccessGroup::Value::Cgroup};
+if (auto *ag{OmpGetUniqueModifier(modifiers)}) {
+  accGrp = ag->v;
+}
+auto &firstClause{accGrpClause[llvm::to_underlying(accGrp)]};
+if (firstClause) {
+  context_
+  .Say(clause->source,
+  "The access-group modifier can only occur on a single clause in 
a construct"_err_en_US)
+  .Attach(firstClause->source,
+  "Previous clause with access-group modifier"_en_US);
+  break;
+} else {
+  firstClause = clause;
+}
+  }
+
   CheckRequireAtLeastOneOf();
 }
 
@@ -5472,7 +5505,6 @@ CHECK_SIMPLE_CLAUSE(Default, OMPC_default)
 CHECK_SIMPLE_CLAUSE(Depobj, OMPC_depobj)
 CHECK_SIMPLE_CLAUSE(DeviceType, OMPC_device_type)
 CHECK_SIMPLE_CLAUSE(DistSchedule, OMPC_dist_schedule)
-CHECK_SIMPLE_CLAUSE(DynGroupprivate, OMPC_dyn_groupprivate)
 CHECK_SIMPLE_CLAUSE(Exclusive, OMPC_exclusive)
 CHECK_SIMPLE_CLAUSE(Fail, OMPC_fail)
 CHECK_SIMPLE_CLAUSE(Filter, OMPC_filter)
diff --git a/flang/lib/Semantics/openmp-modifiers.cpp 
b/flang/lib/Semantics/openmp-modifiers.cpp
index 717fb0351ba5b..f191b4de2d579 100644
--- a/flang/lib/Semantics/openmp-modifiers.cpp
+++ b/flang/lib/Semantics/openmp-modifiers.cpp
@@ -74,6 +74,22 @@ unsigned OmpModifierDescriptor::since(llvm::omp::Clause id) 
const {
 // Note: The intent for these functions is to have them be automatically-
 // generated in the future.
 
+template <>
+const OmpModifierDescriptor &OmpGetDescriptor() {
+  static const OmpModifierDescriptor desc{
+  /*name=*/"access-group",
+  /*props=*/
+  {
+  {61, {OmpProperty::Unique}},
+  },
+  /*clauses=*/
+  {
+  {61, {Clause::OMPC_dyn_groupprivate}},
+  },
+  };
+  return desc;
+}
+
 template <>
 const OmpModifierDescriptor &OmpGetDescriptor() {
   static const OmpModifierDescriptor desc{
@@ -3

[llvm-branch-commits] [llvm] [LoopVectorize] Support vectorization of compressing patterns in VPlan (PR #140723)

2025-11-11 Thread Sergey Kachkov via llvm-branch-commits

https://github.com/skachkov-sc edited 
https://github.com/llvm/llvm-project/pull/140723
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] RuntimeLibcalls: Add __memcpy_chk, __memmove_chk, __memset_chk (PR #167053)

2025-11-11 Thread Simon Pilgrim via llvm-branch-commits

https://github.com/RKSimon approved this pull request.

LGTM

https://github.com/llvm/llvm-project/pull/167053
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [LoopVectorize] Support vectorization of compressing patterns in VPlan (PR #140723)

2025-11-11 Thread Sergey Kachkov via llvm-branch-commits


@@ -8430,6 +8479,46 @@ VPlanPtr 
LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(
   // bring the VPlan to its final state.
   // 
---
 
+  // Adjust the recipes for any monotonic phis.
+  for (VPRecipeBase &R : HeaderVPBB->phis()) {
+auto *MonotonicPhi = dyn_cast(&R);

skachkov-sc wrote:

Do you mean VPIRPhi recipe? I think it's possible, but I'm slightly concerned 
that semantically  VPMonotonicPHIRecipe models loop header phi so it should be 
derived from VPHeaderPHIRecipe. But yes, we can distinguish monotonic phis 
using LoopVectorizationLegality

https://github.com/llvm/llvm-project/pull/140723
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lldb] 4b2ac3f - [debugserver] Fix debugserver build on < macOS 10.15 (#166599)

2025-11-11 Thread via llvm-branch-commits

Author: Jonas Devlieghere
Date: 2025-11-05T18:50:24Z
New Revision: 4b2ac3f7a210c1c8de5e8ee4c5f47104a3859ed7

URL: 
https://github.com/llvm/llvm-project/commit/4b2ac3f7a210c1c8de5e8ee4c5f47104a3859ed7
DIFF: 
https://github.com/llvm/llvm-project/commit/4b2ac3f7a210c1c8de5e8ee4c5f47104a3859ed7.diff

LOG: [debugserver] Fix debugserver build on < macOS 10.15 (#166599)

The VM_MEMORY_SANITIZER constant was added in macOs 10.15 and friends.
Support using the constant on older OSes.

Fixes #156144

(cherry picked from commit bc55f4f4f2b4ef196cf3ec25f69dfbd9cd032237)

Added: 


Modified: 
lldb/tools/debugserver/source/MacOSX/MachVMRegion.cpp

Removed: 




diff  --git a/lldb/tools/debugserver/source/MacOSX/MachVMRegion.cpp 
b/lldb/tools/debugserver/source/MacOSX/MachVMRegion.cpp
index 97908b4acaf28..18d254e76b917 100644
--- a/lldb/tools/debugserver/source/MacOSX/MachVMRegion.cpp
+++ b/lldb/tools/debugserver/source/MacOSX/MachVMRegion.cpp
@@ -14,6 +14,12 @@
 #include "DNBLog.h"
 #include 
 #include 
+#include 
+
+// From , but not on older OSs.
+#ifndef VM_MEMORY_SANITIZER
+#define VM_MEMORY_SANITIZER 99
+#endif
 
 MachVMRegion::MachVMRegion(task_t task)
 : m_task(task), m_addr(INVALID_NUB_ADDRESS), m_err(),



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [SpecialCaseList] Add backward compatible dot-slash handling (PR #162511)

2025-11-11 Thread Vitaly Buka via llvm-branch-commits

https://github.com/vitalybuka updated 
https://github.com/llvm/llvm-project/pull/162511

>From 8122ad974f18892e829843710958fbd4bac0926e Mon Sep 17 00:00:00 2001
From: Vitaly Buka 
Date: Wed, 8 Oct 2025 09:41:04 -0700
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20change?=
 =?UTF-8?q?s=20to=20main=20this=20commit=20is=20based=20on?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.6

[skip ci]
---
 llvm/include/llvm/Support/SpecialCaseList.h   |  1 +
 llvm/lib/Support/SpecialCaseList.cpp  |  9 +++
 .../unittests/Support/SpecialCaseListTest.cpp | 62 +++
 3 files changed, 60 insertions(+), 12 deletions(-)

diff --git a/llvm/include/llvm/Support/SpecialCaseList.h 
b/llvm/include/llvm/Support/SpecialCaseList.h
index 64cad804ad911..d8dd1c4ec4bbc 100644
--- a/llvm/include/llvm/Support/SpecialCaseList.h
+++ b/llvm/include/llvm/Support/SpecialCaseList.h
@@ -156,6 +156,7 @@ class SpecialCaseList {
 
 std::vector> Globs;
 std::vector> RegExes;
+bool RemoveDotSlash = false;
   };
 
   using SectionEntries = StringMap>;
diff --git a/llvm/lib/Support/SpecialCaseList.cpp 
b/llvm/lib/Support/SpecialCaseList.cpp
index 6ad8d7d4e7ffa..636dc5e651f56 100644
--- a/llvm/lib/Support/SpecialCaseList.cpp
+++ b/llvm/lib/Support/SpecialCaseList.cpp
@@ -22,6 +22,7 @@
 #include "llvm/Support/VirtualFileSystem.h"
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -72,6 +73,8 @@ Error SpecialCaseList::Matcher::insert(StringRef Pattern, 
unsigned LineNumber,
 void SpecialCaseList::Matcher::match(
 StringRef Query,
 llvm::function_ref Cb) const {
+  if (RemoveDotSlash)
+Query = llvm::sys::path::remove_leading_dotslash(Query);
   for (const auto &Glob : reverse(Globs))
 if (Glob->Pattern.match(Query))
   Cb(Glob->Name, Glob->LineNo);
@@ -164,12 +167,16 @@ bool SpecialCaseList::parse(unsigned FileIdx, const 
MemoryBuffer *MB,
   // 
https://discourse.llvm.org/t/use-glob-instead-of-regex-for-specialcaselists/71666
   bool UseGlobs = Version > 1;
 
+  bool RemoveDotSlash = Version > 2;
+
   Section *CurrentSection;
   if (auto Err = addSection("*", FileIdx, 1).moveInto(CurrentSection)) {
 Error = toString(std::move(Err));
 return false;
   }
 
+  constexpr StringRef PathPrefixes[] = {"src", "!src", "mainfile", "source"};
+
   for (line_iterator LineIt(*MB, /*SkipBlanks=*/true, /*CommentMarker=*/'#');
!LineIt.is_at_eof(); LineIt++) {
 unsigned LineNo = LineIt.line_number();
@@ -205,6 +212,8 @@ bool SpecialCaseList::parse(unsigned FileIdx, const 
MemoryBuffer *MB,
 
 auto [Pattern, Category] = Postfix.split("=");
 auto &Entry = CurrentSection->Entries[Prefix][Category];
+Entry.RemoveDotSlash =
+RemoveDotSlash && llvm::is_contained(PathPrefixes, Prefix);
 if (auto Err = Entry.insert(Pattern, LineNo, UseGlobs)) {
   Error =
   (Twine("malformed ") + (UseGlobs ? "glob" : "regex") + " in line " +
diff --git a/llvm/unittests/Support/SpecialCaseListTest.cpp 
b/llvm/unittests/Support/SpecialCaseListTest.cpp
index 5be2b9e3a7a5d..750fedaf0a436 100644
--- a/llvm/unittests/Support/SpecialCaseListTest.cpp
+++ b/llvm/unittests/Support/SpecialCaseListTest.cpp
@@ -22,33 +22,31 @@ namespace {
 
 class SpecialCaseListTest : public ::testing::Test {
 protected:
-  std::unique_ptr makeSpecialCaseList(StringRef List,
-   std::string &Error,
-   bool UseGlobs = true) {
+  std::unique_ptr
+  makeSpecialCaseList(StringRef List, std::string &Error, int Version = 0) {
 auto S = List.str();
-if (!UseGlobs)
-  S = (Twine("#!special-case-list-v1\n") + S).str();
+if (Version)
+  S = (Twine("#!special-case-list-v") + Twine(Version) + "\n" + S).str();
 std::unique_ptr MB = MemoryBuffer::getMemBuffer(S);
 return SpecialCaseList::create(MB.get(), Error);
   }
 
   std::unique_ptr makeSpecialCaseList(StringRef List,
-   bool UseGlobs = true) {
+   int Version = 0) {
 std::string Error;
-auto SCL = makeSpecialCaseList(List, Error, UseGlobs);
+auto SCL = makeSpecialCaseList(List, Error, Version);
 assert(SCL);
 assert(Error == "");
 return SCL;
   }
 
-  std::string makeSpecialCaseListFile(StringRef Contents,
-  bool UseGlobs = true) {
+  std::string makeSpecialCaseListFile(StringRef Contents, int Version = 0) {
 int FD;
 SmallString<64> Path;
 sys::fs::createTemporaryFile("SpecialCaseListTest", "temp", FD, Path);
 raw_fd_ostream OF(FD, true, true);
-if (!UseGlobs)
-  OF << "#!special-case-list-v1\n";
+if (Version)
+  OF << "#!special-case-list-v" << Version << "\n";
 OF << Contents;
 OF.close();
 return std::string(Path.str());
@@ -26

[llvm-branch-commits] [llvm] [GOFF] Write out relocations in the GOFF writer (PR #167054)

2025-11-11 Thread Ulrich Weigand via llvm-branch-commits


@@ -502,6 +535,169 @@ void GOFFWriter::writeText(const MCSectionGOFF *Section) {
   Asm.writeSectionData(S, Section);
 }
 
+namespace {
+// RelocDataItemBuffer provides a static buffer for relocation data items.
+class RelocDataItemBuffer {
+  char Buffer[GOFF::MaxDataLength];
+  char *Ptr;
+
+public:
+  RelocDataItemBuffer() : Ptr(Buffer) {}
+  const char *data() { return Buffer; }
+  size_t size() { return Ptr - Buffer; }
+  void reset() { Ptr = Buffer; }
+  bool fits(size_t S) { return size() + S < GOFF::MaxDataLength; }
+  template  void writebe(T Val) {
+assert(fits(sizeof(T)) && "Out-of-bounds write");
+support::endian::write(Ptr, Val);
+Ptr += sizeof(T);
+  }
+};
+} // namespace
+
+void GOFFWriter::writeRelocations() {
+  // Transform a GOFFSavedRelocationEntry to 1 or 2 GOFFRelocationEntry
+  // instances. An expression like SymA - SymB + Const is implemented by 
storing
+  // Const in the memory (aka the FixedValue), and then having a relocation to
+  // add SymA, and another relocation to subtract SymB.
+  std::vector Relocations;

uweigand wrote:

It is a bit unfortunate that we have *two* temporary relocation buffers; the 
GOFFSavedRelocationEntry vector in the caller and this GOFFRelocationEntry 
here.  Would there be a way to avoid this second copy?  E.g. the caller should 
already be able to make the decision to create two entries, right?  We'd just 
have to keep MCSymbolGOFF pointers instead of EsdIds, but those could be 
dereferenced on the fly here, no?

https://github.com/llvm/llvm-project/pull/167054
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [AMDGPU] Enable amdgpu-lower-exec-sync pass in pipeline (PR #165746)

2025-11-11 Thread Sameer Sahasrabuddhe via llvm-branch-commits


@@ -465,6 +465,11 @@ static cl::opt EnableScalarIRPasses(
   cl::init(true),
   cl::Hidden);
 
+static cl::opt
+EnableLowerExecSync("amdgpu-enable-lower-exec-sync",
+cl::desc("Enable lowering of exec sync pass."),

ssahasra wrote:

```suggestion
cl::desc("Enable lowering of synchronization 
primitives."),
```
The word "pass" rarely conveys any information in this kind of place.


https://github.com/llvm/llvm-project/pull/165746
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lldb] release/21.x: [debugserver] Fix debugserver build on < macOS 10.15 (#166599) (PR #166614)

2025-11-11 Thread via llvm-branch-commits

github-actions[bot] wrote:

@JDevlieghere (or anyone else). If you would like to add a note about this fix 
in the release notes (completely optional). Please reply to this comment with a 
one or two sentence description of the fix.  When you are done, please add the 
release:note label to this PR. 

https://github.com/llvm/llvm-project/pull/166614
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] RuntimeLibcalls: Add libcall entries for sleef and armpl modf functions (PR #166985)

2025-11-11 Thread Paul Walker via llvm-branch-commits


@@ -197,6 +201,55 @@ RuntimeLibcallsInfo::getFunctionTy(LLVMContext &Ctx, const 
Triple &TT,
   fcNegNormal));
 return {FuncTy, Attrs};
   }
+  case RTLIB::impl__ZGVnN2vl8_modf:
+  case RTLIB::impl__ZGVnN4vl4_modff:
+  case RTLIB::impl__ZGVsNxvl8_modf:
+  case RTLIB::impl__ZGVsNxvl4_modff:
+  case RTLIB::impl_armpl_vmodfq_f64:
+  case RTLIB::impl_armpl_vmodfq_f32:
+  case RTLIB::impl_armpl_svmodf_f64_x:
+  case RTLIB::impl_armpl_svmodf_f32_x: {
+AttrBuilder FuncAttrBuilder(Ctx);
+
+bool IsF32 = LibcallImpl == RTLIB::impl__ZGVnN4vl4_modff ||
+ LibcallImpl == RTLIB::impl__ZGVsNxvl4_modff ||
+ LibcallImpl == RTLIB::impl_armpl_vmodfq_f32 ||
+ LibcallImpl == RTLIB::impl_armpl_svmodf_f32_x;
+
+bool IsScalable = LibcallImpl == RTLIB::impl__ZGVsNxvl8_modf ||
+  LibcallImpl == RTLIB::impl__ZGVsNxvl4_modff ||
+  LibcallImpl == RTLIB::impl_armpl_svmodf_f64_x ||
+  LibcallImpl == RTLIB::impl_armpl_svmodf_f32_x;
+
+Type *ScalarTy = IsF32 ? Type::getFloatTy(Ctx) : Type::getDoubleTy(Ctx);
+unsigned EC = IsF32 ? 4 : 2;
+
+Type *VecTy =
+IsScalable ? static_cast(ScalableVectorType::get(ScalarTy, EC))
+   : static_cast(FixedVectorType::get(ScalarTy, EC));

paulwalker-arm wrote:

```suggestion
VectorType *VecTy = VectorType::get(ScalarTy, EC, IsScalable);
```

https://github.com/llvm/llvm-project/pull/166985
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [GOFF] Write out relocations in the GOFF writer (PR #167054)

2025-11-11 Thread Ulrich Weigand via llvm-branch-commits


@@ -16,12 +17,35 @@ namespace {
 class SystemZGOFFObjectWriter : public MCGOFFObjectTargetWriter {
 public:
   SystemZGOFFObjectWriter();
+
+  unsigned getRelocType(const MCValue &Target, const MCFixup &Fixup,
+bool IsPCRel) const override;
 };
 } // end anonymous namespace
 
 SystemZGOFFObjectWriter::SystemZGOFFObjectWriter()
 : MCGOFFObjectTargetWriter() {}
 
+unsigned SystemZGOFFObjectWriter::getRelocType(const MCValue &Target,
+   const MCFixup &Fixup,
+   bool IsPCRel) const {
+  switch (Target.getSpecifier()) {
+  case SystemZ::S_PLT:  // TODO This doen't make sense.

uweigand wrote:

We should fix this where it is emitted instead.  We shouldn't generate the 
`S_PLT` specifier for XPLink at all.

https://github.com/llvm/llvm-project/pull/167054
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [GOFF] Write out relocations in the GOFF writer (PR #167054)

2025-11-11 Thread Ulrich Weigand via llvm-branch-commits


@@ -51,6 +51,7 @@ enum {
   // https://www.ibm.com/docs/en/hla-and-tf/1.6?topic=value-address-constants
   S_RCon, // Address of ADA of symbol.
   S_VCon, // Address of external function symbol.
+  S_QCon, // Class-based offset.

uweigand wrote:

I guess nobody is emitting this yet?  Would be good to have an exploiter for 
test purposes at least ...

https://github.com/llvm/llvm-project/pull/167054
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] RuntimeLibcalls: Add malloc and free entries (PR #167081)

2025-11-11 Thread Simon Pilgrim via llvm-branch-commits


@@ -129,13 +129,23 @@ bool RuntimeLibcallsInfo::darwinHasExp10(const Triple 
&TT) {
   }
 }
 
+/// TODO: There is really no guarantee that sizeof(size_t) is equal to the 
index
+/// size of the edfault address space. This matches TargetLibraryInfo and 
should

RKSimon wrote:

default

https://github.com/llvm/llvm-project/pull/167081
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [GOFF] Write out relocations in the GOFF writer (PR #167054)

2025-11-11 Thread Ulrich Weigand via llvm-branch-commits


@@ -545,8 +743,68 @@ GOFFObjectWriter::GOFFObjectWriter(
 
 GOFFObjectWriter::~GOFFObjectWriter() = default;
 
+void GOFFObjectWriter::recordRelocation(const MCFragment &F,
+const MCFixup &Fixup, MCValue Target,
+uint64_t &FixedValue) {
+  const MCFixupKindInfo &FKI =
+  Asm->getBackend().getFixupKindInfo(Fixup.getKind());
+  const uint32_t Length = FKI.TargetSize / 8;
+  assert(FKI.TargetSize % 8 == 0 && "Target Size not multiple of 8");
+  const uint64_t FixupOffset = Asm->getFragmentOffset(F) + Fixup.getOffset();
+  bool IsPCRel = Fixup.isPCRel();
+
+  unsigned RelocType = TargetObjectWriter->getRelocType(Target, Fixup, 
IsPCRel);
+
+  const MCSectionGOFF *PSection = static_cast(F.getParent());
+  const auto &A = *static_cast(Target.getAddSym());
+  const MCSymbolGOFF *B = static_cast(Target.getSubSym());
+  if (RelocType == MCGOFFObjectTargetWriter::Reloc_Type_RelImm) {
+if (A.isUndefined()) {
+  Asm->reportError(
+  Fixup.getLoc(),
+  Twine("symbol ")
+  .concat(A.getName())
+  .concat(" must be defined for a relative immediate relocation"));
+  return;
+}
+if (&A.getSection() != PSection) {
+  Asm->reportError(Fixup.getLoc(),
+   Twine("relative immediate relocation section mismatch: 
")
+   .concat(A.getSection().getName())
+   .concat(" of symbol ")
+   .concat(A.getName())
+   .concat(" <-> ")
+   .concat(PSection->getName()));
+  return;
+}
+if (B) {
+  Asm->reportError(
+  Fixup.getLoc(),
+  Twine("subtractive symbol ")
+  .concat(B->getName())
+  .concat(" not supported for a relative immediate relocation"));
+  return;
+}
+FixedValue = Asm->getSymbolOffset(A) - FixupOffset + Target.getConstant();
+return;
+  }
+  FixedValue = Target.getConstant();
+
+  // The symbol only has a section-relative offset if it is a temporary symbol.
+  FixedValue += A.isTemporary() ? Asm->getSymbolOffset(A) : 0;
+  A.setUsedInReloc();
+  if (B) {
+FixedValue -= B->isTemporary() ? Asm->getSymbolOffset(*B) : 0;
+B->setUsedInReloc();
+  }
+
+  // Save relocation data for later writing.
+  SavedRelocs.emplace_back(PSection, &A, B, RelocType, FixupOffset, Length,
+   FixedValue);
+}
+
 uint64_t GOFFObjectWriter::writeObject() {
-  uint64_t Size = GOFFWriter(OS, *Asm).writeObject();
+  uint64_t Size = GOFFWriter(OS, *Asm, SavedRelocs).writeObject();

uweigand wrote:

Precedent e.g. from ELF would be to pass a reference to the whole 
`GOFFObjectWriter` to the `GOFFWriter` rather than just a single field.  Not 
sure which is really better here ...

https://github.com/llvm/llvm-project/pull/167054
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [GOFF] Write out relocations in the GOFF writer (PR #167054)

2025-11-11 Thread Ulrich Weigand via llvm-branch-commits


@@ -16,12 +17,35 @@ namespace {
 class SystemZGOFFObjectWriter : public MCGOFFObjectTargetWriter {
 public:
   SystemZGOFFObjectWriter();
+
+  unsigned getRelocType(const MCValue &Target, const MCFixup &Fixup,
+bool IsPCRel) const override;
 };
 } // end anonymous namespace
 
 SystemZGOFFObjectWriter::SystemZGOFFObjectWriter()
 : MCGOFFObjectTargetWriter() {}
 
+unsigned SystemZGOFFObjectWriter::getRelocType(const MCValue &Target,
+   const MCFixup &Fixup,

uweigand wrote:

Or rather, don't pass `IsPCRel`, but get that information from `Fixup`?

https://github.com/llvm/llvm-project/pull/167054
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [SpecialCaseList] Switch to Version 3. (PR #167283)

2025-11-11 Thread Vitaly Buka via llvm-branch-commits

https://github.com/vitalybuka updated 
https://github.com/llvm/llvm-project/pull/167283


___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] release/21.x: [LoongArch] Add `isSafeToMove` hook to prevent unsafe instruction motion (#163725) (PR #166936)

2025-11-11 Thread via llvm-branch-commits

dyung wrote:

Hi @heiher, we are currently only accepting potential patches for the 21.x 
release branch that fix regressions from a prior release or are major bugs. 
This does not seem to be either to me, but can you help me to understand 
whether this meets either for possible inclusion?

https://github.com/llvm/llvm-project/pull/166936
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [LoopVectorize] Support vectorization of compressing patterns in VPlan (PR #140723)

2025-11-11 Thread Luke Lau via llvm-branch-commits


@@ -8430,6 +8479,46 @@ VPlanPtr 
LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(
   // bring the VPlan to its final state.
   // 
---
 
+  // Adjust the recipes for any monotonic phis.
+  for (VPRecipeBase &R : HeaderVPBB->phis()) {
+auto *MonotonicPhi = dyn_cast(&R);

lukel97 wrote:

I was thinking VPPhi which is any VPInstruction with an opcode of 
Instruction::Phi, which you can create from VPBuilder::createScalarPhi. It 
should let you model everything in VPlan without needing to create a dedicate 
recipe.

I wouldn't worry about trying to derive from VPHeaderPHIRecipe, we use VPPhi 
for the EVL tail folding stuff even though it's placed in the header. Other 
transforms know how to handle VPPhi recipes if that's what your'e wondering.

https://github.com/llvm/llvm-project/pull/140723
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits