[llvm-branch-commits] [llvm] [BOLT][PAC] Warn about synchronous unwind tables (PR #165227)

2025-10-27 Thread Gergely Bálint via llvm-branch-commits

bgergely0 wrote:

Looks like the code formatting bot is broken, but the patch is formatted 
locally.

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


[llvm-branch-commits] [clang] [llvm] [AArch64][llvm] Relax mandatory features for Armv9.6-A (PR #164950)

2025-10-27 Thread Jonathan Thackray via llvm-branch-commits

jthackray wrote:

> had to manually cherry pick as the merge script expects the PR to come from a 
> branch on a fork and not a branch on the LLVM repo. Commit is 
> [04102d9](https://github.com/llvm/llvm-project/commit/04102d998d0e4019c26654cf0b545a0af19819c7).

Thanks @c-rhodes - apologies, I'll know for next time (this is the first time 
I've back-ported a commit)

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


[llvm-branch-commits] [clang] [llvm] [AArch64][llvm] Relax mandatory features for Armv9.6-A (PR #164950)

2025-10-27 Thread Cullen Rhodes via llvm-branch-commits

c-rhodes wrote:

had to manually cherry pick as the merge script expects the PR to come from a 
branch on a fork and not a branch on the LLVM repo. Commit is 
04102d998d0e4019c26654cf0b545a0af19819c7.

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


[llvm-branch-commits] [clang] [llvm] [OpenMP] Add codegen support for dyn_groupprivate clause (PR #152830)

2025-10-27 Thread via llvm-branch-commits

skc7 wrote:

Hi @kevinsala 

emitTargetCall in ompIRBuilder.cpp is populating the TargetKernelArgs, which 
contain your newly added DynCGroupMemFallback and DynCGGroupMem. These could be 
given as input arguments to emitTargetCall. 

OpenMPIRBuilder::createTarget inturn calls emitTargetCall. So, would be better 
to add DynCGroupMemFallback and DynCGGroupMem to createTarget. 

OpenMPToLLVMIRTranslation uses OpenMPIRBuilder::createTarget which can be used 
by #153562 for populating the dynGroup size and fallback modifiers from the 
omp.dyn_groupprivate mlir clause.



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


[llvm-branch-commits] [RFC][Clang] Allow plugins to hook into back-end (PR #165257)

2025-10-27 Thread Alexis Engelke via llvm-branch-commits

https://github.com/aengelke created 
https://github.com/llvm/llvm-project/pull/165257

Add a mechanism to permit plugins running code between optimizations and
the back-end passes.

The primary motivation for this point is TPDE-LLVM, which substitutes
the LLVM back-end (optionally falling back to it for unsupported IR). We
have been distributing a Clang patch; but requiring a custom-build
toolchain is impracticable for many users.

---

I'm not sure whether this is the best way to achieve the goal. Front-end
plugins are not viable. Any kind of pass manager plugin is not an
option, as the entire pass pipeline needs to be (optionally) skipped.

Tests are currently missing; I will add them once there's consensus that
this is the way to go.



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


[llvm-branch-commits] [llvm] ExpandFp: Require RuntimeLibcallsInfo analysis (PR #165197)

2025-10-27 Thread Saleem Abdulrasool via llvm-branch-commits


@@ -1126,13 +1130,23 @@ PreservedAnalyses ExpandFpPass::run(Function &F, 
FunctionAnalysisManager &FAM) {
   AssumptionCache *AC = nullptr;
   if (OptLevel != CodeGenOptLevel::None)
 AC = &FAM.getResult(F);
+
+  auto &MAMProxy = FAM.getResult(F);
+  const RTLIB::RuntimeLibcallsInfo *Libcalls =
+  MAMProxy.getCachedResult(*F.getParent());
+  if (!Libcalls) {
+F.getContext().emitError("'runtime-libcall-info' analysis required");

compnerd wrote:

Is this pattern widely used? Should this just be an `assert` instead?

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


[llvm-branch-commits] [llvm] Analysis: Add RuntimeLibcall analysis pass (PR #165196)

2025-10-27 Thread Saleem Abdulrasool via llvm-branch-commits

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


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


[llvm-branch-commits] [clang] [FlowSensitive] [StatusOr] [8/N] Support value ctor and assignment (PR #163894)

2025-10-27 Thread Jan Voung via llvm-branch-commits

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


https://github.com/llvm/llvm-project/pull/163894
___
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: [BPF] Backport backend fixes related to BTF (PR #165154)

2025-10-27 Thread via llvm-branch-commits

eddyz87 wrote:

> seems like quite a large change, although it is restricted to the BPF 
> backend. @eddyz87 @yonghong-song what do you think about backporting this?

I agree with Yonghong, the changes should be fine to backport.

https://github.com/llvm/llvm-project/pull/165154
___
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: [BPF] Backport backend fixes related to BTF (PR #165154)

2025-10-27 Thread via llvm-branch-commits

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


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


[llvm-branch-commits] [llvm] [DirectX] Add DXIL validation of `llvm.loop` metadata (PR #164292)

2025-10-27 Thread Finn Plummer via llvm-branch-commits

https://github.com/inbelic updated 
https://github.com/llvm/llvm-project/pull/164292

>From 868c42bbd41aae5c43c89dd653d949418ec914f1 Mon Sep 17 00:00:00 2001
From: Finn Plummer 
Date: Fri, 17 Oct 2025 10:17:32 -0700
Subject: [PATCH 01/15] [DirectX] add a DXILValidateMetadata pass

---
 llvm/docs/DirectX/DXILArchitecture.rst|  4 +-
 llvm/lib/Target/DirectX/CMakeLists.txt|  1 +
 .../Target/DirectX/DXILTranslateMetadata.cpp  | 63 ++---
 .../Target/DirectX/DXILTranslateMetadata.h| 17 
 .../Target/DirectX/DXILValidateMetadata.cpp   | 90 +++
 .../lib/Target/DirectX/DXILValidateMetadata.h | 24 +
 llvm/lib/Target/DirectX/DirectX.h |  6 ++
 .../Target/DirectX/DirectXPassRegistry.def|  1 +
 .../Target/DirectX/DirectXTargetMachine.cpp   |  3 +
 llvm/test/CodeGen/DirectX/llc-pipeline.ll |  1 +
 10 files changed, 172 insertions(+), 38 deletions(-)
 create mode 100644 llvm/lib/Target/DirectX/DXILValidateMetadata.cpp
 create mode 100644 llvm/lib/Target/DirectX/DXILValidateMetadata.h

diff --git a/llvm/docs/DirectX/DXILArchitecture.rst 
b/llvm/docs/DirectX/DXILArchitecture.rst
index bce7fdaa386ed..de72697fc4505 100644
--- a/llvm/docs/DirectX/DXILArchitecture.rst
+++ b/llvm/docs/DirectX/DXILArchitecture.rst
@@ -113,7 +113,7 @@ are grouped into two flows:
 
 The passes to generate DXIL IR follow the flow:
 
-  DXILOpLowering -> DXILPrepare -> DXILTranslateMetadata
+  DXILOpLowering -> DXILPrepare -> DXILTranslateMetadata -> 
DXILValidateMetadata
 
 Each of these passes has a defined responsibility:
 
@@ -122,6 +122,8 @@ Each of these passes has a defined responsibility:
namely removing attributes, and inserting bitcasts to allow typed pointers
to be inserted.
 #. DXILTranslateMetadata transforms and emits all recognized DXIL Metadata.
+#. DXILValidateMetadata validates all emitted DXIL metadata structures
+   conform to DXIL validation.
 
 The passes to encode DXIL to binary in the DX Container follow the flow:
 
diff --git a/llvm/lib/Target/DirectX/CMakeLists.txt 
b/llvm/lib/Target/DirectX/CMakeLists.txt
index 6c079517e22d6..f9900370660dd 100644
--- a/llvm/lib/Target/DirectX/CMakeLists.txt
+++ b/llvm/lib/Target/DirectX/CMakeLists.txt
@@ -35,6 +35,7 @@ add_llvm_target(DirectXCodeGen
   DXILResourceImplicitBinding.cpp
   DXILShaderFlags.cpp
   DXILTranslateMetadata.cpp
+  DXILValidateMetadata.cpp
   DXILRootSignature.cpp
   DXILLegalizePass.cpp
   
diff --git a/llvm/lib/Target/DirectX/DXILTranslateMetadata.cpp 
b/llvm/lib/Target/DirectX/DXILTranslateMetadata.cpp
index 1e4797bbd05aa..5c3635a1a6c68 100644
--- a/llvm/lib/Target/DirectX/DXILTranslateMetadata.cpp
+++ b/llvm/lib/Target/DirectX/DXILTranslateMetadata.cpp
@@ -454,45 +454,34 @@ PreservedAnalyses DXILTranslateMetadata::run(Module &M,
   return PreservedAnalyses::all();
 }
 
-namespace {
-class DXILTranslateMetadataLegacy : public ModulePass {
-public:
-  static char ID; // Pass identification, replacement for typeid
-  explicit DXILTranslateMetadataLegacy() : ModulePass(ID) {}
-
-  StringRef getPassName() const override { return "DXIL Translate Metadata"; }
-
-  void getAnalysisUsage(AnalysisUsage &AU) const override {
-AU.addRequired();
-AU.addRequired();
-AU.addRequired();
-AU.addRequired();
-AU.addRequired();
-
-AU.addPreserved();
-AU.addPreserved();
-AU.addPreserved();
-AU.addPreserved();
-AU.addPreserved();
-  }
+void DXILTranslateMetadataLegacy::getAnalysisUsage(AnalysisUsage &AU) const {
+  AU.addRequired();
+  AU.addRequired();
+  AU.addRequired();
+  AU.addRequired();
+  AU.addRequired();
+
+  AU.addPreserved();
+  AU.addPreserved();
+  AU.addPreserved();
+  AU.addPreserved();
+  AU.addPreserved();
+}
 
-  bool runOnModule(Module &M) override {
-DXILResourceMap &DRM =
-getAnalysis().getResourceMap();
-DXILResourceTypeMap &DRTM =
-getAnalysis().getResourceTypeMap();
-const ModuleShaderFlags &ShaderFlags =
-getAnalysis().getShaderFlags();
-dxil::ModuleMetadataInfo MMDI =
-getAnalysis().getModuleMetadata();
-
-translateGlobalMetadata(M, DRM, DRTM, ShaderFlags, MMDI);
-translateInstructionMetadata(M);
-return true;
-  }
-};
+bool DXILTranslateMetadataLegacy::runOnModule(Module &M) {
+  DXILResourceMap &DRM =
+  getAnalysis().getResourceMap();
+  DXILResourceTypeMap &DRTM =
+  getAnalysis().getResourceTypeMap();
+  const ModuleShaderFlags &ShaderFlags =
+  getAnalysis().getShaderFlags();
+  dxil::ModuleMetadataInfo MMDI =
+  getAnalysis().getModuleMetadata();
 
-} // namespace
+  translateGlobalMetadata(M, DRM, DRTM, ShaderFlags, MMDI);
+  translateInstructionMetadata(M);
+  return true;
+}
 
 char DXILTranslateMetadataLegacy::ID = 0;
 
diff --git a/llvm/lib/Target/DirectX/DXILTranslateMetadata.h 
b/llvm/lib/Target/DirectX/DXILTranslateMetadata.h
index 4c1ffac1781e6..cfb8aaa8f98b5 100644
--- a/llvm/lib/Target/DirectX/DXILTranslateMetadata.h
+++ b/llvm/lib/Target/DirectX/D

[llvm-branch-commits] [llvm] [lit] Add support for setting limits to unlimited (PR #165123)

2025-10-27 Thread Alexander Richardson via llvm-branch-commits


@@ -602,18 +602,28 @@ def executeBuiltinUlimit(cmd, shenv):
 """executeBuiltinUlimit - Change the current limits."""
 if os.name != "posix":
 raise InternalShellError(cmd, "'ulimit' not supported on this system")
+# Import resource here after we confirm we are on a POSIX system as the
+# module does not exist on Windows.
+import resource

arichardson wrote:

```suggestion
try:
# Try importing the resource package (for POSIX systems) and emit
# an error on Windows where it does not exist.
import resource
except ImportError:
raise InternalShellError(cmd, "'ulimit' not supported on this system")
```

I guess this would be the other option to avoid hardcoding os.name == posix

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


[llvm-branch-commits] [llvm] [llvm-readobj] Fix the test case (PR #165279)

2025-10-27 Thread via llvm-branch-commits

https://github.com/aokblast updated 
https://github.com/llvm/llvm-project/pull/165279

>From a5ac1cbf6eab90416998ffce7f76c8b86fe44595 Mon Sep 17 00:00:00 2001
From: ShengYi Hung 
Date: Tue, 28 Oct 2025 00:43:53 +0800
Subject: [PATCH] [llvm-readobj] Fix the test case

This patch is to reflect the change in supporting more than PN_XNUM
segments in readobj.
---
 llvm/test/tools/llvm-objcopy/ELF/many-sections.test | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/test/tools/llvm-objcopy/ELF/many-sections.test 
b/llvm/test/tools/llvm-objcopy/ELF/many-sections.test
index 6622db237026f..4c618acb5c951 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/many-sections.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/many-sections.test
@@ -6,8 +6,8 @@ RUN: llvm-readobj --file-headers --sections --symbols %t2 | 
FileCheck %s
 RUN: llvm-readelf --symbols %t2 | FileCheck --check-prefix=SYMS %s
 
 ## The ELF header should have e_shnum == 0 and e_shstrndx == SHN_XINDEX.
-# CHECK:SectionHeaderCount: 0
-# CHECK-NEXT:   StringTableSectionIndex: 65535
+# CHECK:SectionHeaderCount: 0 (65540)
+# CHECK-NEXT:   StringTableSectionIndex: 65535 (65539)
 
 ## The first section header should store the real section header count and
 ## shstrndx in its fields.

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


[llvm-branch-commits] [lit] Expand late substitutions before running builtins (PR #165140)

2025-10-27 Thread Aiden Grossman via llvm-branch-commits

https://github.com/boomanaiden154 updated 
https://github.com/llvm/llvm-project/pull/165140


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


[llvm-branch-commits] [lit] Expand late substitutions before running builtins (PR #165140)

2025-10-27 Thread Aiden Grossman via llvm-branch-commits

https://github.com/boomanaiden154 updated 
https://github.com/llvm/llvm-project/pull/165140


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


[llvm-branch-commits] [NSan] Make Tests work with Internal Shell (PR #165142)

2025-10-27 Thread Aiden Grossman via llvm-branch-commits

https://github.com/boomanaiden154 updated 
https://github.com/llvm/llvm-project/pull/165142


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


[llvm-branch-commits] [NSan] Make Tests work with Internal Shell (PR #165142)

2025-10-27 Thread Aiden Grossman via llvm-branch-commits

https://github.com/boomanaiden154 updated 
https://github.com/llvm/llvm-project/pull/165142


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


[llvm-branch-commits] [llvm] [lit] Add support for setting limits to unlimited (PR #165123)

2025-10-27 Thread Aiden Grossman via llvm-branch-commits

https://github.com/boomanaiden154 updated 
https://github.com/llvm/llvm-project/pull/165123

>From d34141d561067728d0954ffd574a973f21691e3e Mon Sep 17 00:00:00 2001
From: Aiden Grossman 
Date: Sun, 26 Oct 2025 08:29:41 +
Subject: [PATCH] fix

Created using spr 1.3.7
---
 llvm/utils/lit/lit/TestRunner.py | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py
index ee7670d4a9961..be01f15d649a1 100644
--- a/llvm/utils/lit/lit/TestRunner.py
+++ b/llvm/utils/lit/lit/TestRunner.py
@@ -12,7 +12,6 @@
 import shutil
 import tempfile
 import threading
-import resource
 import typing
 import traceback
 from typing import Optional, Tuple
@@ -603,6 +602,9 @@ def executeBuiltinUlimit(cmd, shenv):
 """executeBuiltinUlimit - Change the current limits."""
 if os.name != "posix":
 raise InternalShellError(cmd, "'ulimit' not supported on this system")
+# Import resource here after we confirm we are on a POSIX system as the
+# module does not exist on Windows.
+import resource
 if len(cmd.args) != 3:
 raise InternalShellError(cmd, "'ulimit' requires two arguments")
 try:
@@ -613,11 +615,15 @@ def executeBuiltinUlimit(cmd, shenv):
 except ValueError as err:
 raise InternalShellError(cmd, "Error: 'ulimit': %s" % str(err))
 if cmd.args[1] == "-v":
-shenv.ulimit["RLIMIT_AS"] = new_limit * 1024
+if new_limit != resource.RLIM_INFINITY:
+new_limit = new_limit * 1024
+shenv.ulimit["RLIMIT_AS"] = new_limit
 elif cmd.args[1] == "-n":
 shenv.ulimit["RLIMIT_NOFILE"] = new_limit
 elif cmd.args[1] == "-s":
-shenv.ulimit["RLIMIT_STACK"] = new_limit * 1024
+if new_limit != resource.RLIM_INFINITY:
+new_limit = new_limit * 1024
+shenv.ulimit["RLIMIT_STACK"] = new_limit
 elif cmd.args[1] == "-f":
 shenv.ulimit["RLIMIT_FSIZE"] = new_limit
 else:

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


[llvm-branch-commits] [llvm] [lit] Add support for setting limits to unlimited (PR #165123)

2025-10-27 Thread Aiden Grossman via llvm-branch-commits

https://github.com/boomanaiden154 updated 
https://github.com/llvm/llvm-project/pull/165123

>From d34141d561067728d0954ffd574a973f21691e3e Mon Sep 17 00:00:00 2001
From: Aiden Grossman 
Date: Sun, 26 Oct 2025 08:29:41 +
Subject: [PATCH] fix

Created using spr 1.3.7
---
 llvm/utils/lit/lit/TestRunner.py | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py
index ee7670d4a9961..be01f15d649a1 100644
--- a/llvm/utils/lit/lit/TestRunner.py
+++ b/llvm/utils/lit/lit/TestRunner.py
@@ -12,7 +12,6 @@
 import shutil
 import tempfile
 import threading
-import resource
 import typing
 import traceback
 from typing import Optional, Tuple
@@ -603,6 +602,9 @@ def executeBuiltinUlimit(cmd, shenv):
 """executeBuiltinUlimit - Change the current limits."""
 if os.name != "posix":
 raise InternalShellError(cmd, "'ulimit' not supported on this system")
+# Import resource here after we confirm we are on a POSIX system as the
+# module does not exist on Windows.
+import resource
 if len(cmd.args) != 3:
 raise InternalShellError(cmd, "'ulimit' requires two arguments")
 try:
@@ -613,11 +615,15 @@ def executeBuiltinUlimit(cmd, shenv):
 except ValueError as err:
 raise InternalShellError(cmd, "Error: 'ulimit': %s" % str(err))
 if cmd.args[1] == "-v":
-shenv.ulimit["RLIMIT_AS"] = new_limit * 1024
+if new_limit != resource.RLIM_INFINITY:
+new_limit = new_limit * 1024
+shenv.ulimit["RLIMIT_AS"] = new_limit
 elif cmd.args[1] == "-n":
 shenv.ulimit["RLIMIT_NOFILE"] = new_limit
 elif cmd.args[1] == "-s":
-shenv.ulimit["RLIMIT_STACK"] = new_limit * 1024
+if new_limit != resource.RLIM_INFINITY:
+new_limit = new_limit * 1024
+shenv.ulimit["RLIMIT_STACK"] = new_limit
 elif cmd.args[1] == "-f":
 shenv.ulimit["RLIMIT_FSIZE"] = new_limit
 else:

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


[llvm-branch-commits] [ASan] Make tests work with internal shell (PR #165141)

2025-10-27 Thread Aiden Grossman via llvm-branch-commits

https://github.com/boomanaiden154 updated 
https://github.com/llvm/llvm-project/pull/165141


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


[llvm-branch-commits] [XRay] Make Test Work with Internal Shell (PR #165143)

2025-10-27 Thread Aiden Grossman via llvm-branch-commits

https://github.com/boomanaiden154 updated 
https://github.com/llvm/llvm-project/pull/165143


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


[llvm-branch-commits] [ASan] Make tests work with internal shell (PR #165141)

2025-10-27 Thread Aiden Grossman via llvm-branch-commits

https://github.com/boomanaiden154 updated 
https://github.com/llvm/llvm-project/pull/165141


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


[llvm-branch-commits] [XRay] Make Test Work with Internal Shell (PR #165143)

2025-10-27 Thread Aiden Grossman via llvm-branch-commits

https://github.com/boomanaiden154 updated 
https://github.com/llvm/llvm-project/pull/165143


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


[llvm-branch-commits] [Profile] Rewrite Test to work with Internal Shell (PR #165145)

2025-10-27 Thread Aiden Grossman via llvm-branch-commits

https://github.com/boomanaiden154 updated 
https://github.com/llvm/llvm-project/pull/165145


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


[llvm-branch-commits] [MSan] Make Test work with Internal Shell (PR #165144)

2025-10-27 Thread Aiden Grossman via llvm-branch-commits

https://github.com/boomanaiden154 updated 
https://github.com/llvm/llvm-project/pull/165144


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


[llvm-branch-commits] [MSan] Make Test work with Internal Shell (PR #165144)

2025-10-27 Thread Aiden Grossman via llvm-branch-commits

https://github.com/boomanaiden154 updated 
https://github.com/llvm/llvm-project/pull/165144


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


[llvm-branch-commits] [Profile] Rewrite Test to work with Internal Shell (PR #165145)

2025-10-27 Thread Aiden Grossman via llvm-branch-commits

https://github.com/boomanaiden154 updated 
https://github.com/llvm/llvm-project/pull/165145


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


[llvm-branch-commits] [MemProf] Make Test work with Internal Shell (PR #165146)

2025-10-27 Thread Aiden Grossman via llvm-branch-commits

https://github.com/boomanaiden154 updated 
https://github.com/llvm/llvm-project/pull/165146


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


[llvm-branch-commits] [MemProf] Make Test work with Internal Shell (PR #165146)

2025-10-27 Thread Aiden Grossman via llvm-branch-commits

https://github.com/boomanaiden154 updated 
https://github.com/llvm/llvm-project/pull/165146


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


[llvm-branch-commits] [compiler-rt] [compiler-rt] Default to Lit's Internal Shell (PR #165148)

2025-10-27 Thread Aiden Grossman via llvm-branch-commits

https://github.com/boomanaiden154 updated 
https://github.com/llvm/llvm-project/pull/165148

>From e90f11ccc5e29f48dab9a7a0931719fef0ca3eeb Mon Sep 17 00:00:00 2001
From: Aiden Grossman 
Date: Mon, 27 Oct 2025 13:08:11 +
Subject: [PATCH] formatting

Created using spr 1.3.7
---
 compiler-rt/test/lit.common.cfg.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/compiler-rt/test/lit.common.cfg.py 
b/compiler-rt/test/lit.common.cfg.py
index 445841e599ec9..1468c0742a766 100644
--- a/compiler-rt/test/lit.common.cfg.py
+++ b/compiler-rt/test/lit.common.cfg.py
@@ -112,6 +112,7 @@ def push_dynamic_library_lookup_path(config, new_path):
 )
 config.environment[dynamic_library_lookup_var] = new_ld_library_path_64
 
+
 # TODO: Consolidate the logic for turning on the internal shell by default for 
all LLVM test suites.
 # See https://github.com/llvm/llvm-project/issues/106636 for more details.
 #

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


[llvm-branch-commits] [compiler-rt] [compiler-rt] Default to Lit's Internal Shell (PR #165148)

2025-10-27 Thread Aiden Grossman via llvm-branch-commits

https://github.com/boomanaiden154 updated 
https://github.com/llvm/llvm-project/pull/165148

>From e90f11ccc5e29f48dab9a7a0931719fef0ca3eeb Mon Sep 17 00:00:00 2001
From: Aiden Grossman 
Date: Mon, 27 Oct 2025 13:08:11 +
Subject: [PATCH] formatting

Created using spr 1.3.7
---
 compiler-rt/test/lit.common.cfg.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/compiler-rt/test/lit.common.cfg.py 
b/compiler-rt/test/lit.common.cfg.py
index 445841e599ec9..1468c0742a766 100644
--- a/compiler-rt/test/lit.common.cfg.py
+++ b/compiler-rt/test/lit.common.cfg.py
@@ -112,6 +112,7 @@ def push_dynamic_library_lookup_path(config, new_path):
 )
 config.environment[dynamic_library_lookup_var] = new_ld_library_path_64
 
+
 # TODO: Consolidate the logic for turning on the internal shell by default for 
all LLVM test suites.
 # See https://github.com/llvm/llvm-project/issues/106636 for more details.
 #

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


[llvm-branch-commits] [TSan] Make Test work with Internal Shell (PR #165147)

2025-10-27 Thread Aiden Grossman via llvm-branch-commits

https://github.com/boomanaiden154 updated 
https://github.com/llvm/llvm-project/pull/165147


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


[llvm-branch-commits] [TSan] Make Test work with Internal Shell (PR #165147)

2025-10-27 Thread Aiden Grossman via llvm-branch-commits

https://github.com/boomanaiden154 updated 
https://github.com/llvm/llvm-project/pull/165147


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


[llvm-branch-commits] [libcxx] Add Testing Configuration for LLVM libc (PR #165120)

2025-10-27 Thread Aiden Grossman via llvm-branch-commits

boomanaiden154 wrote:

> Do you know roughly how many tests are affected? If it's not too many maybe 
> we should simply XFAIL them for LLVM libc and update them as new features get 
> implemented?

There are a couple hundred currently. Most are due to 
https://github.com/llvm/llvm-project/issues/85335, so I think we might want to 
fix that first before enabling in CI. Other than that I think there are ~100 
tests. Not sure if that's a reasonable enough number to xfail and work through 
in tree.

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


[llvm-branch-commits] [lld] [lld][test] Fix AArch64 build attribute test cleanup (PR #164384)

2025-10-27 Thread Cullen Rhodes via llvm-branch-commits

https://github.com/c-rhodes updated 
https://github.com/llvm/llvm-project/pull/164384

>From cd7d2db5a50cad76ad991d803ee645ba733c88a0 Mon Sep 17 00:00:00 2001
From: David Spickett 
Date: Tue, 21 Oct 2025 09:54:16 +
Subject: [PATCH] [lld][test] Fix AArch64 build attribute test cleanup
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This test has been reported to fail on a release bot, but nothing
in the content of the test on the release branch should cause this problem:
ld.lld: error: cannot open output file 
/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu-rel/build/stage1/tools/lld/test/ELF/Output/aarch64-build-attributes.s.tmp:
 Is a directory

The reason this is happening is that if the same builder happened to
run the extended version of this test, from a build of main, it would
create a directory with that name. The test on main stashes the
temporary files in that directory.

$ tree tools/lld/test/
tools/lld/test/
├── CMakeFiles
├── ELF
│   └── Output
│   ├── aarch64-build-attributes.s.tmp
│   │   ├── pauth-bti-gcs.s
│   │   └── pauth-bti-pac.s
│   ├── aarch64-build-attributes.s.tmp.merged.o
│   ├── aarch64-build-attributes.s.tmp1.o
│   ├── aarch64-build-attributes.s.tmp2.o
│   └── aarch64-build-attributes.s.tmp3.o
├── Unit
│   └── lit.site.cfg.py
├── cmake_install.cmake
└── lit.site.cfg.py

If you then had a 21.x build run, it would find that pre-existing
directory and try to write to it as if it were a file.

ld.lld: error: cannot open output file 
/home/david.spickett/build-llvm-aarch64/tools/lld/test/ELF/Output/aarch64-build-attributes.s.tmp:
 Is a directory

To fix this, remove the file or directory names we're going to use,
before the test starts.

(if this were main I'd put all the files in one direcory, but in the
interest of keeping release changes small I'm just adding the rm
line)
---
 lld/test/ELF/aarch64-build-attributes.s | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lld/test/ELF/aarch64-build-attributes.s 
b/lld/test/ELF/aarch64-build-attributes.s
index 24e15f94e3d4a..815aed32f2aaa 100644
--- a/lld/test/ELF/aarch64-build-attributes.s
+++ b/lld/test/ELF/aarch64-build-attributes.s
@@ -1,4 +1,5 @@
 // REQUIRES: aarch64
+// RUN: rm -rf %t %t.o %t.so %t2.o
 // RUN: llvm-mc -triple=aarch64 %s -filetype=obj -o %t.o
 // RUN: ld.lld %t.o --shared -o %t.so
 // RUN: llvm-readelf --sections %t.so | FileCheck %s

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


[llvm-branch-commits] [lld] [lld][test] Fix AArch64 build attribute test cleanup (PR #164384)

2025-10-27 Thread Cullen Rhodes via llvm-branch-commits

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


[llvm-branch-commits] [lld] cd7d2db - [lld][test] Fix AArch64 build attribute test cleanup

2025-10-27 Thread Cullen Rhodes via llvm-branch-commits

Author: David Spickett
Date: 2025-10-27T10:09:34Z
New Revision: cd7d2db5a50cad76ad991d803ee645ba733c88a0

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

LOG: [lld][test] Fix AArch64 build attribute test cleanup

This test has been reported to fail on a release bot, but nothing
in the content of the test on the release branch should cause this problem:
ld.lld: error: cannot open output file 
/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu-rel/build/stage1/tools/lld/test/ELF/Output/aarch64-build-attributes.s.tmp:
 Is a directory

The reason this is happening is that if the same builder happened to
run the extended version of this test, from a build of main, it would
create a directory with that name. The test on main stashes the
temporary files in that directory.

$ tree tools/lld/test/
tools/lld/test/
├── CMakeFiles
├── ELF
│   └── Output
│   ├── aarch64-build-attributes.s.tmp
│   │   ├── pauth-bti-gcs.s
│   │   └── pauth-bti-pac.s
│   ├── aarch64-build-attributes.s.tmp.merged.o
│   ├── aarch64-build-attributes.s.tmp1.o
│   ├── aarch64-build-attributes.s.tmp2.o
│   └── aarch64-build-attributes.s.tmp3.o
├── Unit
│   └── lit.site.cfg.py
├── cmake_install.cmake
└── lit.site.cfg.py

If you then had a 21.x build run, it would find that pre-existing
directory and try to write to it as if it were a file.

ld.lld: error: cannot open output file 
/home/david.spickett/build-llvm-aarch64/tools/lld/test/ELF/Output/aarch64-build-attributes.s.tmp:
 Is a directory

To fix this, remove the file or directory names we're going to use,
before the test starts.

(if this were main I'd put all the files in one direcory, but in the
interest of keeping release changes small I'm just adding the rm
line)

Added: 


Modified: 
lld/test/ELF/aarch64-build-attributes.s

Removed: 




diff  --git a/lld/test/ELF/aarch64-build-attributes.s 
b/lld/test/ELF/aarch64-build-attributes.s
index 24e15f94e3d4a..815aed32f2aaa 100644
--- a/lld/test/ELF/aarch64-build-attributes.s
+++ b/lld/test/ELF/aarch64-build-attributes.s
@@ -1,4 +1,5 @@
 // REQUIRES: aarch64
+// RUN: rm -rf %t %t.o %t.so %t2.o
 // RUN: llvm-mc -triple=aarch64 %s -filetype=obj -o %t.o
 // RUN: ld.lld %t.o --shared -o %t.so
 // RUN: llvm-readelf --sections %t.so | FileCheck %s



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


[llvm-branch-commits] [lld] [lld][test] Fix AArch64 build attribute test cleanup (PR #164384)

2025-10-27 Thread via llvm-branch-commits

github-actions[bot] wrote:

@DavidSpickett (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/164384
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [Clang] Do not warn on UTF-16 -> UTF-32 conversions. (#163927) (PR #164654)

2025-10-27 Thread via llvm-branch-commits

github-actions[bot] wrote:

@cor3ntin (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/164654
___
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: [sancov] Fix stack-depth tracking to use debug locations (#162428) (PR #162697)

2025-10-27 Thread Cullen Rhodes via llvm-branch-commits

https://github.com/c-rhodes updated 
https://github.com/llvm/llvm-project/pull/162697

>From 9faef12c7209a951d7cb757e031f53eacc886a51 Mon Sep 17 00:00:00 2001
From: Kees Cook 
Date: Thu, 9 Oct 2025 00:49:57 -0700
Subject: [PATCH] [sancov] Fix stack-depth tracking to use debug locations
 (#162428)

As fixed in commits llvm/llvm-project@913f7e9,
llvm/llvm-project@4a8b124, and llvm/llvm-project@4eef2e3, also fix the
stack-depth tracking code to use InstrumentationIRBuilder, and set the
Call's Debug location to EntryLoc.

https://github.com/ClangBuiltLinux/linux/issues/2125

cc @nathanchance @melver @JustinStitt @bwendling

(cherry picked from commit 28b7f669e5c6427402f36c5a08def4b34089c7cd)
---
 .../Instrumentation/SanitizerCoverage.cpp | 13 ++-
 .../SanitizerCoverage/missing_dbg.ll  | 92 +++
 2 files changed, 102 insertions(+), 3 deletions(-)

diff --git a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp 
b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
index 5b8ea1547ca2f..b74a0708b67ae 100644
--- a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
+++ b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
@@ -1084,8 +1084,10 @@ void 
ModuleSanitizerCoverage::InjectCoverageAtBlock(Function &F, BasicBlock &BB,
 auto ThenTerm = SplitBlockAndInsertIfThen(
 IRB.CreateIsNull(Load), &*IP, false,
 MDBuilder(IRB.getContext()).createUnlikelyBranchWeights());
-IRBuilder<> ThenIRB(ThenTerm);
+InstrumentationIRBuilder ThenIRB(ThenTerm);
 auto Store = ThenIRB.CreateStore(ConstantInt::getTrue(Int1Ty), FlagPtr);
+if (EntryLoc)
+  Store->setDebugLoc(EntryLoc);
 Load->setNoSanitizeMetadata();
 Store->setNoSanitizeMetadata();
   }
@@ -1131,7 +1133,10 @@ void 
ModuleSanitizerCoverage::InjectCoverageAtBlock(Function &F, BasicBlock &BB,
   EstimatedStackSize >= Options.StackDepthCallbackMin) {
 if (InsertBefore)
   IRB.SetInsertPoint(InsertBefore);
-IRB.CreateCall(SanCovStackDepthCallback)->setCannotMerge();
+auto Call = IRB.CreateCall(SanCovStackDepthCallback);
+if (EntryLoc)
+  Call->setDebugLoc(EntryLoc);
+Call->setCannotMerge();
   }
 } else {
   // Check stack depth.  If it's the deepest so far, record it.
@@ -1144,8 +1149,10 @@ void 
ModuleSanitizerCoverage::InjectCoverageAtBlock(Function &F, BasicBlock &BB,
   auto ThenTerm = SplitBlockAndInsertIfThen(
   IsStackLower, &*IP, false,
   MDBuilder(IRB.getContext()).createUnlikelyBranchWeights());
-  IRBuilder<> ThenIRB(ThenTerm);
+  InstrumentationIRBuilder ThenIRB(ThenTerm);
   auto Store = ThenIRB.CreateStore(FrameAddrInt, SanCovLowestStack);
+  if (EntryLoc)
+Store->setDebugLoc(EntryLoc);
   LowestStack->setNoSanitizeMetadata();
   Store->setNoSanitizeMetadata();
 }
diff --git a/llvm/test/Instrumentation/SanitizerCoverage/missing_dbg.ll 
b/llvm/test/Instrumentation/SanitizerCoverage/missing_dbg.ll
index 35684346c4d5a..07b9a1ce496d9 100644
--- a/llvm/test/Instrumentation/SanitizerCoverage/missing_dbg.ll
+++ b/llvm/test/Instrumentation/SanitizerCoverage/missing_dbg.ll
@@ -1,5 +1,7 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py 
UTC_ARGS: --version 5
 ; RUN: opt < %s -passes='module(sancov-module)' -sanitizer-coverage-level=2 -S 
| FileCheck %s
+; RUN: opt < %s -passes='module(sancov-module)' -sanitizer-coverage-level=1 
-sanitizer-coverage-stack-depth -sanitizer-coverage-stack-depth-callback-min=1 
-S | FileCheck %s --check-prefix=CHECK-STACK-CALLBACK
+; RUN: opt < %s -passes='module(sancov-module)' -sanitizer-coverage-level=1 
-sanitizer-coverage-stack-depth -S | FileCheck %s 
--check-prefix=CHECK-STACK-DEPTH
 
 target datalayout = 
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
 
@@ -55,6 +57,86 @@ entry:
   ret i32 %t
 }
 
+define i32 @with_dbg_stack_callback(ptr %a) !dbg !8 {
+; CHECK-STACK-CALLBACK-LABEL: define i32 @with_dbg_stack_callback(
+; CHECK-STACK-CALLBACK-SAME: ptr [[A:%.*]]) !dbg [[DBG8:![0-9]+]] {
+; CHECK-STACK-CALLBACK-NEXT:  entry:
+; CHECK-STACK-CALLBACK-NEXT:[[BUF:%.*]] = alloca [64 x i8], align 1
+; CHECK-STACK-CALLBACK-NEXT:call void @__sanitizer_cov_stack_depth() 
#[[ATTR1:[0-9]+]], !dbg [[DBG9:![0-9]+]]
+; CHECK-STACK-CALLBACK-NEXT:%t = load i32, ptr [[A]], align 4
+; CHECK-STACK-CALLBACK-NEXT:call void @external_func()
+; CHECK-STACK-CALLBACK-NEXT:ret i32 %t
+;
+entry:
+  %buf = alloca [64 x i8], align 1
+  %t = load i32, ptr %a, align 4
+  call void @external_func()
+  ret i32 %t
+}
+
+define i32 @with_dbg_stack_depth(ptr %a) !dbg !10 {
+; CHECK-STACK-DEPTH-LABEL: define i32 @with_dbg_stack_depth(
+; CHECK-STACK-DEPTH-SAME: ptr [[A:%.*]]) !dbg [[DBG10:![0-9]+]] {
+; CHECK-STACK-DEPTH-NEXT:  entry:
+; CHECK-STACK-DEPTH-NEXT:[[BUF:%.*]] = alloca [64 x i8], 

[llvm-branch-commits] [llvm] 9faef12 - [sancov] Fix stack-depth tracking to use debug locations (#162428)

2025-10-27 Thread Cullen Rhodes via llvm-branch-commits

Author: Kees Cook
Date: 2025-10-27T10:00:09Z
New Revision: 9faef12c7209a951d7cb757e031f53eacc886a51

URL: 
https://github.com/llvm/llvm-project/commit/9faef12c7209a951d7cb757e031f53eacc886a51
DIFF: 
https://github.com/llvm/llvm-project/commit/9faef12c7209a951d7cb757e031f53eacc886a51.diff

LOG: [sancov] Fix stack-depth tracking to use debug locations (#162428)

As fixed in commits llvm/llvm-project@913f7e9,
llvm/llvm-project@4a8b124, and llvm/llvm-project@4eef2e3, also fix the
stack-depth tracking code to use InstrumentationIRBuilder, and set the
Call's Debug location to EntryLoc.

https://github.com/ClangBuiltLinux/linux/issues/2125

cc @nathanchance @melver @JustinStitt @bwendling

(cherry picked from commit 28b7f669e5c6427402f36c5a08def4b34089c7cd)

Added: 


Modified: 
llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
llvm/test/Instrumentation/SanitizerCoverage/missing_dbg.ll

Removed: 




diff  --git a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp 
b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
index 5b8ea1547ca2f..b74a0708b67ae 100644
--- a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
+++ b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
@@ -1084,8 +1084,10 @@ void 
ModuleSanitizerCoverage::InjectCoverageAtBlock(Function &F, BasicBlock &BB,
 auto ThenTerm = SplitBlockAndInsertIfThen(
 IRB.CreateIsNull(Load), &*IP, false,
 MDBuilder(IRB.getContext()).createUnlikelyBranchWeights());
-IRBuilder<> ThenIRB(ThenTerm);
+InstrumentationIRBuilder ThenIRB(ThenTerm);
 auto Store = ThenIRB.CreateStore(ConstantInt::getTrue(Int1Ty), FlagPtr);
+if (EntryLoc)
+  Store->setDebugLoc(EntryLoc);
 Load->setNoSanitizeMetadata();
 Store->setNoSanitizeMetadata();
   }
@@ -1131,7 +1133,10 @@ void 
ModuleSanitizerCoverage::InjectCoverageAtBlock(Function &F, BasicBlock &BB,
   EstimatedStackSize >= Options.StackDepthCallbackMin) {
 if (InsertBefore)
   IRB.SetInsertPoint(InsertBefore);
-IRB.CreateCall(SanCovStackDepthCallback)->setCannotMerge();
+auto Call = IRB.CreateCall(SanCovStackDepthCallback);
+if (EntryLoc)
+  Call->setDebugLoc(EntryLoc);
+Call->setCannotMerge();
   }
 } else {
   // Check stack depth.  If it's the deepest so far, record it.
@@ -1144,8 +1149,10 @@ void 
ModuleSanitizerCoverage::InjectCoverageAtBlock(Function &F, BasicBlock &BB,
   auto ThenTerm = SplitBlockAndInsertIfThen(
   IsStackLower, &*IP, false,
   MDBuilder(IRB.getContext()).createUnlikelyBranchWeights());
-  IRBuilder<> ThenIRB(ThenTerm);
+  InstrumentationIRBuilder ThenIRB(ThenTerm);
   auto Store = ThenIRB.CreateStore(FrameAddrInt, SanCovLowestStack);
+  if (EntryLoc)
+Store->setDebugLoc(EntryLoc);
   LowestStack->setNoSanitizeMetadata();
   Store->setNoSanitizeMetadata();
 }

diff  --git a/llvm/test/Instrumentation/SanitizerCoverage/missing_dbg.ll 
b/llvm/test/Instrumentation/SanitizerCoverage/missing_dbg.ll
index 35684346c4d5a..07b9a1ce496d9 100644
--- a/llvm/test/Instrumentation/SanitizerCoverage/missing_dbg.ll
+++ b/llvm/test/Instrumentation/SanitizerCoverage/missing_dbg.ll
@@ -1,5 +1,7 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py 
UTC_ARGS: --version 5
 ; RUN: opt < %s -passes='module(sancov-module)' -sanitizer-coverage-level=2 -S 
| FileCheck %s
+; RUN: opt < %s -passes='module(sancov-module)' -sanitizer-coverage-level=1 
-sanitizer-coverage-stack-depth -sanitizer-coverage-stack-depth-callback-min=1 
-S | FileCheck %s --check-prefix=CHECK-STACK-CALLBACK
+; RUN: opt < %s -passes='module(sancov-module)' -sanitizer-coverage-level=1 
-sanitizer-coverage-stack-depth -S | FileCheck %s 
--check-prefix=CHECK-STACK-DEPTH
 
 target datalayout = 
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
 
@@ -55,6 +57,86 @@ entry:
   ret i32 %t
 }
 
+define i32 @with_dbg_stack_callback(ptr %a) !dbg !8 {
+; CHECK-STACK-CALLBACK-LABEL: define i32 @with_dbg_stack_callback(
+; CHECK-STACK-CALLBACK-SAME: ptr [[A:%.*]]) !dbg [[DBG8:![0-9]+]] {
+; CHECK-STACK-CALLBACK-NEXT:  entry:
+; CHECK-STACK-CALLBACK-NEXT:[[BUF:%.*]] = alloca [64 x i8], align 1
+; CHECK-STACK-CALLBACK-NEXT:call void @__sanitizer_cov_stack_depth() 
#[[ATTR1:[0-9]+]], !dbg [[DBG9:![0-9]+]]
+; CHECK-STACK-CALLBACK-NEXT:%t = load i32, ptr [[A]], align 4
+; CHECK-STACK-CALLBACK-NEXT:call void @external_func()
+; CHECK-STACK-CALLBACK-NEXT:ret i32 %t
+;
+entry:
+  %buf = alloca [64 x i8], align 1
+  %t = load i32, ptr %a, align 4
+  call void @external_func()
+  ret i32 %t
+}
+
+define i32 @with_dbg_stack_depth(ptr %a) !dbg !10 {
+; CHECK-STACK-DEPTH-LABEL: define i32 @with_dbg_stack_depth(
+; CHECK-STACK-DEPTH-SAME: ptr [

[llvm-branch-commits] [llvm] release/21.x: [sancov] Fix stack-depth tracking to use debug locations (#162428) (PR #162697)

2025-10-27 Thread Cullen Rhodes via llvm-branch-commits

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


[llvm-branch-commits] [llvm] 2cdfa9d - [X86] Use pseudo instructions to zero registers in `buildClearRegister` (#163358)

2025-10-27 Thread Cullen Rhodes via llvm-branch-commits

Author: Abhishek Kaushik
Date: 2025-10-27T10:02:03Z
New Revision: 2cdfa9d9383c165f68a41a145c21d7f523485a8d

URL: 
https://github.com/llvm/llvm-project/commit/2cdfa9d9383c165f68a41a145c21d7f523485a8d
DIFF: 
https://github.com/llvm/llvm-project/commit/2cdfa9d9383c165f68a41a145c21d7f523485a8d.diff

LOG: [X86] Use pseudo instructions to zero registers in `buildClearRegister` 
(#163358)

In `buildClearRegister` use the correct pseudo-opcode for each register
class:

- For `VR128`, use `V_SET0`
- For `VR256`, use `AVX_SET0`
- For `VR512`, use `AVX512_512_SET0`
- For `VK*`, use `KSET0Q/KSET0W`

This avoids illegal register/opcode pairings and machine verifier errors
when clearing call-used registers under `-fzero-call-used-regs=used`.

Fixes: #163053

-

Co-authored-by: Simon Pilgrim 
(cherry picked from commit 228dae786b94bb85fb34bc157a43ca6c16932b6d)

Added: 
llvm/test/CodeGen/X86/zero-call-used-regs-simd.ll

Modified: 
llvm/lib/Target/X86/X86InstrInfo.cpp

Removed: 




diff  --git a/llvm/lib/Target/X86/X86InstrInfo.cpp 
b/llvm/lib/Target/X86/X86InstrInfo.cpp
index abf365eedec39..9bf58dd3458cd 100644
--- a/llvm/lib/Target/X86/X86InstrInfo.cpp
+++ b/llvm/lib/Target/X86/X86InstrInfo.cpp
@@ -10739,39 +10739,27 @@ void X86InstrInfo::buildClearRegister(Register Reg, 
MachineBasicBlock &MBB,
 if (!ST.hasSSE1())
   return;
 
-// PXOR is safe to use because it doesn't affect flags.
-BuildMI(MBB, Iter, DL, get(X86::PXORrr), Reg)
-.addReg(Reg, RegState::Undef)
-.addReg(Reg, RegState::Undef);
+BuildMI(MBB, Iter, DL, get(X86::V_SET0), Reg);
   } else if (X86::VR256RegClass.contains(Reg)) {
 // YMM#
 if (!ST.hasAVX())
   return;
 
-// VPXOR is safe to use because it doesn't affect flags.
-BuildMI(MBB, Iter, DL, get(X86::VPXORrr), Reg)
-.addReg(Reg, RegState::Undef)
-.addReg(Reg, RegState::Undef);
+BuildMI(MBB, Iter, DL, get(X86::AVX_SET0), Reg);
   } else if (X86::VR512RegClass.contains(Reg)) {
 // ZMM#
 if (!ST.hasAVX512())
   return;
 
-// VPXORY is safe to use because it doesn't affect flags.
-BuildMI(MBB, Iter, DL, get(X86::VPXORYrr), Reg)
-.addReg(Reg, RegState::Undef)
-.addReg(Reg, RegState::Undef);
+BuildMI(MBB, Iter, DL, get(X86::AVX512_512_SET0), Reg);
   } else if (X86::VK1RegClass.contains(Reg) || X86::VK2RegClass.contains(Reg) 
||
  X86::VK4RegClass.contains(Reg) || X86::VK8RegClass.contains(Reg) 
||
  X86::VK16RegClass.contains(Reg)) {
 if (!ST.hasVLX())
   return;
 
-// KXOR is safe to use because it doesn't affect flags.
-unsigned Op = ST.hasBWI() ? X86::KXORQkk : X86::KXORWkk;
-BuildMI(MBB, Iter, DL, get(Op), Reg)
-.addReg(Reg, RegState::Undef)
-.addReg(Reg, RegState::Undef);
+unsigned Op = ST.hasBWI() ? X86::KSET0Q : X86::KSET0W;
+BuildMI(MBB, Iter, DL, get(Op), Reg);
   }
 }
 

diff  --git a/llvm/test/CodeGen/X86/zero-call-used-regs-simd.ll 
b/llvm/test/CodeGen/X86/zero-call-used-regs-simd.ll
new file mode 100644
index 0..d9253e0ca127b
--- /dev/null
+++ b/llvm/test/CodeGen/X86/zero-call-used-regs-simd.ll
@@ -0,0 +1,216 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 
UTC_ARGS: --version 6
+; RUN: llc < %s -mtriple=x86_64-- -mattr=+sse2
-verify-machineinstrs | FileCheck %s --check-prefixes=SSE
+; RUN: llc < %s -mtriple=x86_64-- -mattr=+avx 
-verify-machineinstrs | FileCheck %s --check-prefixes=AVX,AVX1
+; RUN: llc < %s -mtriple=x86_64-- -mattr=+avx2
-verify-machineinstrs | FileCheck %s --check-prefixes=AVX,AVX2
+; RUN: llc < %s -mtriple=x86_64-- -mattr=+avx512f,+avx512vl   
-verify-machineinstrs | FileCheck %s --check-prefixes=AVX512,AVX512VL
+; RUN: llc < %s -mtriple=x86_64-- -mattr=+avx512f,+avx512vl,+avx512bw 
-verify-machineinstrs | FileCheck %s --check-prefixes=AVX512,AVX512BW
+
+define void @zero_xmm(<4 x i32> %arg) #0 {
+; SSE-LABEL: zero_xmm:
+; SSE:   # %bb.0:
+; SSE-NEXT:movaps %xmm0, 0
+; SSE-NEXT:xorps %xmm0, %xmm0
+; SSE-NEXT:retq
+;
+; AVX-LABEL: zero_xmm:
+; AVX:   # %bb.0:
+; AVX-NEXT:vmovaps %xmm0, 0
+; AVX-NEXT:vxorps %xmm0, %xmm0, %xmm0
+; AVX-NEXT:retq
+;
+; AVX512-LABEL: zero_xmm:
+; AVX512:   # %bb.0:
+; AVX512-NEXT:vmovaps %xmm0, 0
+; AVX512-NEXT:vxorps %xmm0, %xmm0, %xmm0
+; AVX512-NEXT:retq
+  store <4 x i32> %arg, ptr null, align 32
+  ret void
+}
+
+define void @zero_ymm(<8 x i32> %arg) #0 {
+; SSE-LABEL: zero_ymm:
+; SSE:   # %bb.0:
+; SSE-NEXT:movaps %xmm1, 16
+; SSE-NEXT:movaps %xmm0, 0
+; SSE-NEXT:xorps %xmm0, %xmm0
+; SSE-NEXT:xorps %xmm1, %xmm1
+; SSE-NEXT:retq
+;
+; AVX-LABEL: zero_ymm:
+; AVX:   # %bb.0:
+; AVX-NEXT:vmovaps %ymm0, 0
+; AVX-NEXT:vxorps %xmm0, %xmm0, %xmm0
+; AVX-NEXT:   

[llvm-branch-commits] [llvm] release/21.x: [Hexagon] Incorrect MIR after "hexinsert" pass (#164021) (PR #164354)

2025-10-27 Thread Cullen Rhodes via llvm-branch-commits

c-rhodes wrote:

@nikic are you happy with this now? Looks like the test issue has been resolved.

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


[llvm-branch-commits] [clang] 5c802f9 - [Clang] Do not warn on UTF-16 -> UTF-32 conversions. (#163927)

2025-10-27 Thread Cullen Rhodes via llvm-branch-commits

Author: Corentin Jabot
Date: 2025-10-27T10:19:33Z
New Revision: 5c802f9eac663ceb59d2fa68c1afa6bdd2aac680

URL: 
https://github.com/llvm/llvm-project/commit/5c802f9eac663ceb59d2fa68c1afa6bdd2aac680
DIFF: 
https://github.com/llvm/llvm-project/commit/5c802f9eac663ceb59d2fa68c1afa6bdd2aac680.diff

LOG: [Clang] Do not warn on UTF-16 -> UTF-32 conversions. (#163927)

UTF-16 to UTF-16 conversions seems widespread,
and lone surrogate have a distinct representation in UTF-32.

Lets not warn on this case to make the warning easier to adopt. This
follows SG-16 guideline


https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3695r2.html#changes-since-r1

Fixes #163719

Added: 


Modified: 
clang/lib/Sema/SemaChecking.cpp
clang/test/SemaCXX/warn-implicit-unicode-conversions.cpp

Removed: 




diff  --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index dd5b710d7e1d4..41bcf8fd493fc 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -12014,13 +12014,20 @@ static void 
DiagnoseMixedUnicodeImplicitConversion(Sema &S, const Type *Source,
SourceLocation CC) {
   assert(Source->isUnicodeCharacterType() && Target->isUnicodeCharacterType() 
&&
  Source != Target);
+
+  // Lone surrogates have a distinct representation in UTF-32.
+  // Converting between UTF-16 and UTF-32 codepoints seems very widespread,
+  // so don't warn on such conversion.
+  if (Source->isChar16Type() && Target->isChar32Type())
+return;
+
   Expr::EvalResult Result;
   if (E->EvaluateAsInt(Result, S.getASTContext(), Expr::SE_AllowSideEffects,
S.isConstantEvaluatedContext())) {
 llvm::APSInt Value(32);
 Value = Result.Val.getInt();
 bool IsASCII = Value <= 0x7F;
-bool IsBMP = Value <= 0xD7FF || (Value >= 0xE000 && Value <= 0x);
+bool IsBMP = Value <= 0xDFFF || (Value >= 0xE000 && Value <= 0x);
 bool ConversionPreservesSemantics =
 IsASCII || (!Source->isChar8Type() && !Target->isChar8Type() && IsBMP);
 

diff  --git a/clang/test/SemaCXX/warn-implicit-unicode-conversions.cpp 
b/clang/test/SemaCXX/warn-implicit-unicode-conversions.cpp
index fcff006d0e028..f17f20ca25295 100644
--- a/clang/test/SemaCXX/warn-implicit-unicode-conversions.cpp
+++ b/clang/test/SemaCXX/warn-implicit-unicode-conversions.cpp
@@ -14,7 +14,7 @@ void test(char8_t u8, char16_t u16, char32_t u32) {
 c16(u32); // expected-warning {{implicit conversion from 'char32_t' to 
'char16_t' may lose precision and change the meaning of the represented code 
unit}}
 
 c32(u8);  // expected-warning {{implicit conversion from 'char8_t' to 
'char32_t' may change the meaning of the represented code unit}}
-c32(u16); // expected-warning {{implicit conversion from 'char16_t' to 
'char32_t' may change the meaning of the represented code unit}}
+c32(u16);
 c32(u32);
 
 
@@ -30,7 +30,7 @@ void test(char8_t u8, char16_t u16, char32_t u32) {
 c16(char32_t(0x7f));
 c16(char32_t(0x80));
 c16(char32_t(0xD7FF));
-c16(char32_t(0xD800)); // expected-warning {{implicit conversion from 
'char32_t' to 'char16_t' changes the meaning of the code unit '<0xD800>'}}
+c16(char32_t(0xD800));
 c16(char32_t(0xE000));
 c16(char32_t(U'🐉')); // expected-warning {{implicit conversion from 
'char32_t' to 'char16_t' changes the meaning of the code point '🐉'}}
 
@@ -44,8 +44,8 @@ void test(char8_t u8, char16_t u16, char32_t u32) {
 c32(char16_t(0x80));
 
 c32(char16_t(0xD7FF));
-c32(char16_t(0xD800)); // expected-warning {{implicit conversion from 
'char16_t' to 'char32_t' changes the meaning of the code unit '<0xD800>'}}
-c32(char16_t(0xDFFF)); // expected-warning {{implicit conversion from 
'char16_t' to 'char32_t' changes the meaning of the code unit '<0xDFFF>'}}
+c32(char16_t(0xD800));
+c32(char16_t(0xDFFF));
 c32(char16_t(0xE000));
 c32(char16_t(u'☕'));
 



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


[llvm-branch-commits] [clang] [Clang] Do not warn on UTF-16 -> UTF-32 conversions. (#163927) (PR #164654)

2025-10-27 Thread Cullen Rhodes via llvm-branch-commits

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


[llvm-branch-commits] [clang] [Clang] Do not warn on UTF-16 -> UTF-32 conversions. (#163927) (PR #164654)

2025-10-27 Thread Cullen Rhodes via llvm-branch-commits

https://github.com/c-rhodes updated 
https://github.com/llvm/llvm-project/pull/164654

>From 5c802f9eac663ceb59d2fa68c1afa6bdd2aac680 Mon Sep 17 00:00:00 2001
From: Corentin Jabot 
Date: Sun, 19 Oct 2025 09:26:22 +0200
Subject: [PATCH] [Clang] Do not warn on UTF-16 -> UTF-32 conversions.
 (#163927)

UTF-16 to UTF-16 conversions seems widespread,
and lone surrogate have a distinct representation in UTF-32.

Lets not warn on this case to make the warning easier to adopt. This
follows SG-16 guideline


https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3695r2.html#changes-since-r1

Fixes #163719
---
 clang/lib/Sema/SemaChecking.cpp  | 9 -
 clang/test/SemaCXX/warn-implicit-unicode-conversions.cpp | 8 
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index dd5b710d7e1d4..41bcf8fd493fc 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -12014,13 +12014,20 @@ static void 
DiagnoseMixedUnicodeImplicitConversion(Sema &S, const Type *Source,
SourceLocation CC) {
   assert(Source->isUnicodeCharacterType() && Target->isUnicodeCharacterType() 
&&
  Source != Target);
+
+  // Lone surrogates have a distinct representation in UTF-32.
+  // Converting between UTF-16 and UTF-32 codepoints seems very widespread,
+  // so don't warn on such conversion.
+  if (Source->isChar16Type() && Target->isChar32Type())
+return;
+
   Expr::EvalResult Result;
   if (E->EvaluateAsInt(Result, S.getASTContext(), Expr::SE_AllowSideEffects,
S.isConstantEvaluatedContext())) {
 llvm::APSInt Value(32);
 Value = Result.Val.getInt();
 bool IsASCII = Value <= 0x7F;
-bool IsBMP = Value <= 0xD7FF || (Value >= 0xE000 && Value <= 0x);
+bool IsBMP = Value <= 0xDFFF || (Value >= 0xE000 && Value <= 0x);
 bool ConversionPreservesSemantics =
 IsASCII || (!Source->isChar8Type() && !Target->isChar8Type() && IsBMP);
 
diff --git a/clang/test/SemaCXX/warn-implicit-unicode-conversions.cpp 
b/clang/test/SemaCXX/warn-implicit-unicode-conversions.cpp
index fcff006d0e028..f17f20ca25295 100644
--- a/clang/test/SemaCXX/warn-implicit-unicode-conversions.cpp
+++ b/clang/test/SemaCXX/warn-implicit-unicode-conversions.cpp
@@ -14,7 +14,7 @@ void test(char8_t u8, char16_t u16, char32_t u32) {
 c16(u32); // expected-warning {{implicit conversion from 'char32_t' to 
'char16_t' may lose precision and change the meaning of the represented code 
unit}}
 
 c32(u8);  // expected-warning {{implicit conversion from 'char8_t' to 
'char32_t' may change the meaning of the represented code unit}}
-c32(u16); // expected-warning {{implicit conversion from 'char16_t' to 
'char32_t' may change the meaning of the represented code unit}}
+c32(u16);
 c32(u32);
 
 
@@ -30,7 +30,7 @@ void test(char8_t u8, char16_t u16, char32_t u32) {
 c16(char32_t(0x7f));
 c16(char32_t(0x80));
 c16(char32_t(0xD7FF));
-c16(char32_t(0xD800)); // expected-warning {{implicit conversion from 
'char32_t' to 'char16_t' changes the meaning of the code unit '<0xD800>'}}
+c16(char32_t(0xD800));
 c16(char32_t(0xE000));
 c16(char32_t(U'🐉')); // expected-warning {{implicit conversion from 
'char32_t' to 'char16_t' changes the meaning of the code point '🐉'}}
 
@@ -44,8 +44,8 @@ void test(char8_t u8, char16_t u16, char32_t u32) {
 c32(char16_t(0x80));
 
 c32(char16_t(0xD7FF));
-c32(char16_t(0xD800)); // expected-warning {{implicit conversion from 
'char16_t' to 'char32_t' changes the meaning of the code unit '<0xD800>'}}
-c32(char16_t(0xDFFF)); // expected-warning {{implicit conversion from 
'char16_t' to 'char32_t' changes the meaning of the code unit '<0xDFFF>'}}
+c32(char16_t(0xD800));
+c32(char16_t(0xDFFF));
 c32(char16_t(0xE000));
 c32(char16_t(u'☕'));
 

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


[llvm-branch-commits] [llvm] [BOLT][PAC] Warn about synchronous unwind tables (PR #165227)

2025-10-27 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-bolt

Author: Gergely Bálint (bgergely0)


Changes

BOLT currently ignores functions with synchronous PAuth DWARF info.
When more than 10% of functions get ignored for inconsistencies, we
should emit a warning to only use asynchronous unwind tables.

See also: #165215

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


2 Files Affected:

- (modified) bolt/lib/Passes/PointerAuthCFIAnalyzer.cpp (+7-1) 
- (added) bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp (+32) 


``diff
diff --git a/bolt/lib/Passes/PointerAuthCFIAnalyzer.cpp 
b/bolt/lib/Passes/PointerAuthCFIAnalyzer.cpp
index 2fc5a2fda086a..6bcb5a6bd1801 100644
--- a/bolt/lib/Passes/PointerAuthCFIAnalyzer.cpp
+++ b/bolt/lib/Passes/PointerAuthCFIAnalyzer.cpp
@@ -130,11 +130,17 @@ Error 
PointerAuthCFIAnalyzer::runOnFunctions(BinaryContext &BC) {
   ParallelUtilities::runOnEachFunction(
   BC, ParallelUtilities::SchedulingPolicy::SP_INST_LINEAR, WorkFun,
   SkipPredicate, "PointerAuthCFIAnalyzer");
+
+  float IgnoredPercent = (100.0 * FunctionsIgnored) / Total;
   BC.outs() << "BOLT-INFO: PointerAuthCFIAnalyzer ran on " << Total
 << " functions. Ignored " << FunctionsIgnored << " functions "
-<< format("(%.2lf%%)", (100.0 * FunctionsIgnored) / Total)
+<< format("(%.2lf%%)", IgnoredPercent)
 << " because of CFI inconsistencies\n";
 
+  if (IgnoredPercent >= 10.0)
+BC.outs() << "BOLT-WARNING: PointerAuthCFIAnalyzer only supports "
+ "asynchronous unwind tables.\n";
+
   return Error::success();
 }
 
diff --git a/bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp 
b/bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp
new file mode 100644
index 0..e90882833323d
--- /dev/null
+++ b/bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp
@@ -0,0 +1,32 @@
+// Test to demonstrate that functions compiled with synchronous unwind tables
+// are ignored by the PointerAuthCFIAnalyzer.
+// Exception handling is needed to have _any_ unwind tables, otherwise the
+// PointerAuthCFIAnalyzer does not run on these functions, so it does not 
ignore
+// any function.
+//
+// REQUIRES: system-linux,bolt-runtime
+//
+// RUN: %clangxx --target=aarch64-unknown-linux-gnu \
+// RUN: -mbranch-protection=pac-ret \
+// RUN: -fno-asynchronous-unwind-tables \
+// RUN: %s -o %t.exe -Wl,-q
+// RUN: llvm-bolt %t.exe -o %t.bolt | FileCheck %s --check-prefix=CHECK
+//
+// CHECK: PointerAuthCFIAnalyzer ran on 3 functions. Ignored
+// CHECK-NOT: 0 functions (0.00%) because of CFI inconsistencies
+// CHECK-SAME: 1 functions (33.33%) because of CFI inconsistencies
+// CHECK-NEXT: PointerAuthCFIAnalyzer only supports asynchronous unwind tables
+
+#include 
+#include 
+
+void foo() { throw std::runtime_error("Exception from foo()."); }
+
+int main() {
+  try {
+foo();
+  } catch (const std::exception &e) {
+printf("Exception caught: %s\n", e.what());
+  }
+  return 0;
+}

``




https://github.com/llvm/llvm-project/pull/165227
___
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: [Github] Only look at previous commit for MacOS Premerge (#164483) (PR #164497)

2025-10-27 Thread Cullen Rhodes via llvm-branch-commits

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


[llvm-branch-commits] [llvm] [AMDGPU] Record old VGPR MSBs in the high bits of s_set_vgpr_msb (PR #165035)

2025-10-27 Thread Jay Foad via llvm-branch-commits

jayfoad wrote:

Can you say anything at all about _why_ this is done?

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


[llvm-branch-commits] [RFC][Clang] Allow plugins to hook into back-end (PR #165257)

2025-10-27 Thread Vassil Vassilev via llvm-branch-commits

vgvassilev wrote:

> > do you use a plugin to swap clang's CodeGen
> 
> We swap LLVM's CodeGen (the machine code generation part), but want to keep 
> Clang's CodeGen (the part that generates LLVM IR and optimizes that). We want 
> the front-end and middle-end optimizations to behave as usual and only 
> replace the back-end with our own back-end.
> 
> > why the standard plugin system does not work well there?
> 
> The standard front-end plugins permit replacing, e.g., the CodeGenAction with 
> something else. But we do want Clang's CodeGen to work normally. 
> CodeGenAction and emitBackendOutput are very inflexible; adding a custom 
> back-end through a PluginASTAction would essentially require us to copy large 
> parts of CodeGenAction.cpp and BackendUtil.cpp, which is not maintainable.

Would it make more sense to make the CodeGenAction and emitBackendOutput more 
flexible? Maybe checking if the `BackendAction` kind is plugin we can give back 
the control to the frontend plugin code...

It would be great to enhance the existing clang plugin system rather than 
adding a new plugin extension point.

cc: @lhames.



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


[llvm-branch-commits] [RFC][Clang] Allow plugins to hook into back-end (PR #165257)

2025-10-27 Thread Vassil Vassilev via llvm-branch-commits

vgvassilev wrote:

> PluginASTAction would essentially require us to copy large parts of 
> CodeGenAction.cpp

Do you mean that you will need to wrap clang's `BackendConsumer` into a 
`MultiplexConsumer` and overwrite its `HandleTranslationUnit` swapping 
`BackendConsumer::HandleTranslationUnit`'s `emitBackendOutput`?

https://github.com/llvm/llvm-project/pull/165257
___
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: [Github] Only look at previous commit for MacOS Premerge (#164483) (PR #164497)

2025-10-27 Thread Cullen Rhodes via llvm-branch-commits

https://github.com/c-rhodes updated 
https://github.com/llvm/llvm-project/pull/164497

>From 1600cf0405844880def09cef3290f77d76a8e64b Mon Sep 17 00:00:00 2001
From: Aiden Grossman 
Date: Tue, 21 Oct 2025 14:04:03 -0700
Subject: [PATCH] [Github] Only look at previous commit for MacOS Premerge
 (#164483)

Otherwise we're looking for a commit that does not exist given the fetch
depth.

Fixes #164430.

(cherry picked from commit 288ef04d2f19c5b0e4ce3cae450c63a365ab11e9)
---
 .github/workflows/premerge.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml
index d0518fa6879e2..8594e1e91ee99 100644
--- a/.github/workflows/premerge.yaml
+++ b/.github/workflows/premerge.yaml
@@ -149,7 +149,7 @@ jobs:
 uses: llvm/actions/install-ninja@main
   - name: Build and Test
 run: |
-  source <(git diff --name-only HEAD~2..HEAD | python3 
.ci/compute_projects.py)
+  source <(git diff --name-only HEAD~1...HEAD | python3 
.ci/compute_projects.py)
 
   if [[ "${projects_to_build}" == "" ]]; then
 echo "No projects to build"

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


[llvm-branch-commits] [llvm] [BOLT][PAC] Warn about synchronous unwind tables (PR #165227)

2025-10-27 Thread Gergely Bálint via llvm-branch-commits

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


[llvm-branch-commits] [llvm] [BOLT][PAC] Warn about synchronous unwind tables (PR #165227)

2025-10-27 Thread Gergely Bálint via llvm-branch-commits

bgergely0 wrote:

> [!WARNING]
> This pull request is not mergeable via GitHub because a downstack PR is 
> open. Once all requirements are satisfied, merge this PR as a stack  href="https://app.graphite.dev/github/pr/llvm/llvm-project/165227?utm_source=stack-comment-downstack-mergeability-warning";
>  >on Graphite.
> https://graphite.dev/docs/merge-pull-requests";>Learn more

* **#165227** https://app.graphite.dev/github/pr/llvm/llvm-project/165227?utm_source=stack-comment-icon";
 target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" 
width="10px" height="10px"/> 👈 https://app.graphite.dev/github/pr/llvm/llvm-project/165227?utm_source=stack-comment-view-in-graphite";
 target="_blank">(View in Graphite)
* **#164622** https://app.graphite.dev/github/pr/llvm/llvm-project/164622?utm_source=stack-comment-icon";
 target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" 
width="10px" height="10px"/>
* **#163381** https://app.graphite.dev/github/pr/llvm/llvm-project/163381?utm_source=stack-comment-icon";
 target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" 
width="10px" height="10px"/>
* **#162820** https://app.graphite.dev/github/pr/llvm/llvm-project/162820?utm_source=stack-comment-icon";
 target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" 
width="10px" height="10px"/>
* `main`




This stack of pull requests is managed by https://graphite.dev?utm-source=stack-comment";>Graphite. Learn 
more about https://stacking.dev/?utm_source=stack-comment";>stacking.


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


[llvm-branch-commits] [llvm] [BOLT][PAC] Warn about synchronous unwind tables (PR #165227)

2025-10-27 Thread Gergely Bálint via llvm-branch-commits

https://github.com/bgergely0 created 
https://github.com/llvm/llvm-project/pull/165227

BOLT currently ignores functions with synchronous PAuth DWARF info.
When more than 10% of functions get ignored for inconsistencies, we
should emit a warning to only use asynchronous unwind tables.

See also: #165215

From 43b2e4cee68b4edb707c019e6db139f189651916 Mon Sep 17 00:00:00 2001
From: Gergely Balint 
Date: Mon, 27 Oct 2025 09:29:54 +
Subject: [PATCH] [BOLT][PAC] Warn about synchronous unwind tables

BOLT currently ignores functions with synchronous PAuth DWARF info.
When more than 10% of functions get ignored for inconsistencies, we
should emit a warning to only use asynchronous unwind tables.

See also: #165215
---
 bolt/lib/Passes/PointerAuthCFIAnalyzer.cpp|  8 -
 .../AArch64/pacret-synchronous-unwind.cpp | 32 +++
 2 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp

diff --git a/bolt/lib/Passes/PointerAuthCFIAnalyzer.cpp 
b/bolt/lib/Passes/PointerAuthCFIAnalyzer.cpp
index 2fc5a2fda086a..6bcb5a6bd1801 100644
--- a/bolt/lib/Passes/PointerAuthCFIAnalyzer.cpp
+++ b/bolt/lib/Passes/PointerAuthCFIAnalyzer.cpp
@@ -130,11 +130,17 @@ Error 
PointerAuthCFIAnalyzer::runOnFunctions(BinaryContext &BC) {
   ParallelUtilities::runOnEachFunction(
   BC, ParallelUtilities::SchedulingPolicy::SP_INST_LINEAR, WorkFun,
   SkipPredicate, "PointerAuthCFIAnalyzer");
+
+  float IgnoredPercent = (100.0 * FunctionsIgnored) / Total;
   BC.outs() << "BOLT-INFO: PointerAuthCFIAnalyzer ran on " << Total
 << " functions. Ignored " << FunctionsIgnored << " functions "
-<< format("(%.2lf%%)", (100.0 * FunctionsIgnored) / Total)
+<< format("(%.2lf%%)", IgnoredPercent)
 << " because of CFI inconsistencies\n";
 
+  if (IgnoredPercent >= 10.0)
+BC.outs() << "BOLT-WARNING: PointerAuthCFIAnalyzer only supports "
+ "asynchronous unwind tables.\n";
+
   return Error::success();
 }
 
diff --git a/bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp 
b/bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp
new file mode 100644
index 0..e90882833323d
--- /dev/null
+++ b/bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp
@@ -0,0 +1,32 @@
+// Test to demonstrate that functions compiled with synchronous unwind tables
+// are ignored by the PointerAuthCFIAnalyzer.
+// Exception handling is needed to have _any_ unwind tables, otherwise the
+// PointerAuthCFIAnalyzer does not run on these functions, so it does not 
ignore
+// any function.
+//
+// REQUIRES: system-linux,bolt-runtime
+//
+// RUN: %clangxx --target=aarch64-unknown-linux-gnu \
+// RUN: -mbranch-protection=pac-ret \
+// RUN: -fno-asynchronous-unwind-tables \
+// RUN: %s -o %t.exe -Wl,-q
+// RUN: llvm-bolt %t.exe -o %t.bolt | FileCheck %s --check-prefix=CHECK
+//
+// CHECK: PointerAuthCFIAnalyzer ran on 3 functions. Ignored
+// CHECK-NOT: 0 functions (0.00%) because of CFI inconsistencies
+// CHECK-SAME: 1 functions (33.33%) because of CFI inconsistencies
+// CHECK-NEXT: PointerAuthCFIAnalyzer only supports asynchronous unwind tables
+
+#include 
+#include 
+
+void foo() { throw std::runtime_error("Exception from foo()."); }
+
+int main() {
+  try {
+foo();
+  } catch (const std::exception &e) {
+printf("Exception caught: %s\n", e.what());
+  }
+  return 0;
+}

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


[llvm-branch-commits] [clang] 04102d9 - [AArch64][llvm] Relax mandatory features for Armv9.6-A (#163973)

2025-10-27 Thread Cullen Rhodes via llvm-branch-commits

Author: Jonathan Thackray
Date: 2025-10-27T11:04:01Z
New Revision: 04102d998d0e4019c26654cf0b545a0af19819c7

URL: 
https://github.com/llvm/llvm-project/commit/04102d998d0e4019c26654cf0b545a0af19819c7
DIFF: 
https://github.com/llvm/llvm-project/commit/04102d998d0e4019c26654cf0b545a0af19819c7.diff

LOG: [AArch64][llvm] Relax mandatory features for Armv9.6-A (#163973)

`FEAT_FPRCVT` is removed from being mandatory in Armv9.6-A
`FEAT_SVE2p2` is removed from being mandatory in Armv9.6-A

(cherry picked from commit 0e8781100357b46c9ec6cd2e31a635ad2b2b3211)

Added: 


Modified: 
clang/test/Driver/aarch64-v96a.c
llvm/lib/Target/AArch64/AArch64Features.td

Removed: 




diff  --git a/clang/test/Driver/aarch64-v96a.c 
b/clang/test/Driver/aarch64-v96a.c
index de7890140ebd3..e0081bbbdabfe 100644
--- a/clang/test/Driver/aarch64-v96a.c
+++ b/clang/test/Driver/aarch64-v96a.c
@@ -6,7 +6,7 @@
 // RUN: %clang -target aarch64 -mlittle-endian -march=armv9.6-a -### -c %s 
2>&1 | FileCheck -check-prefix=GENERICV96A %s
 // RUN: %clang -target aarch64_be -mlittle-endian -march=armv9.6a -### -c %s 
2>&1 | FileCheck -check-prefix=GENERICV96A %s
 // RUN: %clang -target aarch64_be -mlittle-endian -march=armv9.6-a -### -c %s 
2>&1 | FileCheck -check-prefix=GENERICV96A %s
-// GENERICV96A: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" 
"-target-feature" "+v9.6a"{{.*}} "-target-feature" "+cmpbr"{{.*}} 
"-target-feature" "+fprcvt"{{.*}} "-target-feature" "+sve2p2"
+// GENERICV96A: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" 
"-target-feature" "+v9.6a"{{.*}} "-target-feature" "+cmpbr"{{.*}}
 
 // RUN: %clang -target aarch64_be -march=armv9.6a -### -c %s 2>&1 | FileCheck 
-check-prefix=GENERICV96A-BE %s
 // RUN: %clang -target aarch64_be -march=armv9.6-a -### -c %s 2>&1 | FileCheck 
-check-prefix=GENERICV96A-BE %s
@@ -14,7 +14,7 @@
 // RUN: %clang -target aarch64 -mbig-endian -march=armv9.6-a -### -c %s 2>&1 | 
FileCheck -check-prefix=GENERICV96A-BE %s
 // RUN: %clang -target aarch64_be -mbig-endian -march=armv9.6a -### -c %s 2>&1 
| FileCheck -check-prefix=GENERICV96A-BE %s
 // RUN: %clang -target aarch64_be -mbig-endian -march=armv9.6-a -### -c %s 
2>&1 | FileCheck -check-prefix=GENERICV96A-BE %s
-// GENERICV96A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" 
"generic" "-target-feature" "+v9.6a"{{.*}} "-target-feature" "+cmpbr"{{.*}} 
"-target-feature" "+fprcvt"{{.*}} "-target-feature" "+sve2p2"
+// GENERICV96A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" 
"generic" "-target-feature" "+v9.6a"{{.*}} "-target-feature" "+cmpbr"{{.*}}
 
 // = Features supported on aarch64 =
 

diff  --git a/llvm/lib/Target/AArch64/AArch64Features.td 
b/llvm/lib/Target/AArch64/AArch64Features.td
index 9973df865ea17..12159a9519737 100644
--- a/llvm/lib/Target/AArch64/AArch64Features.td
+++ b/llvm/lib/Target/AArch64/AArch64Features.td
@@ -923,8 +923,8 @@ def HasV9_5aOps : Architecture64<9, 5, "a", "v9.5a",
   [HasV9_4aOps, FeatureCPA],
   !listconcat(HasV9_4aOps.DefaultExts, [FeatureCPA,  FeatureLUT, 
FeatureFAMINMAX])>;
 def HasV9_6aOps : Architecture64<9, 6, "a", "v9.6a",
-  [HasV9_5aOps, FeatureCMPBR, FeatureFPRCVT, FeatureSVE2p2, FeatureLSUI, 
FeatureOCCMO],
-  !listconcat(HasV9_5aOps.DefaultExts, [FeatureCMPBR, FeatureFPRCVT, 
FeatureSVE2p2,
+  [HasV9_5aOps, FeatureCMPBR, FeatureLSUI, FeatureOCCMO],
+  !listconcat(HasV9_5aOps.DefaultExts, [FeatureCMPBR,
 FeatureLSUI, FeatureOCCMO])>;
 def HasV8_0rOps : Architecture64<8, 0, "r", "v8r",
   [ //v8.1



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


[llvm-branch-commits] [clang] [llvm] [AArch64][llvm] Relax mandatory features for Armv9.6-A (PR #164950)

2025-10-27 Thread Cullen Rhodes via llvm-branch-commits

https://github.com/c-rhodes closed 
https://github.com/llvm/llvm-project/pull/164950
___
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: workflows/release-documentation: Allow secrets pass through from calling workflow (#162765) (PR #164538)

2025-10-27 Thread via llvm-branch-commits

github-actions[bot] wrote:

@tstellar (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/164538
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [RFC][Clang] Allow plugins to hook into back-end (PR #165257)

2025-10-27 Thread Alexis Engelke via llvm-branch-commits

aengelke wrote:

> Would it make more sense to make the CodeGenAction and emitBackendOutput more 
> flexible?

Maybe? emitBackendOutput (EmitAssemblyHelper) could call back into some new 
virtual method in BackendConsumer. This would leave the problem of inserting a 
new different (subclass of) BackendConsumer. But as a PluginASTAction cannot be 
a CodeGenAction, I would assume that at the very least the plugin action has to 
wrap all the virtual methods that CodeGenAction uses? This doesn't seem to be 
particularly viable, especially as some of the methods are protected. 
Duplicating CodeGenAction methods is also not a good option.

> It would be great to enhance the existing clang plugin system rather than 
> adding a new plugin extension point.

I generally agree, but... I spent a few days trying to come up with a 
PluginASTAction that achieves something similar... and gave up (=> this patch). 
(I've not much experience with Clang plugins, but the code is rather 
complicated and sparsely documented, which doesn't help, either.)

> Do you mean that you will need to wrap clang's `BackendConsumer` into a 
> `MultiplexConsumer` and overwrite its `HandleTranslationUnit` swapping 
> `BackendConsumer::HandleTranslationUnit`'s `emitBackendOutput`?

Ideally, I don't want to swap emitBackendOutput, because I don't want to 
duplicate that logic...

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


[llvm-branch-commits] [libcxx] Add Testing Configuration for LLVM libc (PR #165120)

2025-10-27 Thread Nikolas Klauser via llvm-branch-commits

philnik777 wrote:

> This still needs some work. Then there is still quite a bit of functionality 
> needed in libc to get the tests passing for `check-cxx` (`check-cxxabi` 
> already works). But once this is ready, I think landing it would probably 
> make sense so there is a central configuration for people to hack on to get 
> things working.

Do you know roughly how many tests are affected? If it's not too many maybe we 
should simply XFAIL them for LLVM libc and update them as new features get 
implemented?

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


[llvm-branch-commits] [libcxx] 4635eba - Revert "[libcxx] Define `_LIBCPP_HAS_C8RTOMB_MBRTOC8` to true if compiling wi…"

2025-10-27 Thread via llvm-branch-commits

Author: Nikolas Klauser
Date: 2025-10-27T16:50:59+01:00
New Revision: 4635eba5d95e528477c3793fda55c91af0423457

URL: 
https://github.com/llvm/llvm-project/commit/4635eba5d95e528477c3793fda55c91af0423457
DIFF: 
https://github.com/llvm/llvm-project/commit/4635eba5d95e528477c3793fda55c91af0423457.diff

LOG: Revert "[libcxx] Define `_LIBCPP_HAS_C8RTOMB_MBRTOC8` to true if compiling 
wi…"

This reverts commit d522b1b3000f99337fd97059fae441476b000960.

Added: 
libcxx/test/std/strings/c.strings/no_c8rtomb_mbrtoc8.verify.cpp

Modified: 
libcxx/include/__config
libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp
libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp
libcxx/utils/libcxx/test/features.py

Removed: 
libcxx/test/std/depr/depr.c.headers/uchar_h_char8_t.compile.pass.cpp
libcxx/test/std/strings/c.strings/cuchar_char8_t.compile.pass.cpp



diff  --git a/libcxx/include/__config b/libcxx/include/__config
index 5971a3c5407b9..b4c081dcdff1b 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -1021,9 +1021,7 @@ typedef __char32_t char32_t;
 // the latter depends on internal GNU libc details that are not appropriate
 // to depend on here, so any declarations present when __cpp_char8_t is not
 // defined are ignored.
-#  if defined(__clang__)
-#define _LIBCPP_HAS_C8RTOMB_MBRTOC8 1
-#  elif defined(_LIBCPP_GLIBC_PREREQ)
+#  if defined(_LIBCPP_GLIBC_PREREQ)
 #if _LIBCPP_GLIBC_PREREQ(2, 36) && defined(__cpp_char8_t)
 #  define _LIBCPP_HAS_C8RTOMB_MBRTOC8 1
 #else

diff  --git a/libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp 
b/libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp
index c448ba83f4b38..a1560c8ee5853 100644
--- a/libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp
@@ -23,6 +23,11 @@
 // __STDC_UTF_16__ may or may not be defined by the C standard library
 // __STDC_UTF_32__ may or may not be defined by the C standard library
 
+#if !defined(TEST_HAS_NO_C8RTOMB_MBRTOC8)
+ASSERT_SAME_TYPE(size_t, decltype(mbrtoc8((char8_t*)0, (const char*)0, 
(size_t)0, (mbstate_t*)0)));
+ASSERT_SAME_TYPE(size_t, decltype(c8rtomb((char*)0, (char8_t)0, 
(mbstate_t*)0)));
+#endif
+
 ASSERT_SAME_TYPE(size_t, decltype(mbrtoc16((char16_t*)0, (const char*)0, 
(size_t)0, (mbstate_t*)0)));
 ASSERT_SAME_TYPE(size_t, decltype(c16rtomb((char*)0, (char16_t)0, 
(mbstate_t*)0)));
 

diff  --git 
a/libcxx/test/std/depr/depr.c.headers/uchar_h_char8_t.compile.pass.cpp 
b/libcxx/test/std/depr/depr.c.headers/uchar_h_char8_t.compile.pass.cpp
deleted file mode 100644
index 34b512f9c5959..0
--- a/libcxx/test/std/depr/depr.c.headers/uchar_h_char8_t.compile.pass.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===--===//
-//
-// 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
-//
-//===--===//
-
-// UNSUPPORTED: c++03
-
-// The following platforms do not provide mbrtoc8 and c8rtomb so the tests fail
-// XFAIL: target={{.+}}-aix{{.*}}
-// XFAIL: android
-// XFAIL: darwin
-// XFAIL: freebsd
-// XFAIL: windows
-// XFAIL: glibc-no-char8_t-support
-// XFAIL: LIBCXX-PICOLIBC-FIXME
-
-// 
-
-#include 
-
-ASSERT_SAME_TYPE(size_t, decltype(mbrtoc8((char8_t*)0, (const char*)0, 
(size_t)0, (mbstate_t*)0)));
-ASSERT_SAME_TYPE(size_t, decltype(c8rtomb((char*)0, (char8_t)0, 
(mbstate_t*)0)));

diff  --git a/libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp 
b/libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp
index 96b394a9934f8..2076384deb2b2 100644
--- a/libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp
+++ b/libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp
@@ -23,6 +23,11 @@
 // __STDC_UTF_16__ may or may not be defined by the C standard library
 // __STDC_UTF_32__ may or may not be defined by the C standard library
 
+#if !defined(TEST_HAS_NO_C8RTOMB_MBRTOC8)
+ASSERT_SAME_TYPE(std::size_t, decltype(std::mbrtoc8((char8_t*)0, (const 
char*)0, (size_t)0, (mbstate_t*)0)));
+ASSERT_SAME_TYPE(std::size_t, decltype(std::c8rtomb((char*)0, (char8_t)0, 
(mbstate_t*)0)));
+#endif
+
 ASSERT_SAME_TYPE(std::size_t, decltype(std::mbrtoc16((char16_t*)0, (const 
char*)0, (size_t)0, (mbstate_t*)0)));
 ASSERT_SAME_TYPE(std::size_t, decltype(std::c16rtomb((char*)0, (char16_t)0, 
(mbstate_t*)0)));
 

diff  --git a/libcxx/test/std/strings/c.strings/cuchar_char8_t.compile.pass.cpp 
b/libcxx/test/std/strings/c.strings/cuchar_char8_t.compile.pass.cpp
deleted file mode 100644
index 019265b534c5c..0
--- a/libcxx/test/std/strings/c.strings/cuchar_char8_t.compile.pass.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===

[llvm-branch-commits] [llvm] release/21.x: [X86] Use pseudo instructions to zero registers in `buildClearRegister` (#163358) (PR #164076)

2025-10-27 Thread Cullen Rhodes via llvm-branch-commits

https://github.com/c-rhodes updated 
https://github.com/llvm/llvm-project/pull/164076

>From 2cdfa9d9383c165f68a41a145c21d7f523485a8d Mon Sep 17 00:00:00 2001
From: Abhishek Kaushik 
Date: Sat, 18 Oct 2025 02:30:18 +0530
Subject: [PATCH] [X86] Use pseudo instructions to zero registers in
 `buildClearRegister` (#163358)

In `buildClearRegister` use the correct pseudo-opcode for each register
class:

- For `VR128`, use `V_SET0`
- For `VR256`, use `AVX_SET0`
- For `VR512`, use `AVX512_512_SET0`
- For `VK*`, use `KSET0Q/KSET0W`

This avoids illegal register/opcode pairings and machine verifier errors
when clearing call-used registers under `-fzero-call-used-regs=used`.

Fixes: #163053

-

Co-authored-by: Simon Pilgrim 
(cherry picked from commit 228dae786b94bb85fb34bc157a43ca6c16932b6d)
---
 llvm/lib/Target/X86/X86InstrInfo.cpp  |  22 +-
 .../CodeGen/X86/zero-call-used-regs-simd.ll   | 216 ++
 2 files changed, 221 insertions(+), 17 deletions(-)
 create mode 100644 llvm/test/CodeGen/X86/zero-call-used-regs-simd.ll

diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp 
b/llvm/lib/Target/X86/X86InstrInfo.cpp
index abf365eedec39..9bf58dd3458cd 100644
--- a/llvm/lib/Target/X86/X86InstrInfo.cpp
+++ b/llvm/lib/Target/X86/X86InstrInfo.cpp
@@ -10739,39 +10739,27 @@ void X86InstrInfo::buildClearRegister(Register Reg, 
MachineBasicBlock &MBB,
 if (!ST.hasSSE1())
   return;
 
-// PXOR is safe to use because it doesn't affect flags.
-BuildMI(MBB, Iter, DL, get(X86::PXORrr), Reg)
-.addReg(Reg, RegState::Undef)
-.addReg(Reg, RegState::Undef);
+BuildMI(MBB, Iter, DL, get(X86::V_SET0), Reg);
   } else if (X86::VR256RegClass.contains(Reg)) {
 // YMM#
 if (!ST.hasAVX())
   return;
 
-// VPXOR is safe to use because it doesn't affect flags.
-BuildMI(MBB, Iter, DL, get(X86::VPXORrr), Reg)
-.addReg(Reg, RegState::Undef)
-.addReg(Reg, RegState::Undef);
+BuildMI(MBB, Iter, DL, get(X86::AVX_SET0), Reg);
   } else if (X86::VR512RegClass.contains(Reg)) {
 // ZMM#
 if (!ST.hasAVX512())
   return;
 
-// VPXORY is safe to use because it doesn't affect flags.
-BuildMI(MBB, Iter, DL, get(X86::VPXORYrr), Reg)
-.addReg(Reg, RegState::Undef)
-.addReg(Reg, RegState::Undef);
+BuildMI(MBB, Iter, DL, get(X86::AVX512_512_SET0), Reg);
   } else if (X86::VK1RegClass.contains(Reg) || X86::VK2RegClass.contains(Reg) 
||
  X86::VK4RegClass.contains(Reg) || X86::VK8RegClass.contains(Reg) 
||
  X86::VK16RegClass.contains(Reg)) {
 if (!ST.hasVLX())
   return;
 
-// KXOR is safe to use because it doesn't affect flags.
-unsigned Op = ST.hasBWI() ? X86::KXORQkk : X86::KXORWkk;
-BuildMI(MBB, Iter, DL, get(Op), Reg)
-.addReg(Reg, RegState::Undef)
-.addReg(Reg, RegState::Undef);
+unsigned Op = ST.hasBWI() ? X86::KSET0Q : X86::KSET0W;
+BuildMI(MBB, Iter, DL, get(Op), Reg);
   }
 }
 
diff --git a/llvm/test/CodeGen/X86/zero-call-used-regs-simd.ll 
b/llvm/test/CodeGen/X86/zero-call-used-regs-simd.ll
new file mode 100644
index 0..d9253e0ca127b
--- /dev/null
+++ b/llvm/test/CodeGen/X86/zero-call-used-regs-simd.ll
@@ -0,0 +1,216 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 
UTC_ARGS: --version 6
+; RUN: llc < %s -mtriple=x86_64-- -mattr=+sse2
-verify-machineinstrs | FileCheck %s --check-prefixes=SSE
+; RUN: llc < %s -mtriple=x86_64-- -mattr=+avx 
-verify-machineinstrs | FileCheck %s --check-prefixes=AVX,AVX1
+; RUN: llc < %s -mtriple=x86_64-- -mattr=+avx2
-verify-machineinstrs | FileCheck %s --check-prefixes=AVX,AVX2
+; RUN: llc < %s -mtriple=x86_64-- -mattr=+avx512f,+avx512vl   
-verify-machineinstrs | FileCheck %s --check-prefixes=AVX512,AVX512VL
+; RUN: llc < %s -mtriple=x86_64-- -mattr=+avx512f,+avx512vl,+avx512bw 
-verify-machineinstrs | FileCheck %s --check-prefixes=AVX512,AVX512BW
+
+define void @zero_xmm(<4 x i32> %arg) #0 {
+; SSE-LABEL: zero_xmm:
+; SSE:   # %bb.0:
+; SSE-NEXT:movaps %xmm0, 0
+; SSE-NEXT:xorps %xmm0, %xmm0
+; SSE-NEXT:retq
+;
+; AVX-LABEL: zero_xmm:
+; AVX:   # %bb.0:
+; AVX-NEXT:vmovaps %xmm0, 0
+; AVX-NEXT:vxorps %xmm0, %xmm0, %xmm0
+; AVX-NEXT:retq
+;
+; AVX512-LABEL: zero_xmm:
+; AVX512:   # %bb.0:
+; AVX512-NEXT:vmovaps %xmm0, 0
+; AVX512-NEXT:vxorps %xmm0, %xmm0, %xmm0
+; AVX512-NEXT:retq
+  store <4 x i32> %arg, ptr null, align 32
+  ret void
+}
+
+define void @zero_ymm(<8 x i32> %arg) #0 {
+; SSE-LABEL: zero_ymm:
+; SSE:   # %bb.0:
+; SSE-NEXT:movaps %xmm1, 16
+; SSE-NEXT:movaps %xmm0, 0
+; SSE-NEXT:xorps %xmm0, %xmm0
+; SSE-NEXT:xorps %xmm1, %xmm1
+; SSE-NEXT:retq
+;
+; AVX-LABEL: zero_ymm:
+; AVX:   # %bb.0:
+; AVX-NEXT:vmovaps %ymm0, 0
+; AVX-NEXT:vxorps %xmm0, %xmm0, %xmm0
+; AVX-NEXT:vzeroupper
+; AVX-NEXT:  

[llvm-branch-commits] [llvm] release/21.x: [X86] Use pseudo instructions to zero registers in `buildClearRegister` (#163358) (PR #164076)

2025-10-27 Thread Cullen Rhodes via llvm-branch-commits

https://github.com/c-rhodes closed 
https://github.com/llvm/llvm-project/pull/164076
___
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: workflows/release-documentation: Allow secrets pass through from calling workflow (#162765) (PR #164538)

2025-10-27 Thread Cullen Rhodes via llvm-branch-commits

https://github.com/c-rhodes closed 
https://github.com/llvm/llvm-project/pull/164538
___
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: [Github] Only look at previous commit for MacOS Premerge (#164483) (PR #164497)

2025-10-27 Thread via llvm-branch-commits

github-actions[bot] wrote:

@boomanaiden154 (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/164497
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [NSan] Make Tests work with Internal Shell (PR #165142)

2025-10-27 Thread Florian Mayer via llvm-branch-commits

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


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


[llvm-branch-commits] [ASan] Make tests work with internal shell (PR #165141)

2025-10-27 Thread Florian Mayer via llvm-branch-commits

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


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


[llvm-branch-commits] [XRay] Make Test Work with Internal Shell (PR #165143)

2025-10-27 Thread Florian Mayer via llvm-branch-commits

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


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


[llvm-branch-commits] [MSan] Make Test work with Internal Shell (PR #165144)

2025-10-27 Thread Florian Mayer via llvm-branch-commits

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


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


[llvm-branch-commits] [Profile] Rewrite Test to work with Internal Shell (PR #165145)

2025-10-27 Thread Florian Mayer via llvm-branch-commits

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


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


[llvm-branch-commits] [MemProf] Make Test work with Internal Shell (PR #165146)

2025-10-27 Thread Florian Mayer via llvm-branch-commits

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


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


[llvm-branch-commits] [llvm] [lit] Add support for setting limits to unlimited (PR #165123)

2025-10-27 Thread Paul Kirth via llvm-branch-commits

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

LGTM. I don't have a strong opinion on the one import I commented on.

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


[llvm-branch-commits] [llvm] [lit] Add support for setting limits to unlimited (PR #165123)

2025-10-27 Thread Paul Kirth via llvm-branch-commits


@@ -602,18 +602,28 @@ def executeBuiltinUlimit(cmd, shenv):
 """executeBuiltinUlimit - Change the current limits."""
 if os.name != "posix":
 raise InternalShellError(cmd, "'ulimit' not supported on this system")
+# Import resource here after we confirm we are on a POSIX system as the
+# module does not exist on Windows.
+import resource

ilovepi wrote:

I could go either way on this import here. on one hand I like that its 
conditional, since ulimit is rare. on the other hand, I'd generally prefer the 
imports be together at the top of the file.

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


[llvm-branch-commits] [llvm] [lit] Add support for setting limits to unlimited (PR #165123)

2025-10-27 Thread Paul Kirth via llvm-branch-commits

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


[llvm-branch-commits] [llvm] [LoongArch] Make ceil, floor, trunc, roundeven legal for lsx/lasx (PR #165217)

2025-10-27 Thread Zhaoxin Yang via llvm-branch-commits

https://github.com/ylzsx created 
https://github.com/llvm/llvm-project/pull/165217

None

>From ddd5b937312782e9b1182d253ec96ef52661f764 Mon Sep 17 00:00:00 2001
From: yangzhaoxin 
Date: Mon, 27 Oct 2025 16:41:41 +0800
Subject: [PATCH] [LoongArch] Make ceil,floor,trunc,roundeven legal for
 lsx/lasx

---
 .../LoongArch/LoongArchISelLowering.cpp   |   8 +
 .../LoongArch/LoongArchLASXInstrInfo.td   |   6 +
 .../Target/LoongArch/LoongArchLSXInstrInfo.td |   5 +
 .../CodeGen/LoongArch/lasx/fp-rounding.ll | 200 ++
 .../test/CodeGen/LoongArch/lsx/fp-rounding.ll |  88 +---
 5 files changed, 35 insertions(+), 272 deletions(-)

diff --git a/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp 
b/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
index ca4a655f06587..7fee3dd63dc68 100644
--- a/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
+++ b/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
@@ -366,6 +366,10 @@ LoongArchTargetLowering::LoongArchTargetLowering(const 
TargetMachine &TM,
  ISD::SETUGE, ISD::SETUGT},
 VT, Expand);
   setOperationAction(ISD::SCALAR_TO_VECTOR, VT, Legal);
+  setOperationAction(ISD::FCEIL, VT, Legal);
+  setOperationAction(ISD::FFLOOR, VT, Legal);
+  setOperationAction(ISD::FTRUNC, VT, Legal);
+  setOperationAction(ISD::FROUNDEVEN, VT, Legal);
 }
 setOperationAction(ISD::CTPOP, GRLenVT, Legal);
 setOperationAction(ISD::FCEIL, {MVT::f32, MVT::f64}, Legal);
@@ -447,6 +451,10 @@ LoongArchTargetLowering::LoongArchTargetLowering(const 
TargetMachine &TM,
  ISD::SETUGE, ISD::SETUGT},
 VT, Expand);
   setOperationAction(ISD::SCALAR_TO_VECTOR, VT, Legal);
+  setOperationAction(ISD::FCEIL, VT, Legal);
+  setOperationAction(ISD::FFLOOR, VT, Legal);
+  setOperationAction(ISD::FTRUNC, VT, Legal);
+  setOperationAction(ISD::FROUNDEVEN, VT, Legal);
 }
   }
 
diff --git a/llvm/lib/Target/LoongArch/LoongArchLASXInstrInfo.td 
b/llvm/lib/Target/LoongArch/LoongArchLASXInstrInfo.td
index 613dea6093f5f..7e02830125fb4 100644
--- a/llvm/lib/Target/LoongArch/LoongArchLASXInstrInfo.td
+++ b/llvm/lib/Target/LoongArch/LoongArchLASXInstrInfo.td
@@ -2403,6 +2403,12 @@ def : Pat<(int_loongarch_lasx_xvpickve_w_f v8f32:$xj, 
timm:$imm),
 def : Pat<(int_loongarch_lasx_xvpickve_d_f v4f64:$xj, timm:$imm),
   (XVPICKVE_D v4f64:$xj, (to_valid_timm timm:$imm))>;
 
+// Vector floating-point conversion
+defm : PatXrF;
+defm : PatXrF;
+defm : PatXrF;
+defm : PatXrF;
+
 // load
 def : Pat<(int_loongarch_lasx_xvld GPR:$rj, timm:$imm),
   (XVLD GPR:$rj, (to_valid_timm timm:$imm))>;
diff --git a/llvm/lib/Target/LoongArch/LoongArchLSXInstrInfo.td 
b/llvm/lib/Target/LoongArch/LoongArchLSXInstrInfo.td
index 4619c6bd248a6..fcdb08074b2f2 100644
--- a/llvm/lib/Target/LoongArch/LoongArchLSXInstrInfo.td
+++ b/llvm/lib/Target/LoongArch/LoongArchLSXInstrInfo.td
@@ -2519,6 +2519,11 @@ def : Pat<(f64 (froundeven FPR64:$fj)),
   (f64 (EXTRACT_SUBREG (VFRINTRNE_D (VREPLVEI_D
(SUBREG_TO_REG (i64 0), FPR64:$fj, sub_64), 0)), sub_64))>;
 
+defm : PatVrF;
+defm : PatVrF;
+defm : PatVrF;
+defm : PatVrF;
+
 // load
 def : Pat<(int_loongarch_lsx_vld GPR:$rj, timm:$imm),
   (VLD GPR:$rj, (to_valid_timm timm:$imm))>;
diff --git a/llvm/test/CodeGen/LoongArch/lasx/fp-rounding.ll 
b/llvm/test/CodeGen/LoongArch/lasx/fp-rounding.ll
index d570dba3f4658..71c4c66806100 100644
--- a/llvm/test/CodeGen/LoongArch/lasx/fp-rounding.ll
+++ b/llvm/test/CodeGen/LoongArch/lasx/fp-rounding.ll
@@ -7,38 +7,8 @@ define void @ceil_v8f32(ptr %res, ptr %a0) nounwind {
 ; CHECK-LABEL: ceil_v8f32:
 ; CHECK:   # %bb.0: # %entry
 ; CHECK-NEXT:xvld $xr0, $a1, 0
-; CHECK-NEXT:xvpickve.w $xr1, $xr0, 5
-; CHECK-NEXT:vreplvei.w $vr1, $vr1, 0
-; CHECK-NEXT:vfrintrp.s $vr1, $vr1
-; CHECK-NEXT:xvpickve.w $xr2, $xr0, 4
-; CHECK-NEXT:vreplvei.w $vr2, $vr2, 0
-; CHECK-NEXT:vfrintrp.s $vr2, $vr2
-; CHECK-NEXT:vextrins.w $vr2, $vr1, 16
-; CHECK-NEXT:xvpickve.w $xr1, $xr0, 6
-; CHECK-NEXT:vreplvei.w $vr1, $vr1, 0
-; CHECK-NEXT:vfrintrp.s $vr1, $vr1
-; CHECK-NEXT:vextrins.w $vr2, $vr1, 32
-; CHECK-NEXT:xvpickve.w $xr1, $xr0, 7
-; CHECK-NEXT:vreplvei.w $vr1, $vr1, 0
-; CHECK-NEXT:vfrintrp.s $vr1, $vr1
-; CHECK-NEXT:vextrins.w $vr2, $vr1, 48
-; CHECK-NEXT:xvpickve.w $xr1, $xr0, 1
-; CHECK-NEXT:vreplvei.w $vr1, $vr1, 0
-; CHECK-NEXT:vfrintrp.s $vr1, $vr1
-; CHECK-NEXT:xvpickve.w $xr3, $xr0, 0
-; CHECK-NEXT:vreplvei.w $vr3, $vr3, 0
-; CHECK-NEXT:vfrintrp.s $vr3, $vr3
-; CHECK-NEXT:vextrins.w $vr3, $vr1, 16
-; CHECK-NEXT:xvpickve.w $xr1, $xr0, 2
-; CHECK-NEXT:vreplvei.w $vr1, $vr1, 0
-; CHECK-NEXT:vfrintrp.s $vr1, $vr1
-; CHECK-NEXT:vextrins.w $vr3, $vr1, 32
-; CHECK-NEXT:xvpickve.w $xr0, $xr0, 3
-; CHECK-NEXT:vreplvei.w $vr0, $vr0, 0
-; CHECK-NEXT

[llvm-branch-commits] [llvm] [LoongArch] Make ceil, floor, trunc, roundeven legal for lsx/lasx (PR #165217)

2025-10-27 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-backend-loongarch

Author: Zhaoxin Yang (ylzsx)


Changes



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


5 Files Affected:

- (modified) llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp (+8) 
- (modified) llvm/lib/Target/LoongArch/LoongArchLASXInstrInfo.td (+6) 
- (modified) llvm/lib/Target/LoongArch/LoongArchLSXInstrInfo.td (+5) 
- (modified) llvm/test/CodeGen/LoongArch/lasx/fp-rounding.ll (+12-188) 
- (modified) llvm/test/CodeGen/LoongArch/lsx/fp-rounding.ll (+4-84) 


``diff
diff --git a/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp 
b/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
index ca4a655f06587..7fee3dd63dc68 100644
--- a/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
+++ b/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
@@ -366,6 +366,10 @@ LoongArchTargetLowering::LoongArchTargetLowering(const 
TargetMachine &TM,
  ISD::SETUGE, ISD::SETUGT},
 VT, Expand);
   setOperationAction(ISD::SCALAR_TO_VECTOR, VT, Legal);
+  setOperationAction(ISD::FCEIL, VT, Legal);
+  setOperationAction(ISD::FFLOOR, VT, Legal);
+  setOperationAction(ISD::FTRUNC, VT, Legal);
+  setOperationAction(ISD::FROUNDEVEN, VT, Legal);
 }
 setOperationAction(ISD::CTPOP, GRLenVT, Legal);
 setOperationAction(ISD::FCEIL, {MVT::f32, MVT::f64}, Legal);
@@ -447,6 +451,10 @@ LoongArchTargetLowering::LoongArchTargetLowering(const 
TargetMachine &TM,
  ISD::SETUGE, ISD::SETUGT},
 VT, Expand);
   setOperationAction(ISD::SCALAR_TO_VECTOR, VT, Legal);
+  setOperationAction(ISD::FCEIL, VT, Legal);
+  setOperationAction(ISD::FFLOOR, VT, Legal);
+  setOperationAction(ISD::FTRUNC, VT, Legal);
+  setOperationAction(ISD::FROUNDEVEN, VT, Legal);
 }
   }
 
diff --git a/llvm/lib/Target/LoongArch/LoongArchLASXInstrInfo.td 
b/llvm/lib/Target/LoongArch/LoongArchLASXInstrInfo.td
index 613dea6093f5f..7e02830125fb4 100644
--- a/llvm/lib/Target/LoongArch/LoongArchLASXInstrInfo.td
+++ b/llvm/lib/Target/LoongArch/LoongArchLASXInstrInfo.td
@@ -2403,6 +2403,12 @@ def : Pat<(int_loongarch_lasx_xvpickve_w_f v8f32:$xj, 
timm:$imm),
 def : Pat<(int_loongarch_lasx_xvpickve_d_f v4f64:$xj, timm:$imm),
   (XVPICKVE_D v4f64:$xj, (to_valid_timm timm:$imm))>;
 
+// Vector floating-point conversion
+defm : PatXrF;
+defm : PatXrF;
+defm : PatXrF;
+defm : PatXrF;
+
 // load
 def : Pat<(int_loongarch_lasx_xvld GPR:$rj, timm:$imm),
   (XVLD GPR:$rj, (to_valid_timm timm:$imm))>;
diff --git a/llvm/lib/Target/LoongArch/LoongArchLSXInstrInfo.td 
b/llvm/lib/Target/LoongArch/LoongArchLSXInstrInfo.td
index 4619c6bd248a6..fcdb08074b2f2 100644
--- a/llvm/lib/Target/LoongArch/LoongArchLSXInstrInfo.td
+++ b/llvm/lib/Target/LoongArch/LoongArchLSXInstrInfo.td
@@ -2519,6 +2519,11 @@ def : Pat<(f64 (froundeven FPR64:$fj)),
   (f64 (EXTRACT_SUBREG (VFRINTRNE_D (VREPLVEI_D
(SUBREG_TO_REG (i64 0), FPR64:$fj, sub_64), 0)), sub_64))>;
 
+defm : PatVrF;
+defm : PatVrF;
+defm : PatVrF;
+defm : PatVrF;
+
 // load
 def : Pat<(int_loongarch_lsx_vld GPR:$rj, timm:$imm),
   (VLD GPR:$rj, (to_valid_timm timm:$imm))>;
diff --git a/llvm/test/CodeGen/LoongArch/lasx/fp-rounding.ll 
b/llvm/test/CodeGen/LoongArch/lasx/fp-rounding.ll
index d570dba3f4658..71c4c66806100 100644
--- a/llvm/test/CodeGen/LoongArch/lasx/fp-rounding.ll
+++ b/llvm/test/CodeGen/LoongArch/lasx/fp-rounding.ll
@@ -7,38 +7,8 @@ define void @ceil_v8f32(ptr %res, ptr %a0) nounwind {
 ; CHECK-LABEL: ceil_v8f32:
 ; CHECK:   # %bb.0: # %entry
 ; CHECK-NEXT:xvld $xr0, $a1, 0
-; CHECK-NEXT:xvpickve.w $xr1, $xr0, 5
-; CHECK-NEXT:vreplvei.w $vr1, $vr1, 0
-; CHECK-NEXT:vfrintrp.s $vr1, $vr1
-; CHECK-NEXT:xvpickve.w $xr2, $xr0, 4
-; CHECK-NEXT:vreplvei.w $vr2, $vr2, 0
-; CHECK-NEXT:vfrintrp.s $vr2, $vr2
-; CHECK-NEXT:vextrins.w $vr2, $vr1, 16
-; CHECK-NEXT:xvpickve.w $xr1, $xr0, 6
-; CHECK-NEXT:vreplvei.w $vr1, $vr1, 0
-; CHECK-NEXT:vfrintrp.s $vr1, $vr1
-; CHECK-NEXT:vextrins.w $vr2, $vr1, 32
-; CHECK-NEXT:xvpickve.w $xr1, $xr0, 7
-; CHECK-NEXT:vreplvei.w $vr1, $vr1, 0
-; CHECK-NEXT:vfrintrp.s $vr1, $vr1
-; CHECK-NEXT:vextrins.w $vr2, $vr1, 48
-; CHECK-NEXT:xvpickve.w $xr1, $xr0, 1
-; CHECK-NEXT:vreplvei.w $vr1, $vr1, 0
-; CHECK-NEXT:vfrintrp.s $vr1, $vr1
-; CHECK-NEXT:xvpickve.w $xr3, $xr0, 0
-; CHECK-NEXT:vreplvei.w $vr3, $vr3, 0
-; CHECK-NEXT:vfrintrp.s $vr3, $vr3
-; CHECK-NEXT:vextrins.w $vr3, $vr1, 16
-; CHECK-NEXT:xvpickve.w $xr1, $xr0, 2
-; CHECK-NEXT:vreplvei.w $vr1, $vr1, 0
-; CHECK-NEXT:vfrintrp.s $vr1, $vr1
-; CHECK-NEXT:vextrins.w $vr3, $vr1, 32
-; CHECK-NEXT:xvpickve.w $xr0, $xr0, 3
-; CHECK-NEXT:vreplvei.w $vr0, $vr0, 0
-; CHECK-NEXT:vfrintrp.s $vr0, $vr0
-; CHECK-NEXT:vextrins.w $vr3, $vr0, 48
-; CHECK-NEXT:xvpermi.

[llvm-branch-commits] [llvm] release/21.x: [BPF] Backport backend fixes related to BTF (PR #165154)

2025-10-27 Thread Cullen Rhodes via llvm-branch-commits

c-rhodes wrote:

seems like quite a large change, although it is restricted to the BPF backend. 
@eddyz87 @yonghong-song what do you think about backporting this?

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


[llvm-branch-commits] [clang] [Clang] Do not warn on UTF-16 -> UTF-32 conversions. (#163927) (PR #164654)

2025-10-27 Thread Cullen Rhodes via llvm-branch-commits

c-rhodes wrote:

> sidenote: updated release notes on the maintenance branches almost never get 
> published (though they should).

I'm new to release maintenance so this is new to me, thanks for mentioning. 
I'll raise it with the other release maintainers.


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


[llvm-branch-commits] [llvm] [dwarf] make dwarf fission compatible with RISCV relaxations 1/2 (PR #164812)

2025-10-27 Thread Sam Elliott via llvm-branch-commits


@@ -84,7 +84,22 @@ void MCSymbol::print(raw_ostream &OS, const MCAsmInfo *MAI) 
const {
 }
 
 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
-LLVM_DUMP_METHOD void MCSymbol::dump() const {
-  dbgs() << *this;
-}
+LLVM_DUMP_METHOD void MCSymbol::dump() const { dbgs() << *this; }
 #endif
+
+bool llvm::isRangeRelaxable(const MCSymbol *Begin, const MCSymbol *End) {

lenary wrote:

Please can we not re-implement `absoluteSymbolDiff` from `MCObjectStreamer.cpp` 
- given the logic there is already quite complex, maybe we can re-use that 
function rather than missing this one in a future update?

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


[llvm-branch-commits] [llvm] [DirectX] Add DXIL validation of `llvm.loop` metadata (PR #164292)

2025-10-27 Thread Helena Kotas via llvm-branch-commits

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

LGTM!

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


[llvm-branch-commits] [llvm] [DirectX] Add DXIL validation of `llvm.loop` metadata (PR #164292)

2025-10-27 Thread Joshua Batista via llvm-branch-commits


@@ -314,25 +327,122 @@ static void translateBranchMetadata(Module &M, 
Instruction *BBTerminatorInst) {
   BBTerminatorInst->setMetadata("hlsl.controlflow.hint", nullptr);
 }
 
-static std::array getCompatibleInstructionMDs(llvm::Module &M) {
+// Determines if the metadata node will be compatible with DXIL's loop metadata
+// representation.
+//
+// Reports an error for compatible metadata that is ill-formed.
+static bool isLoopMDCompatible(Module &M, Metadata *MD) {
+  // DXIL only accepts the following loop hints:
+  std::array ValidHintNames = {"llvm.loop.unroll.count",
+ "llvm.loop.unroll.disable",
+ "llvm.loop.unroll.full"};
+
+  MDNode *HintMD = dyn_cast(MD);
+  if (!HintMD || HintMD->getNumOperands() == 0)
+return false;
+
+  auto *HintStr = dyn_cast(HintMD->getOperand(0));
+  if (!HintStr)
+return false;
+
+  if (!llvm::is_contained(ValidHintNames, HintStr->getString()))
+return false;
+
+  auto ValidCountNode = [](MDNode *CountMD) -> bool {
+if (CountMD->getNumOperands() == 2)
+  if (auto *Count = dyn_cast(CountMD->getOperand(1)))
+if (isa(Count->getValue()))
+  return true;
+return false;
+  };
+
+  if (HintStr->getString() == "llvm.loop.unroll.count") {
+if (!ValidCountNode(HintMD)) {
+  reportLoopError(M, "Second operand of \"llvm.loop.unroll.count\" "

bob80905 wrote:

Not sure this error message will always be accurate, because it could also be 
that numOperands is not 2, or the 2nd operand isn't a ConstantAsMetadata. 
Wouldn't `llvm.loop.unroll.count has invalid count node` or something similar 
be a better error message?

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


[llvm-branch-commits] [llvm] [DirectX] Add DXIL validation of `llvm.loop` metadata (PR #164292)

2025-10-27 Thread Joshua Batista via llvm-branch-commits


@@ -47,16 +48,28 @@ class DiagnosticInfoTranslateMD : public DiagnosticInfo {
   /// \p M is the module for which the diagnostic is being emitted. \p Msg is
   /// the message to show. Note that this class does not copy this message, so
   /// this reference must be valid for the whole life time of the diagnostic.
-  DiagnosticInfoTranslateMD(const Module &M,
-const Twine &Msg LLVM_LIFETIME_BOUND,
-DiagnosticSeverity Severity = DS_Error)
+  DiagnosticInfoValidateMD(const Module &M,
+   const Twine &Msg LLVM_LIFETIME_BOUND,
+   DiagnosticSeverity Severity = DS_Error)
   : DiagnosticInfo(DK_Unsupported, Severity), Msg(Msg), Mod(M) {}
 
   void print(DiagnosticPrinter &DP) const override {
 DP << Mod.getName() << ": " << Msg << '\n';
   }
 };
 
+static bool reportError(Module &M, Twine Message,
+DiagnosticSeverity Severity = DS_Error) {
+  M.getContext().diagnose(DiagnosticInfoValidateMD(M, Message, Severity));
+  return true;

bob80905 wrote:

You don't seem to use this return value, should this and below functions return 
void?

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


[llvm-branch-commits] [llvm] [DirectX] Add DXIL validation of `llvm.loop` metadata (PR #164292)

2025-10-27 Thread Joshua Batista via llvm-branch-commits


@@ -24,9 +24,9 @@ _Z4mainDv3_j.exit:; preds = 
%for.body.i, %entry
 ; These next check lines check that only the range metadata remains
 ; No more metadata should be necessary, the rest (the current 0 and 1)
 ; should be removed.
-; CHECK-NOT: !{!"llvm.loop.mustprogress"}
-; CHECK: [[RANGEMD]] = !{i32 1, i32 5}
-; CHECK-NOT: !{!"llvm.loop.mustprogress"}
-!0 = distinct !{!0, !1}
+; CHECK-DAG: [[RANGEMD]] = !{i32 1, i32 5}

bob80905 wrote:

Shouldn't we keep the CHECK-NOT?

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


[llvm-branch-commits] [llvm] [DirectX] Add DXIL validation of `llvm.loop` metadata (PR #164292)

2025-10-27 Thread Joshua Batista via llvm-branch-commits


@@ -389,31 +499,23 @@ static void translateGlobalMetadata(Module &M, 
DXILResourceMap &DRM,
 uint64_t CombinedMask = ShaderFlags.getCombinedFlags();
 EntryFnMDNodes.emplace_back(
 emitTopLevelLibraryNode(M, ResourceMD, CombinedMask));
-  } else if (MMDI.EntryPropertyVec.size() > 1) {
-M.getContext().diagnose(DiagnosticInfoTranslateMD(
-M, "Non-library shader: One and only one entry expected"));
-  }
+  } else if (1 < MMDI.EntryPropertyVec.size())

bob80905 wrote:

nit: this conditional change is unnecessary.

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


[llvm-branch-commits] [llvm] [DirectX] Add DXIL validation of `llvm.loop` metadata (PR #164292)

2025-10-27 Thread Joshua Batista via llvm-branch-commits


@@ -314,25 +327,122 @@ static void translateBranchMetadata(Module &M, 
Instruction *BBTerminatorInst) {
   BBTerminatorInst->setMetadata("hlsl.controlflow.hint", nullptr);
 }
 
-static std::array getCompatibleInstructionMDs(llvm::Module &M) {
+// Determines if the metadata node will be compatible with DXIL's loop metadata
+// representation.
+//
+// Reports an error for compatible metadata that is ill-formed.
+static bool isLoopMDCompatible(Module &M, Metadata *MD) {
+  // DXIL only accepts the following loop hints:
+  std::array ValidHintNames = {"llvm.loop.unroll.count",
+ "llvm.loop.unroll.disable",
+ "llvm.loop.unroll.full"};
+
+  MDNode *HintMD = dyn_cast(MD);
+  if (!HintMD || HintMD->getNumOperands() == 0)
+return false;
+
+  auto *HintStr = dyn_cast(HintMD->getOperand(0));
+  if (!HintStr)
+return false;
+
+  if (!llvm::is_contained(ValidHintNames, HintStr->getString()))
+return false;
+
+  auto ValidCountNode = [](MDNode *CountMD) -> bool {
+if (CountMD->getNumOperands() == 2)
+  if (auto *Count = dyn_cast(CountMD->getOperand(1)))
+if (isa(Count->getValue()))
+  return true;
+return false;
+  };
+
+  if (HintStr->getString() == "llvm.loop.unroll.count") {
+if (!ValidCountNode(HintMD)) {
+  reportLoopError(M, "Second operand of \"llvm.loop.unroll.count\" "
+ "must be a constant integer");
+  return false;
+}
+  } else if (HintMD->getNumOperands() != 1) {
+reportLoopError(
+M, "\"llvm.loop.unroll.disable\" and \"llvm.loop.unroll.disable\" "

bob80905 wrote:

You probably meant to mention ... .unroll.full as the second thing

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


[llvm-branch-commits] [llvm] [DirectX] Add DXIL validation of `llvm.loop` metadata (PR #164292)

2025-10-27 Thread Finn Plummer via llvm-branch-commits

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


[llvm-branch-commits] [llvm] [DirectX] Add DXIL validation of `llvm.loop` metadata (PR #164292)

2025-10-27 Thread Joshua Batista via llvm-branch-commits


@@ -314,25 +327,122 @@ static void translateBranchMetadata(Module &M, 
Instruction *BBTerminatorInst) {
   BBTerminatorInst->setMetadata("hlsl.controlflow.hint", nullptr);
 }
 
-static std::array getCompatibleInstructionMDs(llvm::Module &M) {
+// Determines if the metadata node will be compatible with DXIL's loop metadata
+// representation.
+//
+// Reports an error for compatible metadata that is ill-formed.
+static bool isLoopMDCompatible(Module &M, Metadata *MD) {
+  // DXIL only accepts the following loop hints:
+  std::array ValidHintNames = {"llvm.loop.unroll.count",
+ "llvm.loop.unroll.disable",
+ "llvm.loop.unroll.full"};
+
+  MDNode *HintMD = dyn_cast(MD);
+  if (!HintMD || HintMD->getNumOperands() == 0)
+return false;
+
+  auto *HintStr = dyn_cast(HintMD->getOperand(0));
+  if (!HintStr)
+return false;
+
+  if (!llvm::is_contained(ValidHintNames, HintStr->getString()))
+return false;
+
+  auto ValidCountNode = [](MDNode *CountMD) -> bool {
+if (CountMD->getNumOperands() == 2)
+  if (auto *Count = dyn_cast(CountMD->getOperand(1)))
+if (isa(Count->getValue()))
+  return true;
+return false;
+  };
+
+  if (HintStr->getString() == "llvm.loop.unroll.count") {
+if (!ValidCountNode(HintMD)) {
+  reportLoopError(M, "Second operand of \"llvm.loop.unroll.count\" "
+ "must be a constant integer");
+  return false;
+}
+  } else if (HintMD->getNumOperands() != 1) {
+reportLoopError(
+M, "\"llvm.loop.unroll.disable\" and \"llvm.loop.unroll.disable\" "
+   "must be provided as a single operand");
+return false;
+  }
+
+  return true;
+}
+
+static void translateLoopMetadata(Module &M, Instruction *I, MDNode *BaseMD) {
+  // A distinct node has the self-referential form: !0 = !{ !0, ... }
+  auto IsDistinctNode = [](MDNode *Node) -> bool {
+return Node && Node->getNumOperands() != 0 && Node == Node->getOperand(0);
+  };
+
+  // Strip empty metadata or a non-distinct node

bob80905 wrote:

This comment might be misleading? I don't think this is stripping anything, 
right? You're setting an instruction's metadata.

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


[llvm-branch-commits] [llvm] [DirectX] Add DXIL validation of `llvm.loop` metadata (PR #164292)

2025-10-27 Thread Joshua Batista via llvm-branch-commits


@@ -24,9 +24,9 @@ _Z4mainDv3_j.exit:; preds = 
%for.body.i, %entry
 ; These next check lines check that only the range metadata remains
 ; No more metadata should be necessary, the rest (the current 0 and 1)
 ; should be removed.
-; CHECK-NOT: !{!"llvm.loop.mustprogress"}
-; CHECK: [[RANGEMD]] = !{i32 1, i32 5}
-; CHECK-NOT: !{!"llvm.loop.mustprogress"}
-!0 = distinct !{!0, !1}
+; CHECK-DAG: [[RANGEMD]] = !{i32 1, i32 5}
+; CHECK-DAG: [[LOOPMD]] = distinct !{[[LOOPMD]]}
+; CHECK-NOT: {!"llvm.loop.mustprogress"}
+!0 = distinct !{!0, !1, !2}

bob80905 wrote:

I don't get why this changed?

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


[llvm-branch-commits] [llvm] [LoongArch] Make ceil, floor, trunc, roundeven legal for lsx/lasx (PR #165217)

2025-10-27 Thread via llvm-branch-commits

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


https://github.com/llvm/llvm-project/pull/165217
___
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: [BPF] Backport backend fixes related to BTF (PR #165154)

2025-10-27 Thread via llvm-branch-commits

yonghong-song wrote:

So looks like llvm21 will have an assertion for rust if without backport. Does 
it have problems before llvm21 say llvm20? In general, I am okay with backport 
so llvm21 can work for rust bpf part as llvm22 may need some time to be 
available.

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


[llvm-branch-commits] [RFC][Clang] Allow plugins to hook into back-end (PR #165257)

2025-10-27 Thread Alexis Engelke via llvm-branch-commits

aengelke wrote:

> do you use a plugin to swap clang's CodeGen

We swap LLVM's CodeGen (the machine code generation part), but want to keep 
Clang's CodeGen (the part that generates LLVM IR and optimizes that). We want 
the front-end and middle-end optimizations to behave as usual and only replace 
the back-end with out own back-end.

> why the standard plugin system does not work well there?

The standard front-end plugins permit replacing, e.g., the CodeGenAction with 
something else. But we do want Clang's CodeGen to work normally. CodeGenAction 
and emitBackendOutput are very inflexible; adding a custom back-end through a 
PluginASTAction would essentially require us to copy large parts of 
CodeGenAction.cpp and BackendUtil.cpp, which is not maintainable.

https://github.com/llvm/llvm-project/pull/165257
___
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: [BPF] Backport backend fixes related to BTF (PR #165154)

2025-10-27 Thread Michal R via llvm-branch-commits

vadorovsky wrote:

> So looks like llvm21 will have an assertion for rust if without backport.

Yes, exactly.

> Does it have problems before llvm21 say llvm20?

Yes, the same problem occurs on LLVM 20 and earlier versions as well. But given 
that the Rust 1.91.0-beta is already using LLVM 21 and we should expect it to 
stabilize sometime soon (definitely before holidays / the end of year), I'm 
fine with backporting the fixes only to LLVM 21.

> In general, I am okay with backport so llvm21 can work for rust bpf part as 
> llvm22 may need some time to be available.

Thank you! Yes, without the backport to LLVM 21, the timeline would become 
pretty long - we could expect Rust nightly to switch to LLVM 22 around February 
2026 and a stable Rust version around spring 2026.


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


[llvm-branch-commits] [compiler-rt] [compiler-rt] Default to Lit's Internal Shell (PR #165148)

2025-10-27 Thread Aiden Grossman via llvm-branch-commits

https://github.com/boomanaiden154 updated 
https://github.com/llvm/llvm-project/pull/165148

>From e90f11ccc5e29f48dab9a7a0931719fef0ca3eeb Mon Sep 17 00:00:00 2001
From: Aiden Grossman 
Date: Mon, 27 Oct 2025 13:08:11 +
Subject: [PATCH] formatting

Created using spr 1.3.7
---
 compiler-rt/test/lit.common.cfg.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/compiler-rt/test/lit.common.cfg.py 
b/compiler-rt/test/lit.common.cfg.py
index 445841e599ec9..1468c0742a766 100644
--- a/compiler-rt/test/lit.common.cfg.py
+++ b/compiler-rt/test/lit.common.cfg.py
@@ -112,6 +112,7 @@ def push_dynamic_library_lookup_path(config, new_path):
 )
 config.environment[dynamic_library_lookup_var] = new_ld_library_path_64
 
+
 # TODO: Consolidate the logic for turning on the internal shell by default for 
all LLVM test suites.
 # See https://github.com/llvm/llvm-project/issues/106636 for more details.
 #

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


[llvm-branch-commits] [X86][NewPM] Port lower-amx-intrinsics to NewPM (PR #165113)

2025-10-27 Thread Aiden Grossman via llvm-branch-commits

https://github.com/boomanaiden154 updated 
https://github.com/llvm/llvm-project/pull/165113


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


[llvm-branch-commits] [X86][NewPM] Port lower-amx-intrinsics to NewPM (PR #165113)

2025-10-27 Thread Aiden Grossman via llvm-branch-commits

https://github.com/boomanaiden154 updated 
https://github.com/llvm/llvm-project/pull/165113


___
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: [sancov] Fix stack-depth tracking to use debug locations (#162428) (PR #162697)

2025-10-27 Thread via llvm-branch-commits

github-actions[bot] wrote:

@nathanchance (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/162697
___
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: [X86] Use pseudo instructions to zero registers in `buildClearRegister` (#163358) (PR #164076)

2025-10-27 Thread via llvm-branch-commits

github-actions[bot] wrote:

@RKSimon (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/164076
___
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: workflows/release-documentation: Allow secrets pass through from calling workflow (#162765) (PR #164538)

2025-10-27 Thread Cullen Rhodes via llvm-branch-commits

https://github.com/c-rhodes updated 
https://github.com/llvm/llvm-project/pull/164538

>From e94561caef487fbbadb50ad66ef2b21529aa388a Mon Sep 17 00:00:00 2001
From: Tom Stellard 
Date: Tue, 21 Oct 2025 19:26:56 -0700
Subject: [PATCH] workflows/release-documentation: Allow secrets pass through
 from calling workflow (#162765)

This should fix the part of the workflow that creates a PR with the new
documentation.

(cherry picked from commit 59d4d5c1c3b6f0f81ac51bea26605466268f83e9)
---
 .github/workflows/release-documentation.yml | 4 
 .github/workflows/release-tasks.yml | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/.github/workflows/release-documentation.yml 
b/.github/workflows/release-documentation.yml
index 5a0aa063d32ac..e07da3d9f3009 100644
--- a/.github/workflows/release-documentation.yml
+++ b/.github/workflows/release-documentation.yml
@@ -25,6 +25,10 @@ on:
 description: 'Upload documentation'
 required: false
 type: boolean
+secrets:
+  WWW_RELEASES_TOKEN:
+description: "Secret used to create a PR with the documentation 
changes."
+required: false
 
 jobs:
   release-documentation:
diff --git a/.github/workflows/release-tasks.yml 
b/.github/workflows/release-tasks.yml
index c9ae7e1ce97c3..894661a5112d5 100644
--- a/.github/workflows/release-tasks.yml
+++ b/.github/workflows/release-tasks.yml
@@ -54,6 +54,9 @@ jobs:
 with:
   release-version: ${{ needs.validate-tag.outputs.release-version }}
   upload: true
+# Called workflows don't have access to secrets by default, so we need to 
explicitly pass secrets that we use.
+secrets:
+  WWW_RELEASES_TOKEN: ${{ secrets.WWW_RELEASES_TOKEN }}
 
   release-doxygen:
 name: Build and Upload Release Doxygen

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


[llvm-branch-commits] [llvm] [llvm-readobj, ELF] Support reading binary with more than PN_XNUM segments. (PR #165278)

2025-10-27 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-llvm-binary-utilities

Author: None (aokblast)


Changes

FreeBSD coredump uses program headers to store mmap information. It is possible 
for program to use more than PN_XNUM mmaps. Therefore, we implement the support 
of PN_XNUM in readelf.

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


4 Files Affected:

- (added) llvm/test/tools/llvm-readobj/ELF/Inputs/many-segments.o.gz () 
- (added) llvm/test/tools/llvm-readobj/ELF/invalid-e_phnum.test (+39) 
- (added) llvm/test/tools/llvm-readobj/ELF/many-segments.test (+79) 
- (modified) llvm/tools/llvm-readobj/ELFDumper.cpp (+50-22) 


``diff
diff --git a/llvm/test/tools/llvm-readobj/ELF/Inputs/many-segments.o.gz 
b/llvm/test/tools/llvm-readobj/ELF/Inputs/many-segments.o.gz
new file mode 100644
index 0..0709ed1d6389e
Binary files /dev/null and 
b/llvm/test/tools/llvm-readobj/ELF/Inputs/many-segments.o.gz differ
diff --git a/llvm/test/tools/llvm-readobj/ELF/invalid-e_phnum.test 
b/llvm/test/tools/llvm-readobj/ELF/invalid-e_phnum.test
new file mode 100644
index 0..a174742af7192
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/ELF/invalid-e_phnum.test
@@ -0,0 +1,39 @@
+# RUN: yaml2obj --docnum=1 %s -o %t.o
+
+# RUN: llvm-readobj --headers %t.o 2>&1 | FileCheck %s 
--check-prefix=CASE-INVALID
+
+# CASE-INVALID: SectionHeaderOffset: 0
+# CASE-INVALID: ProgramHeaderCount: 65535 (corrupt)
+# CASE-INVALID: unable to dump program headers: program headers are longer 
than binary of size 336: e_phoff = 0x40, e_phnum = 65535, e_phentsize = 56
+
+--- !ELF
+FileHeader:
+  Class:   ELFCLASS64
+  Data:ELFDATA2LSB
+  Type:ET_EXEC
+  Machine: EM_X86_64
+  EPhNum:  65535
+  EShOff:  0
+ProgramHeaders:
+  - Type: PT_LOAD
+
+# RUN: yaml2obj --docnum=2 %s -o %t2.o
+
+# RUN: llvm-readobj --headers %t2.o 2>&1 | FileCheck %s 
--check-prefix=CASE-VALID
+
+# CASE-VALID: SectionHeaderOffset: 0
+# CASE-VALID: ProgramHeaderCount: 65535 (65536)
+# CASE-VALID: unable to dump program headers: program headers are longer than 
binary of size 336: e_phoff = 0x40, e_phnum = 65536, e_phentsize = 56
+
+--- !ELF
+FileHeader:
+  Class:   ELFCLASS64
+  Data:ELFDATA2LSB
+  Type:ET_EXEC
+  Machine: EM_X86_64
+  EPhNum:  65535
+Sections:
+  - Type: SHT_NULL
+Info: 65536
+ProgramHeaders:
+  - Type: PT_LOAD
diff --git a/llvm/test/tools/llvm-readobj/ELF/many-segments.test 
b/llvm/test/tools/llvm-readobj/ELF/many-segments.test
new file mode 100644
index 0..2f154ddf53899
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/ELF/many-segments.test
@@ -0,0 +1,79 @@
+## Show that llvm-readelf can handle an input file with many segments.
+
+RUN: %python %p/../../llvm-objcopy/Inputs/ungzip.py 
%p/Inputs/many-segments.o.gz > %t
+RUN: llvm-readobj --file-headers --sections --segments %t | FileCheck %s
+RUN: llvm-readelf --segments %t | FileCheck --check-prefix=SYMS %s
+
+## The ELF header should have e_phnum == PN_XNUM
+# CHECK:ProgramHeaderCount: 65535 (66549)
+## The first section header should store the real program header count in its 
fields.
+# CHECK:  Section {
+# CHECK-NEXT:   Index: 0
+# CHECK-NEXT:   Name:
+# CHECK-NEXT:   Type: SHT_NULL
+# CHECK-NEXT:   Flags [
+# CHECK-NEXT:   ]
+# CHECK-NEXT:   Address:
+# CHECK-NEXT:   Offset:
+# CHECK-NEXT:   Size:
+# CHECK-NEXT:   Link:
+# CHECK-NEXT:   Info: 66549
+
+## Show that the symbols with segments indexes around the reserved range still
+## have the right segment indexes afterwards.
+# 65535th segment
+# CHECK: Offset: 0x1183B000
+# CHECK-NEXT:   VirtualAddress: 0x349139F3000
+# CHECK:}
+# CHECK-NEXT  ProgramHeader {
+# CHECK-NEXTType: PT_LOAD (0x1)
+# CHECK-NEXTOffset: 0x1183C000
+# CHECK-NEXTVirtualAddress: 0x349139F4000
+# CHECK-NEXTPhysicalAddress: 0x0
+# CHECK-NEXTFileSize: 4096
+# CHECK-NEXTMemSize: 4096
+# CHECK-NEXTFlags [ (0x4)
+# CHECK-NEXT  PF_R (0x4)
+# CHECK-NEXT]
+# CHECK-NEXTAlignment: 4096
+# CHECK-NEXT  }
+# CHECK-NEXT  ProgramHeader {
+# CHECK-NEXTType: PT_LOAD (0x1)
+# CHECK-NEXTOffset: 0x1183D000
+# CHECK-NEXTVirtualAddress: 0x349139F5000
+# CHECK-NEXTPhysicalAddress: 0x0
+# CHECK-NEXTFileSize: 4096
+# CHECK-NEXTMemSize: 4096
+# CHECK-NEXTFlags [ (0x6)
+# CHECK-NEXT  PF_R (0x4)
+# CHECK-NEXT  PF_W (0x2)
+# CHECK-NEXT]
+# CHECK-NEXTAlignment: 4096
+# CHECK-NEXT  }
+# CHECK-NEXT  ProgramHeader {
+# CHECK-NEXTType: PT_LOAD (0x1)
+# CHECK-NEXTOffset: 0x1183E000
+# CHECK-NEXTVirtualAddress: 0x349139F6000
+# CHECK-NEXTPhysicalAddress: 0x0
+# CHECK-NEXTFileSize: 4096
+# CHECK-NEXTMemSize: 4096
+# CHECK-NEXTFlags [ (0x4)
+# CHECK-NEXT  PF_R (0x4)
+# CHECK-NEXT]
+# CHECK-NEXTAlignment: 4096
+# CHECK-NEXT  }
+# CHECKProgramHeader {
+# CHECK-NEXTType: PT_LOAD (0x1)
+# CHECK-NEXTOffset: 0x11C31000
+# CHECK-NEXTVirtualAddress: 0x30D8E7868000
+# CHECK-NEXT 

  1   2   >