[jenkinsci/stapler] 26a41f: Upgrade Jetty from 10.0.20 to 12.0.9 (EE 8)

2024-05-09 Thread 'Basil Crow' via Jenkins Commits
  Branch: refs/heads/prototype
  Home:   https://github.com/jenkinsci/stapler
  Commit: 26a41f97296f674fcba388a096e1f540eb15f3a4
  
https://github.com/jenkinsci/stapler/commit/26a41f97296f674fcba388a096e1f540eb15f3a4
  Author: Basil Crow 
  Date:   2024-05-09 (Thu, 09 May 2024)

  Changed paths:
M core/pom.xml
M 
core/src/test/java/org/kohsuke/stapler/compression/CompressionFilterTest.java
M core/src/test/java/org/kohsuke/stapler/test/JettyTestCase.java
M jelly/pom.xml
M pom.xml

  Log Message:
  ---
  Upgrade Jetty from 10.0.20 to 12.0.9 (EE 8)



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/stapler/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/stapler/push/refs/heads/prototype/04bc30-26a41f%40github.com.


[tianocore/edk2] 3c0b84: DynamicTablesPkg: Adds integer to the AML package ...

2024-05-09 Thread Liming Gao via edk2-commits
  Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: 3c0b84420f098c5a88281a6be370c2766184c99b
  
https://github.com/tianocore/edk2/commit/3c0b84420f098c5a88281a6be370c2766184c99b
  Author: Abdul Lateef Attar 
  Date:   2024-05-10 (Fri, 10 May 2024)

  Changed paths:
M DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
M DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c

  Log Message:
  ---
  DynamicTablesPkg: Adds integer to the AML package node

Adds an AmlAddIntegerToNamedPackage() API to generate AML code,
which adds an integer value to the package node.

Cc: Pierre Gondois 
Cc: Sami Mujawar 
Signed-off-by: Abdul Lateef Attar 
Reviewed-by: Pierre Gondois 
Reviewed-by: Sami Mujawar 



To unsubscribe from these emails, change your notification settings at 
https://github.com/tianocore/edk2/settings/notifications


___
edk2-commits mailing list
edk2-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-commits


[llvm-branch-commits] [libc] a102e89 - Revert "Revert "[libc][NFC] adjust time related implementations" (#91657)"

2024-05-09 Thread via llvm-branch-commits
clude "src/time/clock_gettime.h"
-
-#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
 #include "src/__support/common.h"
+#include "src/__support/time/clock_gettime.h"
 #include "src/errno/libc_errno.h"
-#include "src/time/linux/clockGetTimeImpl.h"
-
-#include  // For syscall numbers.
-#include 
 
 namespace LIBC_NAMESPACE {
 
 // TODO(michaelrj): Move this into time/linux with the other syscalls.
 LLVM_LIBC_FUNCTION(int, clock_gettime,
(clockid_t clockid, struct timespec *ts)) {
-  auto result = internal::clock_gettimeimpl(clockid, ts);
+  auto result = internal::clock_gettime(clockid, ts);
 
   // A negative return value indicates an error with the magnitude of the
   // value being the error code.

diff  --git a/libc/src/time/linux/gettimeofday.cpp 
b/libc/src/time/linux/gettimeofday.cpp
index 07ab4d579176e..c7bcd45e01fa9 100644
--- a/libc/src/time/linux/gettimeofday.cpp
+++ b/libc/src/time/linux/gettimeofday.cpp
@@ -7,24 +7,24 @@
 
//===--===//
 
 #include "src/time/gettimeofday.h"
-
-#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
+#include "hdr/time_macros.h"
+#include "hdr/types/suseconds_t.h"
 #include "src/__support/common.h"
+#include "src/__support/time/clock_gettime.h"
+#include "src/__support/time/units.h"
 #include "src/errno/libc_errno.h"
-#include "src/time/linux/clockGetTimeImpl.h"
-
-#include  // For syscall numbers.
 
 namespace LIBC_NAMESPACE {
 
 // TODO(michaelrj): Move this into time/linux with the other syscalls.
 LLVM_LIBC_FUNCTION(int, gettimeofday,
(struct timeval * tv, [[maybe_unused]] void *unused)) {
+  using namespace time_units;
   if (tv == nullptr)
 return 0;
 
   struct timespec ts;
-  auto result = internal::clock_gettimeimpl(CLOCK_REALTIME, );
+  auto result = internal::clock_gettime(CLOCK_REALTIME, );
 
   // A negative return value indicates an error with the magnitude of the
   // value being the error code.
@@ -34,7 +34,7 @@ LLVM_LIBC_FUNCTION(int, gettimeofday,
   }
 
   tv->tv_sec = ts.tv_sec;
-  tv->tv_usec = static_cast(ts.tv_nsec / 1000);
+  tv->tv_usec = static_cast(ts.tv_nsec / 1_us_ns);
   return 0;
 }
 

diff  --git a/libc/src/time/linux/time.cpp b/libc/src/time/linux/time.cpp
index e286fae095b2a..93d5d73627642 100644
--- a/libc/src/time/linux/time.cpp
+++ b/libc/src/time/linux/time.cpp
@@ -6,22 +6,18 @@
 //
 
//===--===//
 
-#include "src/time/time_func.h"
-
-#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
+#include "hdr/time_macros.h"
 #include "src/__support/common.h"
+#include "src/__support/time/clock_gettime.h"
 #include "src/errno/libc_errno.h"
-#include "src/time/linux/clockGetTimeImpl.h"
-
-#include  // For syscall numbers.
-#include 
+#include "src/time/time_func.h"
 
 namespace LIBC_NAMESPACE {
 
 LLVM_LIBC_FUNCTION(time_t, time, (time_t * tp)) {
   // TODO: Use the Linux VDSO to fetch the time and avoid the syscall.
   struct timespec ts;
-  auto result = internal::clock_gettimeimpl(CLOCK_REALTIME, );
+  auto result = internal::clock_gettime(CLOCK_REALTIME, );
   if (!result.has_value()) {
 libc_errno = result.error();
 return -1;

diff  --git a/libc/src/time/nanosleep.h b/libc/src/time/nanosleep.h
index 757394232c079..2309666b2304b 100644
--- a/libc/src/time/nanosleep.h
+++ b/libc/src/time/nanosleep.h
@@ -9,11 +9,11 @@
 #ifndef LLVM_LIBC_SRC_TIME_NANOSLEEP_H
 #define LLVM_LIBC_SRC_TIME_NANOSLEEP_H
 
-#include 
+#include "hdr/types/struct_timespec.h"
 
 namespace LIBC_NAMESPACE {
 
-int nanosleep(const struct timespec *req, struct timespec *rem);
+int nanosleep(const timespec *req, timespec *rem);
 
 } // namespace LIBC_NAMESPACE
 

diff  --git a/libc/src/time/time_func.h b/libc/src/time/time_func.h
index beb02020b5759..2a52392209424 100644
--- a/libc/src/time/time_func.h
+++ b/libc/src/time/time_func.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_SRC_TIME_TIME_FUNC_H
 #define LLVM_LIBC_SRC_TIME_TIME_FUNC_H
 
-#include 
+#include "hdr/types/time_t.h"
 
 // Note this header file is named time_func.h to avoid conflicts with the
 // public header file time.h.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[Lldb-commits] [lldb] [lldb] Add CMake dependency tracking for SBLanguages generation script (PR #91686)

2024-05-09 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Alex Langford (bulbazord)


Changes

If you change the generation script and re-run ninja (or whatever drives your 
build), it currently will not regenerate SBLanguages.h. With dependency 
tracking, it should re-run when the script changes.

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


1 Files Affected:

- (modified) lldb/source/API/CMakeLists.txt (+4-1) 


``diff
diff --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt
index aa31caddfde3a..76b42ecf63f91 100644
--- a/lldb/source/API/CMakeLists.txt
+++ b/lldb/source/API/CMakeLists.txt
@@ -23,14 +23,17 @@ endif()
 # Generate SBLanguages.h from Dwarf.def.
 set(sb_languages_file
   ${CMAKE_CURRENT_BINARY_DIR}/../../include/lldb/API/SBLanguages.h)
+set(sb_languages_generator
+  ${LLDB_SOURCE_DIR}/scripts/generate-sbapi-dwarf-enum.py)
 add_custom_command(
   COMMENT "Generating SBLanguages.h from Dwarf.def"
   COMMAND "${Python3_EXECUTABLE}"
-  ${LLDB_SOURCE_DIR}/scripts/generate-sbapi-dwarf-enum.py
+  ${sb_languages_generator}
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/BinaryFormat/Dwarf.def
   -o ${sb_languages_file}
   OUTPUT ${sb_languages_file}
   DEPENDS ${LLVM_MAIN_INCLUDE_DIR}/llvm/BinaryFormat/Dwarf.def
+  ${sb_languages_generator}
   WORKING_DIRECTORY ${LLVM_LIBRARY_OUTPUT_INTDIR}
 )
 add_custom_target(lldb-sbapi-dwarf-enums

``




https://github.com/llvm/llvm-project/pull/91686
_______
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Add CMake dependency tracking for SBLanguages generation script (PR #91686)

2024-05-09 Thread Alex Langford via lldb-commits

https://github.com/bulbazord created 
https://github.com/llvm/llvm-project/pull/91686

If you change the generation script and re-run ninja (or whatever drives your 
build), it currently will not regenerate SBLanguages.h. With dependency 
tracking, it should re-run when the script changes.

>From ba9f8753702fee417f2d00321a40d80dfb025795 Mon Sep 17 00:00:00 2001
From: Alex Langford 
Date: Thu, 9 May 2024 17:37:08 -0700
Subject: [PATCH] [lldb] Add CMake dependency tracking for SBLanguages
 generation script

If you change the generation script and re-run ninja (or whatever
drives your build), it currently will not regenerate SBLanguages.h.
With dependency tracking, it should re-run when the script changes.
---
 lldb/source/API/CMakeLists.txt | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt
index aa31caddfde3a..76b42ecf63f91 100644
--- a/lldb/source/API/CMakeLists.txt
+++ b/lldb/source/API/CMakeLists.txt
@@ -23,14 +23,17 @@ endif()
 # Generate SBLanguages.h from Dwarf.def.
 set(sb_languages_file
   ${CMAKE_CURRENT_BINARY_DIR}/../../include/lldb/API/SBLanguages.h)
+set(sb_languages_generator
+  ${LLDB_SOURCE_DIR}/scripts/generate-sbapi-dwarf-enum.py)
 add_custom_command(
   COMMENT "Generating SBLanguages.h from Dwarf.def"
   COMMAND "${Python3_EXECUTABLE}"
-  ${LLDB_SOURCE_DIR}/scripts/generate-sbapi-dwarf-enum.py
+  ${sb_languages_generator}
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/BinaryFormat/Dwarf.def
   -o ${sb_languages_file}
   OUTPUT ${sb_languages_file}
   DEPENDS ${LLVM_MAIN_INCLUDE_DIR}/llvm/BinaryFormat/Dwarf.def
+  ${sb_languages_generator}
   WORKING_DIRECTORY ${LLVM_LIBRARY_OUTPUT_INTDIR}
 )
 add_custom_target(lldb-sbapi-dwarf-enums

_______
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Put SBSourceLanguageName in lldb namespace (PR #91685)

2024-05-09 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Alex Langford (bulbazord)


Changes



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


1 Files Affected:

- (modified) lldb/scripts/generate-sbapi-dwarf-enum.py (+4) 


``diff
diff --git a/lldb/scripts/generate-sbapi-dwarf-enum.py 
b/lldb/scripts/generate-sbapi-dwarf-enum.py
index f7a13e5efffef..7fd6037986317 100755
--- a/lldb/scripts/generate-sbapi-dwarf-enum.py
+++ b/lldb/scripts/generate-sbapi-dwarf-enum.py
@@ -15,6 +15,8 @@
 
 #ifndef LLDB_API_SBLANGUAGE_H
 #define LLDB_API_SBLANGUAGE_H
+
+namespace lldb {
 /// Used by \\ref SBExpressionOptions.
 /// These enumerations use the same language enumerations as the DWARF
 /// specification for ease of use and consistency.
@@ -24,6 +26,8 @@
 FOOTER = """\
 };
 
+} // namespace lldb
+
 #endif
 """
 

``




https://github.com/llvm/llvm-project/pull/91685
_______
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Put SBSourceLanguageName in lldb namespace (PR #91685)

2024-05-09 Thread Alex Langford via lldb-commits

https://github.com/bulbazord created 
https://github.com/llvm/llvm-project/pull/91685

None

>From 6c2ea1ff493a55fc4713c4bc58ef6e659e1c7b9d Mon Sep 17 00:00:00 2001
From: Alex Langford 
Date: Thu, 9 May 2024 17:27:42 -0700
Subject: [PATCH] [lldb] Put SBSourceLanguageName in lldb namespace

---
 lldb/scripts/generate-sbapi-dwarf-enum.py | 4 
 1 file changed, 4 insertions(+)

diff --git a/lldb/scripts/generate-sbapi-dwarf-enum.py 
b/lldb/scripts/generate-sbapi-dwarf-enum.py
index f7a13e5efffef..7fd6037986317 100755
--- a/lldb/scripts/generate-sbapi-dwarf-enum.py
+++ b/lldb/scripts/generate-sbapi-dwarf-enum.py
@@ -15,6 +15,8 @@
 
 #ifndef LLDB_API_SBLANGUAGE_H
 #define LLDB_API_SBLANGUAGE_H
+
+namespace lldb {
 /// Used by \\ref SBExpressionOptions.
 /// These enumerations use the same language enumerations as the DWARF
 /// specification for ease of use and consistency.
@@ -24,6 +26,8 @@
 FOOTER = """\
 };
 
+} // namespace lldb
+
 #endif
 """
 

_______
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[clang] [clang][driver] Support `-x` for all languages in CL mode (PR #89772)

2024-05-09 Thread Fangrui Song via cfe-commits

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


https://github.com/llvm/llvm-project/pull/89772
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[llvm-branch-commits] Reapply "[llvm][RISCV] Enable trailing fences for seq-cst stores by default (#87376)" (PR #90267)

2024-05-09 Thread Paul Kirth via llvm-branch-commits

https://github.com/ilovepi updated 
https://github.com/llvm/llvm-project/pull/90267


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] Reapply "[llvm][RISCV] Enable trailing fences for seq-cst stores by default (#87376)" (PR #90267)

2024-05-09 Thread Paul Kirth via llvm-branch-commits

https://github.com/ilovepi updated 
https://github.com/llvm/llvm-project/pull/90267


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[jenkinsci/stapler] c0a321: Organize imports (#539)

2024-05-09 Thread 'Basil Crow' via Jenkins Commits
/Issue76Test.java
M jelly/src/test/java/org/kohsuke/stapler/jelly/issue76/ProtectedClass.java
M jrebel/src/main/java/org/kohsuke/stapler/JRebelFacet.java
M jsp/src/main/java/org/kohsuke/stapler/jsp/JSPFacet.java
M jsp/src/main/java/org/kohsuke/stapler/jsp/RequestDispatcherWrapper.java
M jsp/src/main/java/org/kohsuke/stapler/tags/Include.java

  Log Message:
  ---
  Organize imports (#539)



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/stapler/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/stapler/push/refs/heads/master/031987-c0a321%40github.com.


[jenkinsci/google-oauth-plugin]

2024-05-09 Thread 'dependabot[bot]' via Jenkins Commits
  Branch: refs/heads/dependabot/maven/com.google.cloud-libraries-bom-26.38.0
  Home:   https://github.com/jenkinsci/google-oauth-plugin

To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/google-oauth-plugin/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/google-oauth-plugin/push/refs/heads/dependabot/maven/com.google.cloud-libraries-bom-26.38.0/78d310-00%40github.com.


[jenkinsci/google-oauth-plugin] 747c40: Bump com.google.cloud:libraries-bom from 26.1.1 to...

2024-05-09 Thread 'dependabot[bot]' via Jenkins Commits
  Branch: refs/heads/dependabot/maven/com.google.cloud-libraries-bom-26.39.0
  Home:   https://github.com/jenkinsci/google-oauth-plugin
  Commit: 747c40350f33b1e975a248a4959cd93b9e8fd66f
  
https://github.com/jenkinsci/google-oauth-plugin/commit/747c40350f33b1e975a248a4959cd93b9e8fd66f
  Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  Date:   2024-05-10 (Fri, 10 May 2024)

  Changed paths:
M pom.xml

  Log Message:
  ---
  Bump com.google.cloud:libraries-bom from 26.1.1 to 26.39.0

Bumps 
[com.google.cloud:libraries-bom](https://github.com/googleapis/java-cloud-bom) 
from 26.1.1 to 26.39.0.
- [Release notes](https://github.com/googleapis/java-cloud-bom/releases)
- 
[Changelog](https://github.com/googleapis/java-cloud-bom/blob/main/release-please-config.json)
- 
[Commits](https://github.com/googleapis/java-cloud-bom/compare/libraries-bom-v26.1.1...v26.39.0)

---
updated-dependencies:
- dependency-name: com.google.cloud:libraries-bom
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] 



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/google-oauth-plugin/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/google-oauth-plugin/push/refs/heads/dependabot/maven/com.google.cloud-libraries-bom-26.39.0/00-747c40%40github.com.


[llvm-branch-commits] [llvm] release/18.x: [InstSimplify] Do not simplify freeze in `simplifyWithOpReplaced` (#91215) (PR #91419)

2024-05-09 Thread Yingwei Zheng via llvm-branch-commits

dtcxzyw wrote:

@AtariDreams Please don't rebase your patch unless there are some conflicts to 
be resolved.

At least you should tell us what you did. 



https://github.com/llvm/llvm-project/pull/91419
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] release/18.x: [DAGCombiner] In mergeTruncStore, make sure we aren't storing shifted in bits. (#90939) (PR #91038)

2024-05-09 Thread via llvm-branch-commits

AtariDreams wrote:

We do not need to know how to fold every single possible permutation that comes 
our way, especially if they are so rare that writing compile code optimizing it 
isn't even worth it. We do, however, need to strive to avoid miscompiles 
wherever we can, no matter how esoteric the code is.

Now, this isn't always possible, but in this case, the alternative codepath 
given just bails the transform, which is preferable to folding something that 
should not be.

https://github.com/llvm/llvm-project/pull/91038
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[Lldb-commits] [lldb] [lldb][breakpoint] Grey out disabled breakpoints (PR #91404)

2024-05-09 Thread Chelsea Cassanova via lldb-commits

https://github.com/chelcassanova updated 
https://github.com/llvm/llvm-project/pull/91404

>From 0e45adeac968aa435f58dfef026ef308e56b40a5 Mon Sep 17 00:00:00 2001
From: Chelsea Cassanova 
Date: Thu, 9 May 2024 11:08:29 -0700
Subject: [PATCH] [lldb][breakpoint] Grey out disabled breakpoints

This commit adds colour settings to the list of breakpoints in order to
grey out breakpoints that have been disabled.
---
 lldb/source/Breakpoint/Breakpoint.cpp | 12 
 1 file changed, 12 insertions(+)

diff --git a/lldb/source/Breakpoint/Breakpoint.cpp 
b/lldb/source/Breakpoint/Breakpoint.cpp
index ae845e92762b9..8d28c5f1873e1 100644
--- a/lldb/source/Breakpoint/Breakpoint.cpp
+++ b/lldb/source/Breakpoint/Breakpoint.cpp
@@ -15,6 +15,7 @@
 #include "lldb/Breakpoint/BreakpointResolver.h"
 #include "lldb/Breakpoint/BreakpointResolverFileLine.h"
 #include "lldb/Core/Address.h"
+#include "lldb/Core/Debugger.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleList.h"
 #include "lldb/Core/SearchFilter.h"
@@ -26,6 +27,7 @@
 #include "lldb/Target/SectionLoadList.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/ThreadSpec.h"
+#include "lldb/Utility/AnsiTerminal.h"
 #include "lldb/Utility/LLDBLog.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/Stream.h"
@@ -837,6 +839,12 @@ void Breakpoint::GetDescription(Stream *s, 
lldb::DescriptionLevel level,
 bool show_locations) {
   assert(s != nullptr);
 
+  // Grey out any disabled breakpoints in the list of breakpoints.
+  const bool print_faint =
+  (!IsEnabled() && GetTarget().GetDebugger().GetUseColor());
+  if (print_faint)
+s->Printf("%s", ansi::FormatAnsiTerminalCodes("${ansi.faint}").c_str());
+
   if (!m_kind_description.empty()) {
 if (level == eDescriptionLevelBrief) {
   s->PutCString(GetBreakpointKind());
@@ -933,6 +941,10 @@ void Breakpoint::GetDescription(Stream *s, 
lldb::DescriptionLevel level,
 }
 s->IndentLess();
   }
+
+  // Reset the colors back to normal if they were previously greyed out.
+  if (print_faint)
+s->Printf("%s", ansi::FormatAnsiTerminalCodes("${ansi.normal}").c_str());
 }
 
 void Breakpoint::GetResolverDescription(Stream *s) {

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[llvm-branch-commits] [llvm] release/18.x: [DAGCombiner] In mergeTruncStore, make sure we aren't storing shifted in bits. (#90939) (PR #91038)

2024-05-09 Thread via llvm-branch-commits

AtariDreams wrote:

> @AtariDreams This bug has existed since at least LLVM 10. What makes it a 
> candidate for backporting?

At best, if the code triggers, we abort the fold, so there is no risk of 
anything crazy going on if this is added.

https://github.com/llvm/llvm-project/pull/91038
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[clang] [Clang][HLSL] Add environment parameter to availability attribute (PR #89809)

2024-05-09 Thread Helena Kotas via cfe-commits

https://github.com/hekota updated 
https://github.com/llvm/llvm-project/pull/89809

>From 22b67d30ca087d6a912183039c87fd1790eedfe4 Mon Sep 17 00:00:00 2001
From: Helena Kotas 
Date: Tue, 23 Apr 2024 00:49:28 -0700
Subject: [PATCH 1/7] Add environment parameter to clang availability attribute

---
 clang/include/clang/Basic/Attr.td |  33 +-
 clang/include/clang/Basic/AttrDocs.td |   2 +
 .../clang/Basic/DiagnosticParseKinds.td   |   2 +
 .../clang/Basic/DiagnosticSemaKinds.td|   5 +-
 clang/include/clang/Parse/Parser.h|   3 +
 clang/include/clang/Sema/ParsedAttr.h |  40 ---
 clang/include/clang/Sema/Sema.h   |   5 +-
 clang/lib/AST/DeclBase.cpp|  27 -
 clang/lib/Headers/hlsl/hlsl_intrinsics.h  |  13 ++-
 clang/lib/Index/CommentToXML.cpp  |   3 +
 clang/lib/Parse/ParseDecl.cpp |  20 +++-
 clang/lib/Sema/SemaAPINotes.cpp   |   3 +-
 clang/lib/Sema/SemaAvailability.cpp   | 109 +-
 clang/lib/Sema/SemaDecl.cpp   |   2 +-
 clang/lib/Sema/SemaDeclAttr.cpp   |  34 --
 15 files changed, 232 insertions(+), 69 deletions(-)

diff --git a/clang/include/clang/Basic/Attr.td 
b/clang/include/clang/Basic/Attr.td
index dc87a8c6f022d..1b07f4eb40809 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -956,7 +956,7 @@ def Availability : InheritableAttr {
   VersionArgument<"deprecated">, VersionArgument<"obsoleted">,
   BoolArgument<"unavailable">, StringArgument<"message">,
   BoolArgument<"strict">, StringArgument<"replacement">,
-  IntArgument<"priority">];
+  IntArgument<"priority">, IdentifierArgument<"environment">];
   let AdditionalMembers =
 [{static llvm::StringRef getPrettyPlatformName(llvm::StringRef Platform) {
 return llvm::StringSwitch(Platform)
@@ -976,7 +976,7 @@ def Availability : InheritableAttr {
  .Case("xros", "visionOS")
  .Case("xros_app_extension", "visionOS (App Extension)")
  .Case("swift", "Swift")
- .Case("shadermodel", "HLSL ShaderModel")
+ .Case("shadermodel", "HLSL Shader Model")
  .Case("ohos", "OpenHarmony OS")
  .Default(llvm::StringRef());
 }
@@ -1016,7 +1016,34 @@ static llvm::StringRef 
canonicalizePlatformName(llvm::StringRef Platform) {
  .Case("visionos_app_extension", "xros_app_extension")
  .Case("ShaderModel", "shadermodel")
  .Default(Platform);
-} }];
+}
+static llvm::StringRef getPrettyEnviromentName(llvm::StringRef Environment) {
+return llvm::StringSwitch(Environment)
+ .Case("pixel", "pixel shader")
+ .Case("vertex", "vertex shader")
+ .Case("geometry", "geometry shader")
+ .Case("hull", "hull shader")
+ .Case("domain", "domain shader")
+ .Case("compute", "compute shader")
+ .Case("mesh", "mesh shader")
+ .Case("amplification", "amplification shader")
+ .Case("library", "shader library")
+ .Default(Environment);
+}
+static llvm::Triple::EnvironmentType getEnvironmentType(llvm::StringRef 
Environment) {
+return llvm::StringSwitch(Environment)
+ .Case("pixel", llvm::Triple::Pixel)
+ .Case("vertex", llvm::Triple::Vertex)
+ .Case("geometry", llvm::Triple::Geometry)
+ .Case("hull", llvm::Triple::Hull)
+ .Case("domain", llvm::Triple::Domain)
+ .Case("compute", llvm::Triple::Compute)
+ .Case("mesh", llvm::Triple::Mesh)
+ .Case("amplification", llvm::Triple::Amplification)
+ .Case("library", llvm::Triple::Library)
+ .Default(llvm::Triple::UnknownEnvironment);
+}
+}];
   let HasCustomParsing = 1;
   let InheritEvenIfAlreadyPresent = 1;
   let Subjects = SubjectList<[Named]>;
diff --git a/clang/include/clang/Basic/AttrDocs.td 
b/clang/include/clang/Basic/AttrDocs.td
index a0bbe5861c572..a81163df35ca8 100644
--- a/clang/include/clang/Basic/AttrDocs.td
+++ b/clang/include/clang/Basic/AttrDocs.td
@@ -1593,6 +1593,8 @@ replacement=\ *string-literal*
   a warning about use of a deprecated declaration. The Fix-It will replace
   the deprecated declaration with the new declaration specified.
 
+// HEKOTA TODO add docs here
+
 Multiple availability attributes can be placed on a declaration, which may
 correspond to different platforms. For most platforms, the availability
 attribute with the platform corresponding to the target platform will be used;
diff --git a/clang/include/clang/Basic/DiagnosticParseKinds.td 
b/clang/include/clang/Basic/DiagnosticParseKinds.td
index 66405095d51de..631dc8880fcfc 100644
--- a/clang/include/clang/Basic/DiagnosticParseKinds.td
+++ b/clang/include/clang/Basic/DiagnosticParseKinds.td
@@ -1103,6 +1103,8 @@ def 

[llvm-branch-commits] [llvm] release/18.x Revert "[SLP]Fix a crash if the argument of call was affected by minbitwidth analysis." (PR #91682)

2024-05-09 Thread via llvm-branch-commits

https://github.com/AtariDreams updated 
https://github.com/llvm/llvm-project/pull/91682

>From add985216713a67b47e72ad967e21fd14df3e1d4 Mon Sep 17 00:00:00 2001
From: Rose 
Date: Thu, 9 May 2024 19:52:24 -0400
Subject: [PATCH] Revert "[SLP]Fix a crash if the argument of call was affected
 by minbitwidth analysis."

After reconsidering the words of @nikic, I have decided to revisit the patches 
I suggested be backported. Upon further analysis, I think there is a high 
likelihood that this change added to release 18.x was referencing a crash that 
was caused by a PR that isn't added.

I will, however, keep the test that was added just in case.

This reverts commit 6e071cf30599e821be56b75e6041cfedb7872216.
---
 .../Transforms/Vectorize/SLPVectorizer.cpp| 21 +--
 1 file changed, 1 insertion(+), 20 deletions(-)

diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp 
b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 1fbd69e38eaee..0a9e2c7f49f55 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -11653,12 +11653,12 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E, bool 
PostponedPHIs) {
   if (UseIntrinsic && isVectorIntrinsicWithOverloadTypeAtArg(ID, -1))
 TysForDecl.push_back(
 FixedVectorType::get(CI->getType(), E->Scalars.size()));
-  auto *CEI = cast(VL0);
   for (unsigned I : seq(0, CI->arg_size())) {
 ValueList OpVL;
 // Some intrinsics have scalar arguments. This argument should not be
 // vectorized.
 if (UseIntrinsic && isVectorIntrinsicWithScalarOpAtArg(ID, I)) {
+  CallInst *CEI = cast(VL0);
   ScalarArg = CEI->getArgOperand(I);
   OpVecs.push_back(CEI->getArgOperand(I));
   if (isVectorIntrinsicWithOverloadTypeAtArg(ID, I))
@@ -11671,25 +11671,6 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E, bool 
PostponedPHIs) {
   LLVM_DEBUG(dbgs() << "SLP: Diamond merged for " << *VL0 << ".\n");
   return E->VectorizedValue;
 }
-auto GetOperandSignedness = [&](unsigned Idx) {
-  const TreeEntry *OpE = getOperandEntry(E, Idx);
-  bool IsSigned = false;
-  auto It = MinBWs.find(OpE);
-  if (It != MinBWs.end())
-IsSigned = It->second.second;
-  else
-IsSigned = any_of(OpE->Scalars, [&](Value *R) {
-  return !isKnownNonNegative(R, SimplifyQuery(*DL));
-});
-  return IsSigned;
-};
-ScalarArg = CEI->getArgOperand(I);
-if (cast(OpVec->getType())->getElementType() !=
-ScalarArg->getType()) {
-  auto *CastTy = FixedVectorType::get(ScalarArg->getType(),
-  VecTy->getNumElements());
-  OpVec = Builder.CreateIntCast(OpVec, CastTy, 
GetOperandSignedness(I));
-}
 LLVM_DEBUG(dbgs() << "SLP: OpVec[" << I << "]: " << *OpVec << "\n");
 OpVecs.push_back(OpVec);
 if (UseIntrinsic && isVectorIntrinsicWithOverloadTypeAtArg(ID, I))

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] release/18.x Revert "[SLP]Fix a crash if the argument of call was affected by minbitwidth analysis." (PR #91682)

2024-05-09 Thread via llvm-branch-commits
MP10]], ptr [[TMP0]], align 1
-; CHECK-NEXT:br label [[PRE]]
-;
-entry:
-  %idx11 = getelementptr i8, ptr %0, i64 1
-  %idx22 = getelementptr i8, ptr %0, i64 2
-  %idx33 = getelementptr i8, ptr %0, i64 3
-  %idx44 = getelementptr i8, ptr %0, i64 4
-  %idx55 = getelementptr i8, ptr %0, i64 5
-  %idx66 = getelementptr i8, ptr %0, i64 6
-  %idx77 = getelementptr i8, ptr %0, i64 7
-  br label %pre
-
-pre:
-  %conv.i = zext i8 %1 to i32
-  %2 = tail call i32 @llvm.umax.i32(i32 %conv.i, i32 1)
-  %.sroa.speculated.i = add i32 %2, 1
-  %intensity.0.i = select i1 %cmp12.i, i32 %.sroa.speculated.i, i32 %conv.i
-  %conv14.i = trunc i32 %intensity.0.i to i8
-  store i8 %conv14.i, ptr %0, align 1
-  %conv.i.1 = zext i8 %1 to i32
-  %3 = tail call i32 @llvm.umax.i32(i32 %conv.i.1, i32 1)
-  %ss1 = add i32 %3, 1
-  %ii1 = select i1 %cmp12.i, i32 %ss1, i32 %conv.i.1
-  %conv14.i.1 = trunc i32 %ii1 to i8
-  store i8 %conv14.i.1, ptr %idx11, align 1
-  %conv.i.2 = zext i8 %1 to i32
-  %4 = tail call i32 @llvm.umax.i32(i32 %conv.i.2, i32 1)
-  %ss2 = add i32 %4, 1
-  %ii2 = select i1 %cmp12.i, i32 %ss2, i32 %conv.i.2
-  %conv14.i.2 = trunc i32 %ii2 to i8
-  store i8 %conv14.i.2, ptr %idx22, align 1
-  %conv.i.3 = zext i8 %1 to i32
-  %5 = tail call i32 @llvm.umax.i32(i32 %conv.i.3, i32 1)
-  %ss3 = add i32 %5, 1
-  %ii3 = select i1 %cmp12.i, i32 %ss3, i32 %conv.i.3
-  %conv14.i.3 = trunc i32 %ii3 to i8
-  store i8 %conv14.i.3, ptr %idx33, align 1
-  %conv.i.4 = zext i8 %1 to i32
-  %6 = tail call i32 @llvm.umax.i32(i32 %conv.i.4, i32 1)
-  %ss4 = add i32 %6, 1
-  %ii4 = select i1 %cmp12.i, i32 %ss4, i32 %conv.i.4
-  %conv14.i.4 = trunc i32 %ii4 to i8
-  store i8 %conv14.i.4, ptr %idx44, align 1
-  %conv.i.5 = zext i8 %1 to i32
-  %7 = tail call i32 @llvm.umax.i32(i32 %conv.i.5, i32 1)
-  %ss5 = add i32 %7, 1
-  %ii5 = select i1 %cmp12.i, i32 %ss5, i32 %conv.i.5
-  %conv14.i.5 = trunc i32 %ii5 to i8
-  store i8 %conv14.i.5, ptr %idx55, align 1
-  %conv.i.6 = zext i8 %1 to i32
-  %8 = tail call i32 @llvm.umax.i32(i32 %conv.i.6, i32 1)
-  %ss6 = add i32 %8, 1
-  %ii6 = select i1 %cmp12.i, i32 %ss6, i32 %conv.i.6
-  %conv14.i.6 = trunc i32 %ii6 to i8
-  store i8 %conv14.i.6, ptr %idx66, align 1
-  %conv.i.7 = zext i8 %1 to i32
-  %9 = tail call i32 @llvm.umax.i32(i32 %conv.i.7, i32 1)
-  %ss7 = add i32 %9, 1
-  %ii7 = select i1 %cmp12.i, i32 %ss7, i32 %conv.i.7
-  %conv14.i.7 = trunc i32 %ii7 to i8
-  store i8 %conv14.i.7, ptr %idx77, align 1
-  br label %pre
-}

``




https://github.com/llvm/llvm-project/pull/91682
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] release/18.x Revert "[SLP]Fix a crash if the argument of call was affected by minbitwidth analysis." (PR #91682)

2024-05-09 Thread via llvm-branch-commits

https://github.com/AtariDreams edited 
https://github.com/llvm/llvm-project/pull/91682
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] release/18.x Revert "[SLP]Fix a crash if the argument of call was affected by minbitwidth analysis." (PR #91682)

2024-05-09 Thread via llvm-branch-commits
-NEXT:[[TMP9:%.*]] = select <8 x i1> [[TMP3]], <8 x i32> [[TMP8]], 
<8 x i32> [[TMP6]]
-; CHECK-NEXT:[[TMP10:%.*]] = trunc <8 x i32> [[TMP9]] to <8 x i8>
-; CHECK-NEXT:store <8 x i8> [[TMP10]], ptr [[TMP0]], align 1
-; CHECK-NEXT:br label [[PRE]]
-;
-entry:
-  %idx11 = getelementptr i8, ptr %0, i64 1
-  %idx22 = getelementptr i8, ptr %0, i64 2
-  %idx33 = getelementptr i8, ptr %0, i64 3
-  %idx44 = getelementptr i8, ptr %0, i64 4
-  %idx55 = getelementptr i8, ptr %0, i64 5
-  %idx66 = getelementptr i8, ptr %0, i64 6
-  %idx77 = getelementptr i8, ptr %0, i64 7
-  br label %pre
-
-pre:
-  %conv.i = zext i8 %1 to i32
-  %2 = tail call i32 @llvm.umax.i32(i32 %conv.i, i32 1)
-  %.sroa.speculated.i = add i32 %2, 1
-  %intensity.0.i = select i1 %cmp12.i, i32 %.sroa.speculated.i, i32 %conv.i
-  %conv14.i = trunc i32 %intensity.0.i to i8
-  store i8 %conv14.i, ptr %0, align 1
-  %conv.i.1 = zext i8 %1 to i32
-  %3 = tail call i32 @llvm.umax.i32(i32 %conv.i.1, i32 1)
-  %ss1 = add i32 %3, 1
-  %ii1 = select i1 %cmp12.i, i32 %ss1, i32 %conv.i.1
-  %conv14.i.1 = trunc i32 %ii1 to i8
-  store i8 %conv14.i.1, ptr %idx11, align 1
-  %conv.i.2 = zext i8 %1 to i32
-  %4 = tail call i32 @llvm.umax.i32(i32 %conv.i.2, i32 1)
-  %ss2 = add i32 %4, 1
-  %ii2 = select i1 %cmp12.i, i32 %ss2, i32 %conv.i.2
-  %conv14.i.2 = trunc i32 %ii2 to i8
-  store i8 %conv14.i.2, ptr %idx22, align 1
-  %conv.i.3 = zext i8 %1 to i32
-  %5 = tail call i32 @llvm.umax.i32(i32 %conv.i.3, i32 1)
-  %ss3 = add i32 %5, 1
-  %ii3 = select i1 %cmp12.i, i32 %ss3, i32 %conv.i.3
-  %conv14.i.3 = trunc i32 %ii3 to i8
-  store i8 %conv14.i.3, ptr %idx33, align 1
-  %conv.i.4 = zext i8 %1 to i32
-  %6 = tail call i32 @llvm.umax.i32(i32 %conv.i.4, i32 1)
-  %ss4 = add i32 %6, 1
-  %ii4 = select i1 %cmp12.i, i32 %ss4, i32 %conv.i.4
-  %conv14.i.4 = trunc i32 %ii4 to i8
-  store i8 %conv14.i.4, ptr %idx44, align 1
-  %conv.i.5 = zext i8 %1 to i32
-  %7 = tail call i32 @llvm.umax.i32(i32 %conv.i.5, i32 1)
-  %ss5 = add i32 %7, 1
-  %ii5 = select i1 %cmp12.i, i32 %ss5, i32 %conv.i.5
-  %conv14.i.5 = trunc i32 %ii5 to i8
-  store i8 %conv14.i.5, ptr %idx55, align 1
-  %conv.i.6 = zext i8 %1 to i32
-  %8 = tail call i32 @llvm.umax.i32(i32 %conv.i.6, i32 1)
-  %ss6 = add i32 %8, 1
-  %ii6 = select i1 %cmp12.i, i32 %ss6, i32 %conv.i.6
-  %conv14.i.6 = trunc i32 %ii6 to i8
-  store i8 %conv14.i.6, ptr %idx66, align 1
-  %conv.i.7 = zext i8 %1 to i32
-  %9 = tail call i32 @llvm.umax.i32(i32 %conv.i.7, i32 1)
-  %ss7 = add i32 %9, 1
-  %ii7 = select i1 %cmp12.i, i32 %ss7, i32 %conv.i.7
-  %conv14.i.7 = trunc i32 %ii7 to i8
-  store i8 %conv14.i.7, ptr %idx77, align 1
-  br label %pre
-}

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[clang-tools-extra] [clang-query] Load queries and matchers from file during REPL cycle (PR #90603)

2024-05-09 Thread Chris Warner via cfe-commits


@@ -281,5 +282,26 @@ const QueryKind SetQueryKind::value;
 const QueryKind SetQueryKind::value;
 #endif
 
+bool FileQuery::run(llvm::raw_ostream , QuerySession ) const {
+  auto Buffer = llvm::MemoryBuffer::getFile(StringRef{File}.trim());
+  if (!Buffer) {
+if (Prefix.has_value())
+  llvm::errs() << *Prefix << ": ";
+llvm::errs() << "cannot open " << File << ": "
+ << Buffer.getError().message() << "\n";

cwarner-8702 wrote:

Got any tips on using `TextDiagnostic`?  I am struggling to figure out what to 
pass as the `LangOptions` and `DiagnosticOptions` considering the error isn't 
coming from code per-se (getting the `ASTContext` from one of the `ASTUnit` 
objects and the options from it seems too hacky)

https://github.com/llvm/llvm-project/pull/90603
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang-query] Load queries and matchers from file during REPL cycle (PR #90603)

2024-05-09 Thread Chris Warner via cfe-commits
/dev/null
+++ b/clang-tools-extra/test/clang-query/Inputs/empty.script
@@ -0,0 +1 @@
+# This file intentionally has no queries
diff --git a/clang-tools-extra/test/clang-query/errors.c 
b/clang-tools-extra/test/clang-query/errors.c
index bbb742125744f..3b9059ab0257f 100644
--- a/clang-tools-extra/test/clang-query/errors.c
+++ b/clang-tools-extra/test/clang-query/errors.c
@@ -1,10 +1,12 @@
 // RUN: not clang-query -c foo -c bar %s -- | FileCheck %s
 // RUN: not clang-query -f %S/Inputs/foo.script %s -- | FileCheck %s
 // RUN: not clang-query -f %S/Inputs/nonexistent.script %s -- 2>&1 | FileCheck 
--check-prefix=CHECK-NONEXISTENT %s
+// RUN: not clang-query -c 'file %S/Inputs/nonexistent.script' %s -- 2>&1 | 
FileCheck --check-prefix=CHECK-NONEXISTENT-FILEQUERY %s
 // RUN: not clang-query -c foo -f foo %s -- 2>&1 | FileCheck 
--check-prefix=CHECK-BOTH %s
 
 // CHECK: unknown command: foo
 // CHECK-NOT: unknown command: bar
 
 // CHECK-NONEXISTENT: cannot open {{.*}}nonexistent.script
+// CHECK-NONEXISTENT-FILEQUERY: cannot open {{.*}}nonexistent.script
 // CHECK-BOTH: cannot specify both -c and -f
diff --git a/clang-tools-extra/test/clang-query/file-empty.c 
b/clang-tools-extra/test/clang-query/file-empty.c
new file mode 100644
index 0..15137c57e915e
--- /dev/null
+++ b/clang-tools-extra/test/clang-query/file-empty.c
@@ -0,0 +1,2 @@
+// RUN: clang-query -c 'file %S/Inputs/empty.script' %s --
+// COM: no output expected; nothing to CHECK

>From 5e3b8f2cedf2829f85ae83068376151fbf13851d Mon Sep 17 00:00:00 2001
From: Chris Warner 
Date: Thu, 9 May 2024 16:50:06 -0700
Subject: [PATCH 3/4] CR: add additional commands to dyn file

---
 .../test/clang-query/Inputs/runtime_file.script | 6 +-
 clang-tools-extra/test/clang-query/file-query.c | 5 -
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/clang-tools-extra/test/clang-query/Inputs/runtime_file.script 
b/clang-tools-extra/test/clang-query/Inputs/runtime_file.script
index 5272580f4c965..714d7f03b1bf6 100644
--- a/clang-tools-extra/test/clang-query/Inputs/runtime_file.script
+++ b/clang-tools-extra/test/clang-query/Inputs/runtime_file.script
@@ -1 +1,5 @@
-m functionDecl()
+set bind-root false
+
+l func functionDecl(hasName("bar"))
+m func.bind("f")
+m varDecl().bind("v")
\ No newline at end of file
diff --git a/clang-tools-extra/test/clang-query/file-query.c 
b/clang-tools-extra/test/clang-query/file-query.c
index 6bd3fd204cb8a..2824865558ba9 100644
--- a/clang-tools-extra/test/clang-query/file-query.c
+++ b/clang-tools-extra/test/clang-query/file-query.c
@@ -7,5 +7,8 @@
 
 // RUN: clang-query -c 'file %/t/file.script.temp' %s -- | FileCheck %s
 
-// CHECK: file-query.c:11:1: note: "root" binds here
+// CHECK: file-query.c:11:1: note: "f" binds here
 void bar(void) {}
+
+// CHECK: file-query.c:14:1: note: "v" binds here
+int baz{1};
\ No newline at end of file

>From e199cbc755246883fab15a0a8d4c2c8150f12d94 Mon Sep 17 00:00:00 2001
From: Chris Warner 
Date: Thu, 9 May 2024 16:50:48 -0700
Subject: [PATCH 4/4] CR: add release note

---
 clang-tools-extra/docs/ReleaseNotes.rst | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/clang-tools-extra/docs/ReleaseNotes.rst 
b/clang-tools-extra/docs/ReleaseNotes.rst
index 28840b9beae88..30558f55d4995 100644
--- a/clang-tools-extra/docs/ReleaseNotes.rst
+++ b/clang-tools-extra/docs/ReleaseNotes.rst
@@ -87,7 +87,9 @@ Improvements to clang-doc
 Improvements to clang-query
 ---
 
-The improvements are...
+- Added the `file` command to dynamically load a list of commands and matchers
+  from an external file, allowing the cost of reading the compilation database
+  and building the AST to be imposed just once for faster prototyping.
 
 Improvements to clang-rename
 

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang] Fix incorrect passing of _BitInt args (PR #90741)

2024-05-09 Thread Eli Friedman via cfe-commits


@@ -0,0 +1,14 @@
+// REQUIRES: arm-registered-target
+// RUN: %clang_cc1 -triple aarch64-none-elf \
+// RUN:   -O2 \
+// RUN:   -emit-llvm -fexperimental-max-bitint-width=1024 -o - %s | FileCheck 
%s

efriedma-quic wrote:

Can we integrate this into some existing test file for aarch64 calling 
conventions?

https://github.com/llvm/llvm-project/pull/90741
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[llvm-branch-commits] [llvm] release/18.x: [DAGCombiner] In mergeTruncStore, make sure we aren't storing shifted in bits. (#90939) (PR #91038)

2024-05-09 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-backend-aarch64

Author: AtariDreams (AtariDreams)


Changes

When looking through a right shift, we need to make sure that all of the bits 
we are using from the shift come from the shift input and not the sign or zero 
bits that are shifted in.

Fixes #90936.

(cherry picked from commit 3563af6c06ebc92bcaacef0e33285148ef0f75bd)

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


2 Files Affected:

- (modified) llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (+4) 
- (added) llvm/test/CodeGen/AArch64/pr90936.ll (+20) 


``diff
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp 
b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 5038f8a1fc156..4951e45edb9ed 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -8952,6 +8952,10 @@ SDValue DAGCombiner::mergeTruncStores(StoreSDNode *N) {
   if (ShiftAmtC % NarrowNumBits != 0)
 return SDValue();
 
+  // Make sure we aren't reading bits that are shifted in.
+  if (ShiftAmtC > WideVal.getScalarValueSizeInBits() - NarrowNumBits)
+return SDValue();
+
   Offset = ShiftAmtC / NarrowNumBits;
   WideVal = WideVal.getOperand(0);
 }
diff --git a/llvm/test/CodeGen/AArch64/pr90936.ll 
b/llvm/test/CodeGen/AArch64/pr90936.ll
new file mode 100644
index 0..38cda8d388945
--- /dev/null
+++ b/llvm/test/CodeGen/AArch64/pr90936.ll
@@ -0,0 +1,20 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 
UTC_ARGS: --version 4
+; RUN: llc < %s -mtriple=aarch64 | FileCheck %s
+
+define void @f(i16 %arg, ptr %arg1) {
+; CHECK-LABEL: f:
+; CHECK:   // %bb.0:
+; CHECK-NEXT:ubfx w8, w0, #8, #6
+; CHECK-NEXT:strb w0, [x1]
+; CHECK-NEXT:strb w8, [x1, #1]
+; CHECK-NEXT:ret
+bb:
+  %i = trunc i16 %arg to i8
+  %i2 = trunc i16 %arg to i14
+  %i3 = lshr i14 %i2, 8
+  store i8 %i, ptr %arg1, align 1
+  %i4 = getelementptr i8, ptr %arg1, i64 1
+  %i5 = trunc i14 %i3 to i8
+  store i8 %i5, ptr %i4, align 1
+  ret void
+}

``




https://github.com/llvm/llvm-project/pull/91038
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[jenkinsci/ivy-plugin] cbaca5: Bump org.jenkins-ci.plugins:plugin from 4.81 to 4....

2024-05-09 Thread 'dependabot[bot]' via Jenkins Commits
  Branch: refs/heads/master
  Home:   https://github.com/jenkinsci/ivy-plugin
  Commit: cbaca583ce5d3cc640432f0775d0fa73d19c792b
  
https://github.com/jenkinsci/ivy-plugin/commit/cbaca583ce5d3cc640432f0775d0fa73d19c792b
  Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  Date:   2024-05-09 (Thu, 09 May 2024)

  Changed paths:
M pom.xml

  Log Message:
  ---
  Bump org.jenkins-ci.plugins:plugin from 4.81 to 4.82 (#96)



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/ivy-plugin/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/ivy-plugin/push/refs/heads/master/e2e543-cbaca5%40github.com.


[llvm-branch-commits] [llvm] release/18.x: [AArch64][SelectionDAG] Mask for SUBS with multiple users cannot be elided (#90911) (PR #91151)

2024-05-09 Thread via llvm-branch-commits

https://github.com/AtariDreams updated 
https://github.com/llvm/llvm-project/pull/91151

>From b3d50315c9cda097b881d06e23c1e71e945658f6 Mon Sep 17 00:00:00 2001
From: Weihang Fan <134108011+weihangf-ap...@users.noreply.github.com>
Date: Sun, 5 May 2024 04:01:13 -0700
Subject: [PATCH] [AArch64][SelectionDAG] Mask for SUBS with multiple users
 cannot be elided (#90911)

In DAGCombiner, the `performCONDCombine` function attempts to remove AND
instructions in front of SUBS (cmp) instructions for which the AND is
transparent. The rules for that are correct, but it fails to take into
account the case where the SUBS instruction has multiple users with
different condition codes for comparison and simply removes the AND for
all of them. This causes a miscompilation in the attached test case.

(cherry picked from commit 72eaa0ed9934bfaa2449091bbc6e45648d1396d6)
---
 .../Target/AArch64/AArch64ISelLowering.cpp|  3 ++-
 llvm/test/CodeGen/AArch64/and-mask-removal.ll | 22 +++
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp 
b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index 95d8ab95b2c09..bcfd0253e73c8 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -22122,7 +22122,8 @@ SDValue performCONDCombine(SDNode *N,
   SDNode *SubsNode = N->getOperand(CmpIndex).getNode();
   unsigned CondOpcode = SubsNode->getOpcode();
 
-  if (CondOpcode != AArch64ISD::SUBS || SubsNode->hasAnyUseOfValue(0))
+  if (CondOpcode != AArch64ISD::SUBS || SubsNode->hasAnyUseOfValue(0) ||
+  !SubsNode->hasOneUse())
 return SDValue();
 
   // There is a SUBS feeding this condition. Is it fed by a mask we can
diff --git a/llvm/test/CodeGen/AArch64/and-mask-removal.ll 
b/llvm/test/CodeGen/AArch64/and-mask-removal.ll
index 17ff015970168..a31355549ba87 100644
--- a/llvm/test/CodeGen/AArch64/and-mask-removal.ll
+++ b/llvm/test/CodeGen/AArch64/and-mask-removal.ll
@@ -526,4 +526,26 @@ define i64 @pr58109b(i8 signext %0, i64 %a, i64 %b) {
   ret i64 %4
 }
 
+define i64 @test_2_selects(i8 zeroext %a) {
+; CHECK-LABEL: test_2_selects:
+; CHECK:   ; %bb.0:
+; CHECK-NEXT:add w9, w0, #24
+; CHECK-NEXT:mov w8, #131
+; CHECK-NEXT:and w9, w9, #0xff
+; CHECK-NEXT:cmp w9, #81
+; CHECK-NEXT:mov w9, #57
+; CHECK-NEXT:csel x8, x8, xzr, lo
+; CHECK-NEXT:csel x9, xzr, x9, eq
+; CHECK-NEXT:add x0, x8, x9
+; CHECK-NEXT:ret
+  %1 = add i8 %a, 24
+  %2 = zext i8 %1 to i64
+  %3 = icmp ult i8 %1, 81
+  %4 = select i1 %3, i64 131, i64 0
+  %5 = icmp eq i8 %1, 81
+  %6 = select i1 %5, i64 0, i64 57
+  %7 = add i64 %4, %6
+  ret i64 %7
+}
+
 declare i8 @llvm.usub.sat.i8(i8, i8) #0

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] release/18.x: [DAGCombiner] In mergeTruncStore, make sure we aren't storing shifted in bits. (#90939) (PR #91038)

2024-05-09 Thread via llvm-branch-commits

https://github.com/AtariDreams updated 
https://github.com/llvm/llvm-project/pull/91038

>From 4f8b0b5ef6a16648aa42a10bbf8c0e18ddd1a577 Mon Sep 17 00:00:00 2001
From: Craig Topper 
Date: Fri, 3 May 2024 09:59:33 -0700
Subject: [PATCH] [DAGCombiner] In mergeTruncStore, make sure we aren't storing
 shifted in bits. (#90939)

When looking through a right shift, we need to make sure that all of
the bits we are using from the shift come from the shift input and
not the sign or zero bits that are shifted in.

Fixes #90936.

(cherry picked from commit 3563af6c06ebc92bcaacef0e33285148ef0f75bd)
---
 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp |  4 
 llvm/test/CodeGen/AArch64/pr90936.ll  | 20 +++
 2 files changed, 24 insertions(+)
 create mode 100644 llvm/test/CodeGen/AArch64/pr90936.ll

diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp 
b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 5038f8a1fc156..4951e45edb9ed 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -8952,6 +8952,10 @@ SDValue DAGCombiner::mergeTruncStores(StoreSDNode *N) {
   if (ShiftAmtC % NarrowNumBits != 0)
 return SDValue();
 
+  // Make sure we aren't reading bits that are shifted in.
+  if (ShiftAmtC > WideVal.getScalarValueSizeInBits() - NarrowNumBits)
+return SDValue();
+
   Offset = ShiftAmtC / NarrowNumBits;
   WideVal = WideVal.getOperand(0);
 }
diff --git a/llvm/test/CodeGen/AArch64/pr90936.ll 
b/llvm/test/CodeGen/AArch64/pr90936.ll
new file mode 100644
index 0..38cda8d388945
--- /dev/null
+++ b/llvm/test/CodeGen/AArch64/pr90936.ll
@@ -0,0 +1,20 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 
UTC_ARGS: --version 4
+; RUN: llc < %s -mtriple=aarch64 | FileCheck %s
+
+define void @f(i16 %arg, ptr %arg1) {
+; CHECK-LABEL: f:
+; CHECK:   // %bb.0:
+; CHECK-NEXT:ubfx w8, w0, #8, #6
+; CHECK-NEXT:strb w0, [x1]
+; CHECK-NEXT:strb w8, [x1, #1]
+; CHECK-NEXT:ret
+bb:
+  %i = trunc i16 %arg to i8
+  %i2 = trunc i16 %arg to i14
+  %i3 = lshr i14 %i2, 8
+  store i8 %i, ptr %arg1, align 1
+  %i4 = getelementptr i8, ptr %arg1, i64 1
+  %i5 = trunc i14 %i3 to i8
+  store i8 %i5, ptr %i4, align 1
+  ret void
+}

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] release/18.x: [LV, LAA] Don't vectorize loops with load and store to invar address. (PR #91092)

2024-05-09 Thread via llvm-branch-commits
rue;
 }
 
 MemoryLocation Loc = MemoryLocation::get(LD);
@@ -2985,9 +2985,13 @@ void LoopAccessInfo::print(raw_ostream , unsigned 
Depth) const {
   PtrRtChecking->print(OS, Depth);
   OS << "\n";
 
-  OS.indent(Depth) << "Non vectorizable stores to invariant address were "
-   << (HasDependenceInvolvingLoopInvariantAddress ? "" : "not 
")
-   << "found in loop.\n";
+  OS.indent(Depth)
+  << "Non vectorizable stores to invariant address were "
+  << (HasStoreStoreDependenceInvolvingLoopInvariantAddress ||
+  HasLoadStoreDependenceInvolvingLoopInvariantAddress
+  ? ""
+  : "not ")
+  << "found in loop.\n";
 
   OS.indent(Depth) << "SCEV assumptions:\n";
   PSE->getPredicate().print(OS, Depth);
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp 
b/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
index 37a356c43e29a..cfd0c1b5e592d 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
@@ -1067,6 +1067,15 @@ bool LoopVectorizationLegality::canVectorizeMemory() {
   if (!LAI->canVectorizeMemory())
 return false;
 
+  if (LAI->hasLoadStoreDependenceInvolvingLoopInvariantAddress()) {
+reportVectorizationFailure("We don't allow storing to uniform addresses",
+   "write to a loop invariant address could not "
+   "be vectorized",
+   "CantVectorizeStoreToLoopInvariantAddress", ORE,
+   TheLoop);
+return false;
+  }
+
   // We can vectorize stores to invariant address when final reduction value is
   // guaranteed to be stored at the end of the loop. Also, if decision to
   // vectorize loop is made, runtime checks are added so as to make sure that
@@ -1102,13 +,12 @@ bool LoopVectorizationLegality::canVectorizeMemory() {
   }
 }
 
-if (LAI->hasDependenceInvolvingLoopInvariantAddress()) {
+if (LAI->hasStoreStoreDependenceInvolvingLoopInvariantAddress()) {
   // For each invariant address, check its last stored value is the result
   // of one of our reductions.
   //
-  // We do not check if dependence with loads exists because they are
-  // currently rejected earlier in LoopAccessInfo::analyzeLoop. In case 
this
-  // behaviour changes we have to modify this code.
+  // We do not check if dependence with loads exists because that is 
already
+  // checked via hasLoadStoreDependenceInvolvingLoopInvariantAddress.
   ScalarEvolution *SE = PSE.getSE();
   SmallVector UnhandledStores;
   for (StoreInst *SI : LAI->getStoresToInvariantAddresses()) {
diff --git 
a/llvm/test/Transforms/LoopVectorize/reduction-with-invariant-store.ll 
b/llvm/test/Transforms/LoopVectorize/reduction-with-invariant-store.ll
index 5584aa969367a..d5074f6a3b082 100644
--- a/llvm/test/Transforms/LoopVectorize/reduction-with-invariant-store.ll
+++ b/llvm/test/Transforms/LoopVectorize/reduction-with-invariant-store.ll
@@ -118,6 +118,40 @@ exit:
   ret void
 }
 
+; Check that if we have a read from an invariant address, we do not vectorize,
+; even if we vectorize with runtime checks. The test below is a variant of
+; @reduc_store_load with a non-constant dependence distance, resulting in
+; vectorization with runtime checks.
+;
+; CHECK-LABEL: @reduc_store_load_with_non_constant_distance_dependence
+; CHECK-NOT: vector.body:
+define void @reduc_store_load_with_non_constant_distance_dependence(ptr %dst, 
ptr noalias %dst.2, i64 %off) {
+entry:
+  %gep.dst = getelementptr inbounds i32, ptr %dst, i64 42
+  %dst.2.off = getelementptr inbounds i32, ptr %dst.2, i64 %off
+  store i32 0, ptr %gep.dst, align 4
+  br label %for.body
+
+for.body:
+  %sum = phi i32 [ 0, %entry ], [ %add, %for.body ]
+  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
+  %gep.src = getelementptr inbounds i32, ptr %dst.2, i64 %iv
+  %0 = load i32, ptr %gep.src, align 4
+  %iv.off = mul i64 %iv, 2
+  %add = add nsw i32 %sum, %0
+  %lv = load i32, ptr %gep.dst
+  store i32 %add, ptr %gep.dst, align 4
+  %gep.src.2 = getelementptr inbounds i32, ptr %dst.2.off, i64 %iv
+  store i32 %lv, ptr %gep.src.2, align 4
+  %iv.next = add nuw nsw i64 %iv, 1
+  %exitcond = icmp eq i64 %iv.next, 1000
+  br i1 %exitcond, label %exit, label %for.body
+
+exit:
+  ret void
+}
+
+
 ; Final value is not guaranteed to be stored in an invariant address.
 ; We don't vectorize in that case.
 ;

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] release/18.x: [InstSimplify] Do not simplify freeze in `simplifyWithOpReplaced` (#91215) (PR #91419)

2024-05-09 Thread via llvm-branch-commits
s/PGOProfile/chr.ll
@@ -1298,11 +1298,12 @@ define i32 @test_chr_14(ptr %i, ptr %j, i32 %sum0, i1 
%pred, i32 %z) !prof !14 {
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:[[Z_FR:%.*]] = freeze i32 [[Z:%.*]]
 ; CHECK-NEXT:[[I0:%.*]] = load i32, ptr [[I:%.*]], align 4
-; CHECK-NEXT:[[V1:%.*]] = icmp eq i32 [[Z_FR]], 1
-; CHECK-NEXT:br i1 [[V1]], label [[BB1:%.*]], label 
[[ENTRY_SPLIT_NONCHR:%.*]], !prof [[PROF15]]
+; CHECK-NEXT:[[V1_NOT:%.*]] = icmp eq i32 [[Z_FR]], 1
+; CHECK-NEXT:br i1 [[V1_NOT]], label [[BB1:%.*]], label 
[[ENTRY_SPLIT_NONCHR:%.*]], !prof [[PROF15]]
 ; CHECK:   entry.split.nonchr:
+; CHECK-NEXT:[[PRED_FR:%.*]] = freeze i1 [[PRED:%.*]]
 ; CHECK-NEXT:[[V0:%.*]] = icmp eq i32 [[Z_FR]], 0
-; CHECK-NEXT:[[V3_NONCHR:%.*]] = and i1 [[V0]], [[PRED:%.*]]
+; CHECK-NEXT:[[V3_NONCHR:%.*]] = and i1 [[V0]], [[PRED_FR]]
 ; CHECK-NEXT:br i1 [[V3_NONCHR]], label [[BB0_NONCHR:%.*]], label [[BB1]], 
!prof [[PROF16]]
 ; CHECK:   bb0.nonchr:
 ; CHECK-NEXT:call void @foo()

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[clang] [llvm] [AArch64] Add intrinsics for bfloat16 min/max/minnm/maxnm (PR #90105)

2024-05-09 Thread Hassnaa Hamdi via cfe-commits

https://github.com/hassnaaHamdi edited 
https://github.com/llvm/llvm-project/pull/90105
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[llvm-branch-commits] [llvm] [BOLT][NFCI] Fix return type of BC::getSignedValueAtAddress (PR #91664)

2024-05-09 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov updated 
https://github.com/llvm/llvm-project/pull/91664

>From 8d97606325c0620edb2e7a169442e370a569be74 Mon Sep 17 00:00:00 2001
From: Amir Ayupov 
Date: Thu, 9 May 2024 16:35:22 -0700
Subject: [PATCH] clang-format

Created using spr 1.3.4
---
 bolt/lib/Core/BinaryContext.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bolt/lib/Core/BinaryContext.cpp b/bolt/lib/Core/BinaryContext.cpp
index 507b203ea9d8b..0a0c827c3a962 100644
--- a/bolt/lib/Core/BinaryContext.cpp
+++ b/bolt/lib/Core/BinaryContext.cpp
@@ -2213,7 +2213,7 @@ ErrorOr 
BinaryContext::getUnsignedValueAtAddress(uint64_t Address,
 }
 
 ErrorOr BinaryContext::getSignedValueAtAddress(uint64_t Address,
- size_t Size) const {
+size_t Size) const {
   const ErrorOr Section = getSectionForAddress(Address);
   if (!Section)
 return std::make_error_code(std::errc::bad_address);

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[clang] [llvm] [AArch64] Add intrinsics for bfloat16 min/max/minnm/maxnm (PR #90105)

2024-05-09 Thread Hassnaa Hamdi via cfe-commits

https://github.com/hassnaaHamdi edited 
https://github.com/llvm/llvm-project/pull/90105
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[llvm-branch-commits] [BOLT] Support POSSIBLE_PIC_FIXED_BRANCH (PR #91667)

2024-05-09 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov updated 
https://github.com/llvm/llvm-project/pull/91667


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [BOLT] Support POSSIBLE_PIC_FIXED_BRANCH (PR #91667)

2024-05-09 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov updated 
https://github.com/llvm/llvm-project/pull/91667


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [BOLT] Eliminate dead jump tables (PR #91666)

2024-05-09 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov updated 
https://github.com/llvm/llvm-project/pull/91666

>From 0166eb8ee85e2cdcb472502206ea4c13f49a6724 Mon Sep 17 00:00:00 2001
From: Amir Ayupov 
Date: Thu, 9 May 2024 16:31:17 -0700
Subject: [PATCH] deregisterJumpTable

Created using spr 1.3.4
---
 bolt/include/bolt/Core/BinaryContext.h | 5 +
 1 file changed, 5 insertions(+)

diff --git a/bolt/include/bolt/Core/BinaryContext.h 
b/bolt/include/bolt/Core/BinaryContext.h
index 4a59a581dfedb..f8bf29c674b54 100644
--- a/bolt/include/bolt/Core/BinaryContext.h
+++ b/bolt/include/bolt/Core/BinaryContext.h
@@ -430,6 +430,11 @@ class BinaryContext {
 return nullptr;
   }
 
+  /// Deregister JumpTable registered at a given \p Address.
+  bool deregisterJumpTable(uint64_t Address) {
+return JumpTables.erase(Address);
+  }
+
   unsigned getDWARFEncodingSize(unsigned Encoding) {
 if (Encoding == dwarf::DW_EH_PE_omit)
   return 0;

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[jenkinsci/jelly] 7ea7ec: Jakarta EE 9 transition

2024-05-09 Thread 'Basil Crow' via Jenkins Commits
  Branch: refs/heads/jakarta
  Home:   https://github.com/jenkinsci/jelly
  Commit: 7ea7ec6dc1e15a2a3ea546d38fa79f561b2bd557
  
https://github.com/jenkinsci/jelly/commit/7ea7ec6dc1e15a2a3ea546d38fa79f561b2bd557
  Author: Basil Crow 
  Date:   2024-05-09 (Thu, 09 May 2024)

  Changed paths:
M core/pom.xml
M core/src/main/java/org/apache/commons/jelly/servlet/JellyServlet.java
M 
core/src/main/java/org/apache/commons/jelly/servlet/JellyServletContext.java
M core/src/main/java/org/apache/commons/jelly/tags/core/ForEachTag.java
M core/src/main/resources/org/apache/commons/jelly/tags/Resources.properties
M 
jelly-tags/fmt/src/main/java/org/apache/commons/jelly/tags/fmt/TimeZoneTag.java

  Log Message:
  ---
  Jakarta EE 9 transition



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/jelly/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/jelly/push/refs/heads/jakarta/a7503c-7ea7ec%40github.com.


[jenkinsci/ivy-plugin] 39205f: Bump org.jenkins-ci.plugins:plugin from 4.81 to 4.82

2024-05-09 Thread 'dependabot[bot]' via Jenkins Commits
  Branch: refs/heads/dependabot/maven/org.jenkins-ci.plugins-plugin-4.82
  Home:   https://github.com/jenkinsci/ivy-plugin
  Commit: 39205f129e58738555346df8963cde2d4bbeb086
  
https://github.com/jenkinsci/ivy-plugin/commit/39205f129e58738555346df8963cde2d4bbeb086
  Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  Date:   2024-05-09 (Thu, 09 May 2024)

  Changed paths:
M pom.xml

  Log Message:
  ---
  Bump org.jenkins-ci.plugins:plugin from 4.81 to 4.82

Bumps [org.jenkins-ci.plugins:plugin](https://github.com/jenkinsci/plugin-pom) 
from 4.81 to 4.82.
- [Release notes](https://github.com/jenkinsci/plugin-pom/releases)
- [Changelog](https://github.com/jenkinsci/plugin-pom/blob/master/CHANGELOG.md)
- 
[Commits](https://github.com/jenkinsci/plugin-pom/compare/plugin-4.81...plugin-4.82)

---
updated-dependencies:
- dependency-name: org.jenkins-ci.plugins:plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] 



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/ivy-plugin/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/ivy-plugin/push/refs/heads/dependabot/maven/org.jenkins-ci.plugins-plugin-4.82/00-39205f%40github.com.


[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-09 Thread Yeoul Na via cfe-commits

rapidsna wrote:

> I've been thinking about this restriction. Why is this necessary? My 
> assumption was that applying counted_by to a pointer causes a bounds check on 
> an index into the pointer rather than its underlying type.

@bwendling It's because these types are not indexable really.

**void:**
`void` doesn't have a size and C standard doesn't allow indexing into `void *`. 
I understand `void *` can be indexable under a GNU extension, but I don't see 
not supporting it is a problem because we can use `__sized_by` to annotate 
`void *` to clearly indicate the byte size. We will upstream `__sized_by` 
support soon so you can use it for `void *`.

**function types**
Although, again, the GNU extension allows it, we don't really want to index 
into function pointers. We can still use `__sized_by` if we really need to.

**Incomplete structs**
You can't really index into an incomplete struct. Though as @apple-fcloutier 
mentioned, by the point when the pointer is actually indexed, you should have 
the complete type definition. Otherwise, indexing will be an error anyway. So 
we have been considering relaxing this requirement, and move the error point to 
where the pointer is actually used in a way it requires the concrete element 
size (e.g, places you would insert `__dynamic_builtin_object_size`, you need 
the element size to calculate the byte size; indexing into a pointer to 
incomplete struct is already an error). 

https://github.com/llvm/llvm-project/pull/90786
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[llvm-branch-commits] [lld] [llvm] release/18.x: [RISCV][lld] Set the type of TLSDESC relocation's referenced local symbol to STT_NOTYPE (PR #91678)

2024-05-09 Thread via llvm-branch-commits
EXT: ld  a3, 0x114(a2)
 # GD64-NEXT: addia0, a2, 0x114
 # GD64-NEXT: jalrt0, 0x0(a3)
 # GD64-NEXT: add a0, a0, tp
 
 ## &.got[c]-. = 0x23e0+24 - 0x1308 = 0x10f0
-# GD64-NEXT:   1308: auipc   a4, 0x1
+# GD64:1308: auipc   a4, 0x1
 # GD64-NEXT: ld  a5, 0xf0(a4)
 # GD64-NEXT: addia0, a4, 0xf0
 # GD64-NEXT: jalrt0, 0x0(a5)
@@ -83,7 +91,7 @@
 
 # NOREL: no relocations
 
-# LE64-LABEL: <.text>:
+# LE64-LABEL: <.Ltlsdesc_hi0>:
 ## st_value(a) = 8
 # LE64-NEXT: addizero, zero, 0x0
 # LE64-NEXT: addizero, zero, 0x0
@@ -91,12 +99,14 @@
 # LE64-NEXT: addia0, zero, 0x8
 # LE64-NEXT: add a0, a0, tp
 ## st_value(b) = 2047
+# LE64-LABEL: <.Ltlsdesc_hi1>:
 # LE64-NEXT: addizero, zero, 0x0
 # LE64-NEXT: addizero, zero, 0x0
 # LE64-NEXT: addizero, zero, 0x0
 # LE64-NEXT: addia0, zero, 0x7ff
 # LE64-NEXT: add a0, a0, tp
 ## st_value(c) = 2048
+# LE64-LABEL: <.Ltlsdesc_hi2>:
 # LE64-NEXT: addizero, zero, 0x0
 # LE64-NEXT: addizero, zero, 0x0
 # LE64-NEXT: lui a0, 0x1
@@ -110,18 +120,20 @@
 # IE64:   .got 0010 000123a8
 
 ## a and b are optimized to use LE. c is optimized to IE.
-# IE64-LABEL: <.text>:
+# IE64-LABEL: <.Ltlsdesc_hi0>:
 # IE64-NEXT: addizero, zero, 0x0
 # IE64-NEXT: addizero, zero, 0x0
 # IE64-NEXT: addizero, zero, 0x0
 # IE64-NEXT: addia0, zero, 0x8
 # IE64-NEXT: add a0, a0, tp
+# IE64-LABEL: <.Ltlsdesc_hi1>:
 # IE64-NEXT: addizero, zero, 0x0
 # IE64-NEXT: addizero, zero, 0x0
 # IE64-NEXT: addizero, zero, 0x0
 # IE64-NEXT: addia0, zero, 0x7ff
 # IE64-NEXT: add a0, a0, tp
 ## &.got[c]-. = 0x123a8+8 - 0x112b8 = 0x10f8
+# IE64-LABEL: <.Ltlsdesc_hi2>:
 # IE64-NEXT: addizero, zero, 0x0
 # IE64-NEXT: addizero, zero, 0x0
 # IE64-NEXT:  112b8: auipc   a0, 0x1
@@ -130,7 +142,7 @@
 
 # IE32:   .got 0008 00012248
 
-# IE32-LABEL: <.text>:
+# IE32-LABEL: <.Ltlsdesc_hi0>:
 ## st_value(a) = 8
 # IE32-NEXT: addizero, zero, 0x0
 # IE32-NEXT: addizero, zero, 0x0
@@ -138,12 +150,14 @@
 # IE32-NEXT: addia0, zero, 0x8
 # IE32-NEXT: add a0, a0, tp
 ## st_value(b) = 2047
+# IE32-LABEL: <.Ltlsdesc_hi1>:
 # IE32-NEXT: addizero, zero, 0x0
 # IE32-NEXT: addizero, zero, 0x0
 # IE32-NEXT: addizero, zero, 0x0
 # IE32-NEXT: addia0, zero, 0x7ff
 # IE32-NEXT: add a0, a0, tp
 ## &.got[c]-. = 0x12248+4 - 0x111cc = 0x1080
+# IE32-LABEL: <.Ltlsdesc_hi2>:
 # IE32-NEXT: addizero, zero, 0x0
 # IE32-NEXT: addizero, zero, 0x0
 # IE32-NEXT:  111cc: auipc   a0, 0x1
@@ -192,3 +206,19 @@ b:
 .tbss
 .globl c
 c: .zero 4
+
+#--- d.s
+.macro load dst, src
+.ifdef ELF32
+lw \dst, \src
+.else
+ld \dst, \src
+.endif
+.endm
+
+.Ltlsdesc_hi0:
+  auipca0, %tlsdesc_hi(foo)
+  load a1, %tlsdesc_load_lo(.Ltlsdesc_hi0)(a0)
+  addi a0, a0, %tlsdesc_add_lo(.Ltlsdesc_hi0)
+  jalr t0, 0(a1), %tlsdesc_call(.Ltlsdesc_hi0)
+  add  a1, a0, tp
diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp 
b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp
index 254a9a4bc0ef0..b8e0f3a867f40 100644
--- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp
+++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp
@@ -207,8 +207,6 @@ void RISCVMCExpr::fixELFSymbolsInTLSFixups(MCAssembler 
) const {
   case VK_RISCV_TLS_GOT_HI:
   case VK_RISCV_TLS_GD_HI:
   case VK_RISCV_TLSDESC_HI:
-  case VK_RISCV_TLSDESC_ADD_LO:
-  case VK_RISCV_TLSDESC_LOAD_LO:
 break;
   }
 
diff --git a/llvm/test/CodeGen/RISCV/tlsdesc-symbol.ll 
b/llvm/test/CodeGen/RISCV/tlsdesc-symbol.ll
new file mode 100644
index 0..23ba2ffb1ad76
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/tlsdesc-symbol.ll
@@ -0,0 +1,24 @@
+;; The test in this file do not appear in tls-models.ll because
+;; they are not auto-generated.
+; RUN: llc -mtriple=riscv64 -relocation-model=pic -enable-tlsdesc < %s \
+; RUN: | llvm-mc -triple=riscv64 -filetype=obj -o - \
+; RUN: | llvm-readelf --symbols - \
+; RUN: | FileCheck %s
+
+; RUN: llc -mtriple=riscv32 -relocation-model=pic -enable-tlsdesc < %s \
+; RUN: | llvm-mc -triple=riscv32 -filetype=obj -o - \
+; RUN: | llvm-readelf --symbols - \
+; RUN: | FileCheck %s
+
+; Check that TLS symbols are lowered correctly based on the specified
+; model. Make sure they're external to avoid them all being optimised to Local
+; Exec for the executable.
+
+@unspecified = external thread_local global i32
+
+define ptr @f1() nounwind {
+entry:
+  ret ptr @unspecified
+  ; CHECK: Symbol table '.symtab' contains 7 entries:
+  ; CHECK: TL

[llvm-branch-commits] [lld] [llvm] release/18.x: [RISCV][lld] Set the type of TLSDESC relocation's referenced local symbol to STT_NOTYPE (PR #91678)

2024-05-09 Thread via llvm-branch-commits
 GD64-NEXT: ld  a3, 0x114(a2)
 # GD64-NEXT: addia0, a2, 0x114
 # GD64-NEXT: jalrt0, 0x0(a3)
 # GD64-NEXT: add a0, a0, tp
 
 ## &.got[c]-. = 0x23e0+24 - 0x1308 = 0x10f0
-# GD64-NEXT:   1308: auipc   a4, 0x1
+# GD64:1308: auipc   a4, 0x1
 # GD64-NEXT: ld  a5, 0xf0(a4)
 # GD64-NEXT: addia0, a4, 0xf0
 # GD64-NEXT: jalrt0, 0x0(a5)
@@ -83,7 +91,7 @@
 
 # NOREL: no relocations
 
-# LE64-LABEL: <.text>:
+# LE64-LABEL: <.Ltlsdesc_hi0>:
 ## st_value(a) = 8
 # LE64-NEXT: addizero, zero, 0x0
 # LE64-NEXT: addizero, zero, 0x0
@@ -91,12 +99,14 @@
 # LE64-NEXT: addia0, zero, 0x8
 # LE64-NEXT: add a0, a0, tp
 ## st_value(b) = 2047
+# LE64-LABEL: <.Ltlsdesc_hi1>:
 # LE64-NEXT: addizero, zero, 0x0
 # LE64-NEXT: addizero, zero, 0x0
 # LE64-NEXT: addizero, zero, 0x0
 # LE64-NEXT: addia0, zero, 0x7ff
 # LE64-NEXT: add a0, a0, tp
 ## st_value(c) = 2048
+# LE64-LABEL: <.Ltlsdesc_hi2>:
 # LE64-NEXT: addizero, zero, 0x0
 # LE64-NEXT: addizero, zero, 0x0
 # LE64-NEXT: lui a0, 0x1
@@ -110,18 +120,20 @@
 # IE64:   .got 0010 000123a8
 
 ## a and b are optimized to use LE. c is optimized to IE.
-# IE64-LABEL: <.text>:
+# IE64-LABEL: <.Ltlsdesc_hi0>:
 # IE64-NEXT: addizero, zero, 0x0
 # IE64-NEXT: addizero, zero, 0x0
 # IE64-NEXT: addizero, zero, 0x0
 # IE64-NEXT: addia0, zero, 0x8
 # IE64-NEXT: add a0, a0, tp
+# IE64-LABEL: <.Ltlsdesc_hi1>:
 # IE64-NEXT: addizero, zero, 0x0
 # IE64-NEXT: addizero, zero, 0x0
 # IE64-NEXT: addizero, zero, 0x0
 # IE64-NEXT: addia0, zero, 0x7ff
 # IE64-NEXT: add a0, a0, tp
 ## &.got[c]-. = 0x123a8+8 - 0x112b8 = 0x10f8
+# IE64-LABEL: <.Ltlsdesc_hi2>:
 # IE64-NEXT: addizero, zero, 0x0
 # IE64-NEXT: addizero, zero, 0x0
 # IE64-NEXT:  112b8: auipc   a0, 0x1
@@ -130,7 +142,7 @@
 
 # IE32:   .got 0008 00012248
 
-# IE32-LABEL: <.text>:
+# IE32-LABEL: <.Ltlsdesc_hi0>:
 ## st_value(a) = 8
 # IE32-NEXT: addizero, zero, 0x0
 # IE32-NEXT: addizero, zero, 0x0
@@ -138,12 +150,14 @@
 # IE32-NEXT: addia0, zero, 0x8
 # IE32-NEXT: add a0, a0, tp
 ## st_value(b) = 2047
+# IE32-LABEL: <.Ltlsdesc_hi1>:
 # IE32-NEXT: addizero, zero, 0x0
 # IE32-NEXT: addizero, zero, 0x0
 # IE32-NEXT: addizero, zero, 0x0
 # IE32-NEXT: addia0, zero, 0x7ff
 # IE32-NEXT: add a0, a0, tp
 ## &.got[c]-. = 0x12248+4 - 0x111cc = 0x1080
+# IE32-LABEL: <.Ltlsdesc_hi2>:
 # IE32-NEXT: addizero, zero, 0x0
 # IE32-NEXT: addizero, zero, 0x0
 # IE32-NEXT:  111cc: auipc   a0, 0x1
@@ -192,3 +206,19 @@ b:
 .tbss
 .globl c
 c: .zero 4
+
+#--- d.s
+.macro load dst, src
+.ifdef ELF32
+lw \dst, \src
+.else
+ld \dst, \src
+.endif
+.endm
+
+.Ltlsdesc_hi0:
+  auipca0, %tlsdesc_hi(foo)
+  load a1, %tlsdesc_load_lo(.Ltlsdesc_hi0)(a0)
+  addi a0, a0, %tlsdesc_add_lo(.Ltlsdesc_hi0)
+  jalr t0, 0(a1), %tlsdesc_call(.Ltlsdesc_hi0)
+  add  a1, a0, tp
diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp 
b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp
index 254a9a4bc0ef0..b8e0f3a867f40 100644
--- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp
+++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp
@@ -207,8 +207,6 @@ void RISCVMCExpr::fixELFSymbolsInTLSFixups(MCAssembler 
) const {
   case VK_RISCV_TLS_GOT_HI:
   case VK_RISCV_TLS_GD_HI:
   case VK_RISCV_TLSDESC_HI:
-  case VK_RISCV_TLSDESC_ADD_LO:
-  case VK_RISCV_TLSDESC_LOAD_LO:
 break;
   }
 
diff --git a/llvm/test/CodeGen/RISCV/tlsdesc-symbol.ll 
b/llvm/test/CodeGen/RISCV/tlsdesc-symbol.ll
new file mode 100644
index 0..23ba2ffb1ad76
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/tlsdesc-symbol.ll
@@ -0,0 +1,24 @@
+;; The test in this file do not appear in tls-models.ll because
+;; they are not auto-generated.
+; RUN: llc -mtriple=riscv64 -relocation-model=pic -enable-tlsdesc < %s \
+; RUN: | llvm-mc -triple=riscv64 -filetype=obj -o - \
+; RUN: | llvm-readelf --symbols - \
+; RUN: | FileCheck %s
+
+; RUN: llc -mtriple=riscv32 -relocation-model=pic -enable-tlsdesc < %s \
+; RUN: | llvm-mc -triple=riscv32 -filetype=obj -o - \
+; RUN: | llvm-readelf --symbols - \
+; RUN: | FileCheck %s
+
+; Check that TLS symbols are lowered correctly based on the specified
+; model. Make sure they're external to avoid them all being optimised to Local
+; Exec for the executable.
+
+@unspecified = external thread_local global i32
+
+define ptr @f1() nounwind {
+entry:
+  ret ptr @unspecified
+  ; CHECK: Symbol table '.symtab' contains 7 entries:
+  ; CHEC

[llvm-branch-commits] [lld] [llvm] release/18.x: [RISCV][lld] Set the type of TLSDESC relocation's referenced local symbol to STT_NOTYPE (PR #91678)

2024-05-09 Thread via llvm-branch-commits

llvmbot wrote:

@MaskRay @ilovepi What do you think about merging this PR to the release branch?

https://github.com/llvm/llvm-project/pull/91678
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] [llvm] release/18.x: [RISCV][lld] Set the type of TLSDESC relocation's referenced local symbol to STT_NOTYPE (PR #91678)

2024-05-09 Thread via llvm-branch-commits

https://github.com/llvmbot milestoned 
https://github.com/llvm/llvm-project/pull/91678
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] [llvm] release/18.x: [RISCV][lld] Set the type of TLSDESC relocation's referenced local symbol to STT_NOTYPE (PR #91678)

2024-05-09 Thread via llvm-branch-commits
0xf0(a4)
 # GD64-NEXT: addia0, a4, 0xf0
 # GD64-NEXT: jalrt0, 0x0(a5)
@@ -89,7 +91,7 @@
 
 # NOREL: no relocations
 
-# LE64-LABEL: <.text>:
+# LE64-LABEL: <.Ltlsdesc_hi0>:
 ## st_value(a) = 8
 # LE64-NEXT: addizero, zero, 0x0
 # LE64-NEXT: addizero, zero, 0x0
@@ -97,12 +99,14 @@
 # LE64-NEXT: addia0, zero, 0x8
 # LE64-NEXT: add a0, a0, tp
 ## st_value(b) = 2047
+# LE64-LABEL: <.Ltlsdesc_hi1>:
 # LE64-NEXT: addizero, zero, 0x0
 # LE64-NEXT: addizero, zero, 0x0
 # LE64-NEXT: addizero, zero, 0x0
 # LE64-NEXT: addia0, zero, 0x7ff
 # LE64-NEXT: add a0, a0, tp
 ## st_value(c) = 2048
+# LE64-LABEL: <.Ltlsdesc_hi2>:
 # LE64-NEXT: addizero, zero, 0x0
 # LE64-NEXT: addizero, zero, 0x0
 # LE64-NEXT: lui a0, 0x1
@@ -116,18 +120,20 @@
 # IE64:   .got 0010 000123a8
 
 ## a and b are optimized to use LE. c is optimized to IE.
-# IE64-LABEL: <.text>:
+# IE64-LABEL: <.Ltlsdesc_hi0>:
 # IE64-NEXT: addizero, zero, 0x0
 # IE64-NEXT: addizero, zero, 0x0
 # IE64-NEXT: addizero, zero, 0x0
 # IE64-NEXT: addia0, zero, 0x8
 # IE64-NEXT: add a0, a0, tp
+# IE64-LABEL: <.Ltlsdesc_hi1>:
 # IE64-NEXT: addizero, zero, 0x0
 # IE64-NEXT: addizero, zero, 0x0
 # IE64-NEXT: addizero, zero, 0x0
 # IE64-NEXT: addia0, zero, 0x7ff
 # IE64-NEXT: add a0, a0, tp
 ## &.got[c]-. = 0x123a8+8 - 0x112b8 = 0x10f8
+# IE64-LABEL: <.Ltlsdesc_hi2>:
 # IE64-NEXT: addizero, zero, 0x0
 # IE64-NEXT: addizero, zero, 0x0
 # IE64-NEXT:  112b8: auipc   a0, 0x1
@@ -136,7 +142,7 @@
 
 # IE32:   .got 0008 00012248
 
-# IE32-LABEL: <.text>:
+# IE32-LABEL: <.Ltlsdesc_hi0>:
 ## st_value(a) = 8
 # IE32-NEXT: addizero, zero, 0x0
 # IE32-NEXT: addizero, zero, 0x0
@@ -144,21 +150,20 @@
 # IE32-NEXT: addia0, zero, 0x8
 # IE32-NEXT: add a0, a0, tp
 ## st_value(b) = 2047
+# IE32-LABEL: <.Ltlsdesc_hi1>:
 # IE32-NEXT: addizero, zero, 0x0
 # IE32-NEXT: addizero, zero, 0x0
 # IE32-NEXT: addizero, zero, 0x0
 # IE32-NEXT: addia0, zero, 0x7ff
 # IE32-NEXT: add a0, a0, tp
 ## &.got[c]-. = 0x12248+4 - 0x111cc = 0x1080
+# IE32-LABEL: <.Ltlsdesc_hi2>:
 # IE32-NEXT: addizero, zero, 0x0
 # IE32-NEXT: addizero, zero, 0x0
 # IE32-NEXT:  111cc: auipc   a0, 0x1
 # IE32-NEXT: lw  a0, 0x80(a0)
 # IE32-NEXT: add a0, a0, tp
 
-## FIXME This should not pass, but the code MC layer needs a fix to prevent 
this.
-# BADTLSLABEL: error: d.{{.*}}.o has an STT_TLS symbol but doesn't have an 
SHF_TLS section
-
 #--- a.s
 .macro load dst, src
 .ifdef ELF32
diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp 
b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp
index 254a9a4bc0ef0..b8e0f3a867f40 100644
--- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp
+++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp
@@ -207,8 +207,6 @@ void RISCVMCExpr::fixELFSymbolsInTLSFixups(MCAssembler 
) const {
   case VK_RISCV_TLS_GOT_HI:
   case VK_RISCV_TLS_GD_HI:
   case VK_RISCV_TLSDESC_HI:
-  case VK_RISCV_TLSDESC_ADD_LO:
-  case VK_RISCV_TLSDESC_LOAD_LO:
 break;
   }
 

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-09 Thread Dan Liew via cfe-commits

delcypher wrote:

@bwendling

> I've been thinking about this restriction. Why is this necessary? My 
> assumption was that applying counted_by to a pointer causes a bounds check on 
> an index into the pointer rather than its underlying type.

@rapidsna Please add additional points if I accidentally miss something.

I can try to explain the restrictions from the perspective of the 
`-fbounds-safety` perspective. Essentially the reason these constructs are 
illegal in `-fbounds-safety` is because at runtime we need to be able to 
construct a wide pointer from `__counted_by()` pointers.  In the cases I've 
made illegal in this PR, this is either impossible to do correctly if we don't 
know the size of the pointee.

What I mean specifically by wide pointer is `__bidi_indexable` which is 
`-fbounds-safety`'s wide pointer that can be indexed positively and negatively. 
In `-fbounds-safety`'s model all pointers on the stack are `__bidi_indexable`  
by default and all `__counted_by()` pointers are implicitly converted to wide 
pointers when they are used inside a function.

`-fbounds-safety`'s `__bidi_indexable` is **very roughly** equivalent to this 
C++ code

```c++
template  struct WidePtr {
  T *ptr; // The address that is dereferenced
  // The bounds of the memory that forms the range of valid bytes to access
  // [lower_bound, upper_bound)
  void *lower_bound;
  void *upper_bound;

  WidePtr(T * /*__counted_by(count)*/ p, size_t count) {
ptr = p;
lower_bound = (void *)p;
// NEED sizeof(T) here!
upper_bound = ((char *)p) + sizeof(T) * count;
  }

  T& operator*() {
check_bounds();
return *ptr;
  }

  void check_bounds() {
if (ptr < lower_bound)
  __builtin_trap();

uintptr_t LastByteAccessedPlusOne;
// NEED sizeof(T) here!
if (__builtin_uadd_overflow(ptr, sizeof(T), ))
  __builtin_trap();

if (LastByteAccessedPlusOne > upper_bound)
  __builtin_trap();
  }

  // Lots of other operators are overloaded (e.g. +, -[], ++, -- and ->).
};
```

We need to know what `sizeof(T)` is in two places:

1. Everywhere you want to do a bounds check. E.g. when dereferencing the 
pointer.
2. When converting a `T* __counted_by()` pointer to a `WidePointer` (or `T* 
__bidi_indexable` in `-fbounds-safety` parlance). If you look at the 
constructor **we need to know** `sizeof(T)` when computing the upper bound of 
the wide pointer. Given that this conversion happens whenever a pointer of the 
type `T* __counted_by()` is used inside a function in the `-fbounds-safety` 
model,  the model requires that `T` have a known size. Technically this PR is 
being even stricter. It's forbidding declaring a `T* __counted_by()` even if it 
isn't used. However, this is a restriction we can lift later once more of the 
implementation is in place.

I've tried to annotate your code below with the specific reasons they are 
forbidden.

```c
// Both `foo` and `bar` are legal
struct foo;
struct bar {
  int a;
  int fam[] __counted_by(a);
};

struct x {
// Illegal in `-fbounds-safety`. We can't compute the upper bound of this 
pointer
// because `sizeof(void)*count` isn't valid. In `-fbounds-safety` the 
attribute you
// would use here is `__sized_by()` which is a byte count rather than an 
element count.
void *p __counted_by(count); 

// Illegal in `-fbounds-safety`. We can't compute the upper bound of this 
pointer because
// `sizeof(struct foo)*count` isn't valid. In particular `sizeof(struct 
foo)` is invalid because
// `struct foo` is an incomplete type.
struct foo *f __counted_by(count);

// Illegal in `-fbounds-safety`. While we can technically compute 
`sizeof(struct bar)*count`
// that computation is completely wrong unless the `bar::a` is `0`. To 
actually get the correct
// count we would need to walk every `struct bar` object in the buffer 
pointed to by `b` to
//  read `b::a`. This could be expensive (and prone to race conditions) so 
we simply
// don't support this right now.
struct bar *b __counted_by(count);

int count;
};
```

https://github.com/llvm/llvm-project/pull/90786
_______
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[Lldb-commits] [lldb] [lldb] Unify CalculateMD5 return types (PR #91029)

2024-05-09 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere closed 
https://github.com/llvm/llvm-project/pull/91029
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 95f208f - [lldb] Unify CalculateMD5 return types (#91029)

2024-05-09 Thread via lldb-commits
a65dd..24111396b0ac6 100644
--- a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
+++ b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
@@ -595,10 +595,8 @@ TEST_F(GDBRemoteCommunicationClientTest, WriteMemoryTags) {
 
 TEST_F(GDBRemoteCommunicationClientTest, CalculateMD5) {
   FileSpec file_spec("/foo/bar", FileSpec::Style::posix);
-  uint64_t low, high;
-  std::future async_result = std::async(std::launch::async, [&] {
-return client.CalculateMD5(file_spec, low, high);
-  });
+  std::future> async_result = std::async(
+  std::launch::async, [&] { return client.CalculateMD5(file_spec); });
 
   lldb_private::StreamString stream;
   stream.PutCString("vFile:MD5:");
@@ -607,11 +605,12 @@ TEST_F(GDBRemoteCommunicationClientTest, CalculateMD5) {
"F,"
"deadbeef01020304"
"05060708deadbeef");
-  ASSERT_TRUE(async_result.get());
+  auto result = async_result.get();
 
   // Server and client puts/parses low, and then high
   const uint64_t expected_low = 0xdeadbeef01020304;
   const uint64_t expected_high = 0x05060708deadbeef;
-  EXPECT_EQ(expected_low, low);
-  EXPECT_EQ(expected_high, high);
+  ASSERT_TRUE(result);
+  EXPECT_EQ(expected_low, result->low());
+  EXPECT_EQ(expected_high, result->high());
 }



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[clang] [clang][static analyzer] ignore try statements in dead code checker (PR #91675)

2024-05-09 Thread Andrew Sukach via cfe-commits


@@ -159,8 +159,10 @@ void 
UnreachableCodeChecker::checkEndAnalysis(ExplodedGraph ,
   SL = DL.asLocation();
   if (SR.isInvalid() || !SL.isValid())
 continue;
-}
-else
+
+  if (isa(S))

soukatch wrote:

everything besides this if statement is just a clang-format change

https://github.com/llvm/llvm-project/pull/91675
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang][static analyzer] ignore try statements in dead code checker (PR #91675)

2024-05-09 Thread Andrew Sukach via cfe-commits

https://github.com/soukatch deleted 
https://github.com/llvm/llvm-project/pull/91675
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang][static analyzer] ignore try statements in dead code checker (PR #91675)

2024-05-09 Thread Andrew Sukach via cfe-commits

soukatch wrote:

@steakhal I believe you're the best person to tag :).

https://github.com/llvm/llvm-project/pull/91675
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang][static analyzer] ignore try statements in dead code checker (PR #91675)

2024-05-09 Thread Andrew Sukach via cfe-commits


@@ -159,8 +159,10 @@ void 
UnreachableCodeChecker::checkEndAnalysis(ExplodedGraph ,
   SL = DL.asLocation();
   if (SR.isInvalid() || !SL.isValid())
 continue;
-}
-else
+
+  if (isa(S))

soukatch wrote:

everything above this point is just clang-format changes

https://github.com/llvm/llvm-project/pull/91675
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang][static analyzer] ignore try statements in dead code checker (PR #91675)

2024-05-09 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: Andrew Sukach (soukatch)


Changes

Fixes #90162. Simplest approach I could come up with was to skip cxxtry 
statements. Let me know if you have any suggestions. Thanks!

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


1 Files Affected:

- (modified) clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp 
(+16-14) 


``diff
diff --git a/clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp 
b/clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp
index d24a124f5ffee..205f646194f58 100644
--- a/clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp
@@ -12,10 +12,10 @@
 // A similar flow-sensitive only check exists in Analysis/ReachableCode.cpp
 
//===--===//
 
-#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
 #include "clang/AST/ParentMap.h"
 #include "clang/Basic/Builtins.h"
 #include "clang/Basic/SourceManager.h"
+#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
 #include "clang/StaticAnalyzer/Core/Checker.h"
 #include "clang/StaticAnalyzer/Core/CheckerManager.h"
@@ -34,6 +34,7 @@ class UnreachableCodeChecker : public 
Checker {
 public:
   void checkEndAnalysis(ExplodedGraph , BugReporter ,
 ExprEngine ) const;
+
 private:
   typedef llvm::SmallSet CFGBlocksSet;
 
@@ -44,10 +45,9 @@ class UnreachableCodeChecker : public 
Checker {
   static bool isInvalidPath(const CFGBlock *CB, const ParentMap );
   static inline bool isEmptyCFGBlock(const CFGBlock *CB);
 };
-}
+} // namespace
 
-void UnreachableCodeChecker::checkEndAnalysis(ExplodedGraph ,
-  BugReporter ,
+void UnreachableCodeChecker::checkEndAnalysis(ExplodedGraph , BugReporter ,
   ExprEngine ) const {
   CFGBlocksSet reachable, visited;
 
@@ -126,8 +126,8 @@ void UnreachableCodeChecker::checkEndAnalysis(ExplodedGraph 
,
 // such as llvm_unreachable.
 if (!CB->empty()) {
   bool foundUnreachable = false;
-  for (CFGBlock::const_iterator ci = CB->begin(), ce = CB->end();
-   ci != ce; ++ci) {
+  for (CFGBlock::const_iterator ci = CB->begin(), ce = CB->end(); ci != ce;
+   ++ci) {
 if (std::optional S = (*ci).getAs())
   if (const CallExpr *CE = dyn_cast(S->getStmt())) {
 if (CE->getBuiltinCallee() == Builtin::BI__builtin_unreachable ||
@@ -159,8 +159,10 @@ void 
UnreachableCodeChecker::checkEndAnalysis(ExplodedGraph ,
   SL = DL.asLocation();
   if (SR.isInvalid() || !SL.isValid())
 continue;
-}
-else
+
+  if (isa(S))
+continue;
+} else
   continue;
 
 // Check if the SourceLocation is in a system header
@@ -229,9 +231,9 @@ bool UnreachableCodeChecker::isInvalidPath(const CFGBlock 
*CB,
   // Get the predecessor block's terminator condition
   const Stmt *cond = pred->getTerminatorCondition();
 
-  //assert(cond && "CFGBlock's predecessor has a terminator condition");
-  // The previous assertion is invalid in some cases (eg do/while). Leaving
-  // reporting of these situations on at the moment to help triage these cases.
+  // assert(cond && "CFGBlock's predecessor has a terminator condition");
+  //  The previous assertion is invalid in some cases (eg do/while). Leaving
+  //  reporting of these situations on at the moment to help triage these 
cases.
   if (!cond)
 return false;
 
@@ -243,9 +245,9 @@ bool UnreachableCodeChecker::isInvalidPath(const CFGBlock 
*CB,
 
 // Returns true if the given CFGBlock is empty
 bool UnreachableCodeChecker::isEmptyCFGBlock(const CFGBlock *CB) {
-  return CB->getLabel() == nullptr // No labels
-  && CB->size() == 0   // No statements
-  && !CB->getTerminatorStmt(); // No terminator
+  return CB->getLabel() == nullptr// No labels
+ && CB->size() == 0   // No statements
+ && !CB->getTerminatorStmt(); // No terminator
 }
 
 void ento::registerUnreachableCodeChecker(CheckerManager ) {

``




https://github.com/llvm/llvm-project/pull/91675
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang][static analyzer] ignore try statements in dead code checker (PR #91675)

2024-05-09 Thread Andrew Sukach via cfe-commits

https://github.com/soukatch created 
https://github.com/llvm/llvm-project/pull/91675

Fixes #90162. Simplest approach I could come up with was to skip cxxtry 
statements. Let me know if you have any suggestions. Thanks!

>From e1fcdc37e52189abcdf8ce84ada463491d8b6c04 Mon Sep 17 00:00:00 2001
From: Andrew Sukach 
Date: Thu, 9 May 2024 18:49:41 -0400
Subject: [PATCH] [clang][static analyzer] ignore try statements in dead code
 checker

---
 .../Checkers/UnreachableCodeChecker.cpp   | 30 ++-
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp 
b/clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp
index d24a124f5ffee..205f646194f58 100644
--- a/clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp
@@ -12,10 +12,10 @@
 // A similar flow-sensitive only check exists in Analysis/ReachableCode.cpp
 
//===--===//
 
-#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
 #include "clang/AST/ParentMap.h"
 #include "clang/Basic/Builtins.h"
 #include "clang/Basic/SourceManager.h"
+#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
 #include "clang/StaticAnalyzer/Core/Checker.h"
 #include "clang/StaticAnalyzer/Core/CheckerManager.h"
@@ -34,6 +34,7 @@ class UnreachableCodeChecker : public 
Checker {
 public:
   void checkEndAnalysis(ExplodedGraph , BugReporter ,
 ExprEngine ) const;
+
 private:
   typedef llvm::SmallSet CFGBlocksSet;
 
@@ -44,10 +45,9 @@ class UnreachableCodeChecker : public 
Checker {
   static bool isInvalidPath(const CFGBlock *CB, const ParentMap );
   static inline bool isEmptyCFGBlock(const CFGBlock *CB);
 };
-}
+} // namespace
 
-void UnreachableCodeChecker::checkEndAnalysis(ExplodedGraph ,
-  BugReporter ,
+void UnreachableCodeChecker::checkEndAnalysis(ExplodedGraph , BugReporter ,
   ExprEngine ) const {
   CFGBlocksSet reachable, visited;
 
@@ -126,8 +126,8 @@ void UnreachableCodeChecker::checkEndAnalysis(ExplodedGraph 
,
 // such as llvm_unreachable.
 if (!CB->empty()) {
   bool foundUnreachable = false;
-  for (CFGBlock::const_iterator ci = CB->begin(), ce = CB->end();
-   ci != ce; ++ci) {
+  for (CFGBlock::const_iterator ci = CB->begin(), ce = CB->end(); ci != ce;
+   ++ci) {
 if (std::optional S = (*ci).getAs())
   if (const CallExpr *CE = dyn_cast(S->getStmt())) {
 if (CE->getBuiltinCallee() == Builtin::BI__builtin_unreachable ||
@@ -159,8 +159,10 @@ void 
UnreachableCodeChecker::checkEndAnalysis(ExplodedGraph ,
   SL = DL.asLocation();
   if (SR.isInvalid() || !SL.isValid())
 continue;
-}
-else
+
+  if (isa(S))
+continue;
+} else
   continue;
 
 // Check if the SourceLocation is in a system header
@@ -229,9 +231,9 @@ bool UnreachableCodeChecker::isInvalidPath(const CFGBlock 
*CB,
   // Get the predecessor block's terminator condition
   const Stmt *cond = pred->getTerminatorCondition();
 
-  //assert(cond && "CFGBlock's predecessor has a terminator condition");
-  // The previous assertion is invalid in some cases (eg do/while). Leaving
-  // reporting of these situations on at the moment to help triage these cases.
+  // assert(cond && "CFGBlock's predecessor has a terminator condition");
+  //  The previous assertion is invalid in some cases (eg do/while). Leaving
+  //  reporting of these situations on at the moment to help triage these 
cases.
   if (!cond)
 return false;
 
@@ -243,9 +245,9 @@ bool UnreachableCodeChecker::isInvalidPath(const CFGBlock 
*CB,
 
 // Returns true if the given CFGBlock is empty
 bool UnreachableCodeChecker::isEmptyCFGBlock(const CFGBlock *CB) {
-  return CB->getLabel() == nullptr // No labels
-  && CB->size() == 0   // No statements
-  && !CB->getTerminatorStmt(); // No terminator
+  return CB->getLabel() == nullptr// No labels
+ && CB->size() == 0   // No statements
+ && !CB->getTerminatorStmt(); // No terminator
 }
 
 void ento::registerUnreachableCodeChecker(CheckerManager ) {

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

2024-05-09 Thread via cfe-commits

apple-fcloutier wrote:

I think that there's room to allow `__counted_by` on incomplete types so that a 
TU where it's complete could use it (and we have use cases where that would be 
handy), but our implementation doesn't support it at this time. This can be 
added without disruptions at a later time. FWIW, the point of bounds-checking 
an index is moot at least while the type is incomplete, since it's an error to 
dereference a pointer to an incomplete type. Aside from indexing, operations 
that would cast the pointer (such as `memset(x->foo, 0, some_value)`, assuming 
`memset(void *__sized_by(n), int, size_t n)`) would still have to be illegal 
when `struct foo` is incomplete because there's no way to know how many bytes 
we have at x->foo without `sizeof(struct foo)`.

`void *__counted_by` could be made legal because clang defines `sizeof(void) == 
1` in C mode, as an extension to the C standard. I think it's still best 
avoided: "how many voids do I have at p?" is not a great question to ask, 
whereas the same with `__sized_by` just makes sense. It's also a little bit 
easier to filter out `void` with the rest of the incomplete types.

For structs with a flexible array member, the reason is that `sizeof(struct 
bar)` is a lie. How would we reconcile, for instance, a count of 1 (implying 
there's like 4 bytes at `x->bar`) with a `x->bar->a` of 10 (implying that 
`x->bar->fam[8]` is in bounds)? How do we feel that `x->bar[0]->fam[0]` aliases 
with `x->bar[1]->a`?

https://github.com/llvm/llvm-project/pull/90786
___________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [AArch64] add some more tests for FMV (PR #91490)

2024-05-09 Thread Vladimir Vereschaka via cfe-commits
; "-target-feature" "+fp-armv8" 
"-target-feature" "+neon" "-target-abi" "aapcs" "-debugger-tuning=gdb" 
"-fdebug-compilation-dir=C:\\buildbot\\as-builder-2\\x-aarch64\\build\\tools\\clang\\test\\Driver"
 
"-fcoverage-compilation-dir=C:\\buildbot\\as-builder-2\\x-aarch64\\build\\tools\\clang\\test\\Driver"
 "-resource-dir" "C:\\buildbot\\as-builder-2\\x-aarch64\\build\\lib\\clang\\19" 
"-isysroot" "c:/buildbot/fs/jetson-agx-ubuntu" "-ferror-limit" "19" 
"-fno-signed-char" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-faddrsig" 
"-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o" "aarch64-fmv.o" "-x" "c" 
"C:\\buildbot\\as-builder-2\\x-aarch64\\llvm-project\\clang\\test\\Driver\\aarch64-fmv.c"
 
# | check:27'0 
~~~
# | check:27'1  



?   
            
    






   possible intended match
# | >>>>>>
# `-
# error: command failed with exit status: 1
--

```

https://lab.llvm.org/buildbot/#/builders/119/builds/18102

https://github.com/llvm/llvm-project/pull/91490
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [WebAssembly] Implement prototype f32.store_f16 instruction. (PR #91545)

2024-05-09 Thread Heejin Ahn via cfe-commits

https://github.com/aheejin closed 
https://github.com/llvm/llvm-project/pull/91545
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 8a3277a - [WebAssembly] Implement prototype f32.store_f16 instruction. (#91545)

2024-05-09 Thread via cfe-commits
32)
   return 1;
   WASM_LOAD_STORE(LOAD_I32)
   WASM_LOAD_STORE(LOAD_F32)

diff  --git a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp 
b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
index ed52fe53bc609..527bb4c9fbea6 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
@@ -914,6 +914,14 @@ bool 
WebAssemblyTargetLowering::getTgtMemIntrinsic(IntrinsicInfo ,
 Info.align = Align(2);
 Info.flags = MachineMemOperand::MOLoad;
 return true;
+  case Intrinsic::wasm_storef16_f32:
+Info.opc = ISD::INTRINSIC_VOID;
+Info.memVT = MVT::f16;
+Info.ptrVal = I.getArgOperand(1);
+Info.offset = 0;
+Info.align = Align(2);
+Info.flags = MachineMemOperand::MOStore;
+return true;
   default:
 return false;
   }

diff  --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrMemory.td 
b/llvm/lib/Target/WebAssembly/WebAssemblyInstrMemory.td
index e4baf842462a9..9d452879bbf80 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrMemory.td
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrMemory.td
@@ -72,8 +72,9 @@ defm LOAD16_U_I64 : WebAssemblyLoad;
 defm LOAD32_S_I64 : WebAssemblyLoad;
 defm LOAD32_U_I64 : WebAssemblyLoad;
 
-// Half Precision
-defm LOAD_F16_F32 : WebAssemblyLoad;
+// Half-precision load.
+defm LOAD_F16_F32 :
+  WebAssemblyLoad;
 
 // Pattern matching
 
@@ -171,12 +172,18 @@ defm STORE8_I64 : WebAssemblyStore;
 defm STORE16_I64 : WebAssemblyStore;
 defm STORE32_I64 : WebAssemblyStore;
 
+// Half-precision store.
+defm STORE_F16_F32 :
+  WebAssemblyStore;
+
 defm : StorePat;
 defm : StorePat;
 defm : StorePat;
 defm : StorePat;
 defm : StorePat;
 
+defm : StorePat;
+
 multiclass MemoryOps {
 // Current memory size.
 defm MEMORY_SIZE_A#B : I<(outs rc:$dst), (ins i32imm:$flags),

diff  --git a/llvm/test/CodeGen/WebAssembly/half-precision.ll 
b/llvm/test/CodeGen/WebAssembly/half-precision.ll
index 582771d3f95fc..89e9c42637c14 100644
--- a/llvm/test/CodeGen/WebAssembly/half-precision.ll
+++ b/llvm/test/CodeGen/WebAssembly/half-precision.ll
@@ -2,6 +2,7 @@
 ; RUN: llc < %s --mtriple=wasm64-unknown-unknown -asm-verbose=false 
-disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals 
-wasm-keep-registers -mattr=+half-precision | FileCheck %s
 
 declare float @llvm.wasm.loadf32.f16(ptr)
+declare void @llvm.wasm.storef16.f32(float, ptr)
 
 ; CHECK-LABEL: ldf16_32:
 ; CHECK:  f32.load_f16 $push[[NUM0:[0-9]+]]=, 0($0){{$}}
@@ -10,3 +11,11 @@ define float @ldf16_32(ptr %p) {
   %v = call float @llvm.wasm.loadf16.f32(ptr %p)
   ret float %v
 }
+
+; CHECK-LABEL: stf16_32:
+; CHECK:   f32.store_f16 0($1), $0
+; CHECK-NEXT:  return
+define void @stf16_32(float %v, ptr %p) {
+  tail call void @llvm.wasm.storef16.f32(float %v, ptr %p)
+  ret void
+}

diff  --git a/llvm/test/CodeGen/WebAssembly/offset.ll 
b/llvm/test/CodeGen/WebAssembly/offset.ll
index b497ddd7273a0..65de341780e31 100644
--- a/llvm/test/CodeGen/WebAssembly/offset.ll
+++ b/llvm/test/CodeGen/WebAssembly/offset.ll
@@ -692,3 +692,30 @@ define float @load_f16_f32_with_folded_gep_offset(ptr %p) {
   %t = call float @llvm.wasm.loadf16.f32(ptr %s)
   ret float %t
 }
+
+;===
+; Stores: Half Precision
+;===
+
+; Basic store.
+
+; CHECK-LABEL: store_f16_f32_no_offset:
+; CHECK-NEXT: .functype store_f16_f32_no_offset (i32, f32) -> (){{$}}
+; CHECK-NEXT: f32.store_f16 0($0), $1{{$}}
+; CHECK-NEXT: return{{$}}
+define void @store_f16_f32_no_offset(ptr %p, float %v) {
+  call void @llvm.wasm.storef16.f32(float %v, ptr %p)
+  ret void
+}
+
+; Storing to a fixed address.
+
+; CHECK-LABEL: store_f16_f32_to_numeric_address:
+; CHECK:  i32.const $push1=, 0{{$}}
+; CHECK-NEXT: f32.const $push0=, 0x0p0{{$}}
+; CHECK-NEXT: f32.store_f16 42($pop1), $pop0{{$}}
+define void @store_f16_f32_to_numeric_address() {
+  %s = inttoptr i32 42 to ptr
+  call void @llvm.wasm.storef16.f32(float 0.0, ptr %s)
+  ret void
+}

diff  --git a/llvm/test/MC/WebAssembly/simd-encodings.s 
b/llvm/test/MC/WebAssembly/simd-encodings.s
index e7c3761f381d0..57fa71e74b8d7 100644
--- a/llvm/test/MC/WebAssembly/simd-encodings.s
+++ b/llvm/test/MC/WebAssembly/simd-encodings.s
@@ -842,4 +842,7 @@ main:
 # CHECK: f32.load_f16 48 # encoding: [0xfc,0x30,0x01,0x30]
 f32.load_f16 48
 
+# CHECK: f32.store_f16 32 # encoding: [0xfc,0x31,0x01,0x20]
+    f32.store_f16 32
+
 end_function



_______
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [alpha.webkit.UncountedCallArgsChecker] Allow trivial operator++ (PR #91102)

2024-05-09 Thread Ryosuke Niwa via cfe-commits

https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/91102
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] a99cb96 - [alpha.webkit.UncountedCallArgsChecker] Allow trivial operator++ (#91102)

2024-05-09 Thread via cfe-commits
@@ -284,9 +308,14 @@ class RefCounted {
 
   int nonTrivial13() { return ~otherFunction(); }
   int nonTrivial14() { int r = 0xff; r |= otherFunction(); return r; }
+  void nonTrivial15() { ++complex; }
+  void nonTrivial16() { complex++; }
+  ComplexNumber nonTrivial17() { return complex << 2; }
+  ComplexNumber nonTrivial18() { return +complex; }
 
   unsigned v { 0 };
   Number* number { nullptr };
+  ComplexNumber complex;
   Enum enumValue { Enum::Value1 };
 };
 
@@ -342,6 +371,12 @@ class UnrelatedClass {
 getFieldTrivial().trivial32(); // no-warning
 getFieldTrivial().trivial33(); // no-warning
 getFieldTrivial().trivial34<7>(); // no-warning
+getFieldTrivial().trivial35(); // no-warning
+getFieldTrivial().trivial36(); // no-warning
+getFieldTrivial().trivial37(); // no-warning
+getFieldTrivial().trivial38(); // no-warning
+getFieldTrivial().trivial39(); // no-warning
+getFieldTrivial().trivial40(); // no-warning
 
 RefCounted::singleton().trivial18(); // no-warning
 RefCounted::singleton().someFunction(); // no-warning
@@ -376,6 +411,14 @@ class UnrelatedClass {
 // expected-warning@-1{{Call argument for 'this' parameter is uncounted 
and unsafe}}
 getFieldTrivial().nonTrivial14();
 // expected-warning@-1{{Call argument for 'this' parameter is uncounted 
and unsafe}}
+getFieldTrivial().nonTrivial15();
+// expected-warning@-1{{Call argument for 'this' parameter is uncounted 
and unsafe}}
+getFieldTrivial().nonTrivial16();
+// expected-warning@-1{{Call argument for 'this' parameter is uncounted 
and unsafe}}
+getFieldTrivial().nonTrivial17();
+// expected-warning@-1{{Call argument for 'this' parameter is uncounted 
and unsafe}}
+getFieldTrivial().nonTrivial18();
+// expected-warning@-1{{Call argument for 'this' parameter is uncounted 
and unsafe}}
   }
 };
 



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang-tidy] Ignore unevaluated context in bugprone-optional-value-conversion (PR #90410)

2024-05-09 Thread Julian Schmidt via cfe-commits

https://github.com/5chmidti approved this pull request.


https://github.com/llvm/llvm-project/pull/90410
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang-tidy] Ignore unevaluated context in bugprone-optional-value-conversion (PR #90410)

2024-05-09 Thread Julian Schmidt via cfe-commits

5chmidti wrote:

> And in example that you provided there is no issue.

Alright, at least not a bugrprone issue. And the argument for a readability 
issue (which is the direction I initially was going) would probably end in 
someone saying `we use this to diagnose compile errors earlier, not deeper in 
any instantiations`

https://github.com/llvm/llvm-project/pull/90410
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[Lldb-commits] [lldb] [lldb] Unify CalculateMD5 return types (PR #91029)

2024-05-09 Thread Anthony Ha via lldb-commits

Awfa wrote:

> > @JDevlieghere , do you know if there's a way to run buildbot on a merge of 
> > this PR and main branch - just to validate the build/tests work before this 
> > merge?
> 
> Not that I know. When failures are macOS specific I'm happy to apply a PR 
> locally and run the test suite and other folks with specific configurations 
> might do the same, but that's about all I can think of.
> 
> > The [llvm contributing 
> > guide](https://llvm.org/docs/MyFirstTypoFix.html#myfirsttypofix-issues-after-landing-your-pr)
> >  says this is normal workflow - but I worry since I am using a lot of the 
> > maintainers' time to merge / revert the changes for me since I don't have 
> > write access.
> 
> No worries, it's totally normal and we're happy to help with that!

Can I ask you merge this for me? Hopefully no reverts this time :)

https://github.com/llvm/llvm-project/pull/91029
_______
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[clang] [llvm] [RISCV] Allow extra underscores in parseNormalizedArchString and parseArchString. (PR #91532)

2024-05-09 Thread Craig Topper via cfe-commits

https://github.com/topperc closed 
https://github.com/llvm/llvm-project/pull/91532
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][Sema] access checking of friend declaration should not be delayed (PR #91430)

2024-05-09 Thread Qizhi Hu via cfe-commits
om: Qizhi Hu <836744...@qq.com>
Date: Wed, 8 May 2024 21:22:01 +0800
Subject: [PATCH 2/2] apply reviews

---
 clang/docs/ReleaseNotes.rst   |  1 +
 clang/lib/Sema/Scope.cpp  |  1 -
 clang/lib/Sema/SemaAccess.cpp | 18 +++---
 3 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 4547636318a74..0053e89bd91cd 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -703,6 +703,7 @@ Bug Fixes to C++ Support
   within initializers for variables that are usable in constant expressions or 
are constant
   initialized, rather than evaluating them as a part of the larger manifestly 
constant evaluated
   expression.
+- Fix a bug in access control checking due to dealyed checking of friend 
declaration. Fixes (#GH12361).
 
 Bug Fixes to AST Handling
 ^
diff --git a/clang/lib/Sema/Scope.cpp b/clang/lib/Sema/Scope.cpp
index 780aa898b1085..c08073e80ff3d 100644
--- a/clang/lib/Sema/Scope.cpp
+++ b/clang/lib/Sema/Scope.cpp
@@ -229,7 +229,6 @@ void Scope::dumpImpl(raw_ostream ) const {
   {ClassInheritanceScope, "ClassInheritanceScope"},
   {CatchScope, "CatchScope"},
   {OpenACCComputeConstructScope, "OpenACCComputeConstructScope"},
-  {TypeAliasScope, "TypeAliasScope"},
   {FriendScope, "FriendScope"},
   };
 
diff --git a/clang/lib/Sema/SemaAccess.cpp b/clang/lib/Sema/SemaAccess.cpp
index 72c6736bb6648..979a64b065f3d 100644
--- a/clang/lib/Sema/SemaAccess.cpp
+++ b/clang/lib/Sema/SemaAccess.cpp
@@ -1473,10 +1473,22 @@ static Sema::AccessResult CheckAccess(Sema , 
SourceLocation Loc,
   // specifier, like this:
   //   A::private_type A::foo() { ... }
   //
-  // Or we might be parsing something that will turn out to be a friend:
-  //   void foo(A::private_type);
-  //   void B::foo(A::private_type);
+  // friend declaration should not be delayed because it may lead to incorrect
+  // redeclaration chain, such as:
+  //   class D {
+  //class E{
+  // class F{};
+  // friend  void foo(D::E::F& q);
+  //};
+  //friend  void foo(D::E::F& q);
+  //   };
   if (S.DelayedDiagnostics.shouldDelayDiagnostics()) {
+// [class.friend]p9:
+// A member nominated by a friend declaration shall be accessible in the
+// class containing the friend declaration. The meaning of the friend
+// declaration is the same whether the friend declaration appears in the
+// private, protected, or public ([class.mem]) portion of the class
+// member-specification.
 Scope *TS = S.getCurScope();
 bool IsFriendDeclaration = false;
 while (TS && !IsFriendDeclaration) {

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] Add option to exclude headers from clang-tidy analysis (PR #91400)

2024-05-09 Thread Julian Schmidt via cfe-commits

https://github.com/5chmidti edited 
https://github.com/llvm/llvm-project/pull/91400
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] Add option to exclude headers from clang-tidy analysis (PR #91400)

2024-05-09 Thread Julian Schmidt via cfe-commits


@@ -311,7 +311,12 @@ ClangTidyDiagnosticConsumer::ClangTidyDiagnosticConsumer(
 : Context(Ctx), ExternalDiagEngine(ExternalDiagEngine),
   RemoveIncompatibleErrors(RemoveIncompatibleErrors),
   GetFixesFromNotes(GetFixesFromNotes),
-  EnableNolintBlocks(EnableNolintBlocks) {}
+  EnableNolintBlocks(EnableNolintBlocks) {
+
+  if (Context.getOptions().ExcludeHeaderFilterRegex)
+ExcludeHeaderFilter = std::make_unique(
+*Context.getOptions().ExcludeHeaderFilterRegex);
+}

5chmidti wrote:

> which I think is handled in the latest revision

I agree

> I could migrate HeaderFilter to mirror the new and improved 
> ExcludeHeaderFilter...though I worry a bit about this change growing larger 
> and larger

Sure, a small follow-up pr would probably be better.

https://github.com/llvm/llvm-project/pull/91400
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [analyzer] Support determining origins in a conditional operator in WebKit checkers. (PR #91143)

2024-05-09 Thread Ryosuke Niwa via cfe-commits
  const CXXRecordDecl *const MaybeGuardianArgCXXRecord =
-MaybeGuardianArgType->getAsCXXRecordDecl();
-if (MaybeGuardianArgCXXRecord) {
-  if (MaybeGuardian->isLocalVarDecl() &&
-  (isRefCounted(MaybeGuardianArgCXXRecord) ||
-   isRefcountedStringsHack(MaybeGuardian)) &&
-  isGuardedScopeEmbeddedInGuardianScope(V, MaybeGuardian))
-return;
-}
-  }
-
-  // Parameters are guaranteed to be safe for the duration of the call
-  // by another checker.
-  if (isa(MaybeGuardian))
-return;
-}
-  }
-
   reportBug(V);
 }
   }
diff --git a/clang/test/Analysis/Checkers/WebKit/call-args.cpp 
b/clang/test/Analysis/Checkers/WebKit/call-args.cpp
index 45d900d4ba880..e1bee8a23a250 100644
--- a/clang/test/Analysis/Checkers/WebKit/call-args.cpp
+++ b/clang/test/Analysis/Checkers/WebKit/call-args.cpp
@@ -344,3 +344,17 @@ namespace cxx_member_operator_call {
 // expected-warning@-1{{Call argument for parameter 'bad' is uncounted and 
unsafe}}
   }
 }
+
+namespace call_with_ptr_on_ref {
+  Ref provideProtected();
+  void bar(RefCountable* bad);
+  bool baz();
+  void foo(bool v) {
+bar(v ? nullptr : provideProtected().ptr());
+bar(baz() ? provideProtected().ptr() : nullptr);
+bar(v ? provide() : provideProtected().ptr());
+// expected-warning@-1{{Call argument for parameter 'bad' is uncounted and 
unsafe}}
+bar(v ? provideProtected().ptr() : provide());
+// expected-warning@-1{{Call argument for parameter 'bad' is uncounted and 
unsafe}}
+  }
+}
diff --git a/clang/test/Analysis/Checkers/WebKit/uncounted-local-vars.cpp 
b/clang/test/Analysis/Checkers/WebKit/uncounted-local-vars.cpp
index 8da1dc557a5a3..632a82eb0d8d1 100644
--- a/clang/test/Analysis/Checkers/WebKit/uncounted-local-vars.cpp
+++ b/clang/test/Analysis/Checkers/WebKit/uncounted-local-vars.cpp
@@ -198,3 +198,21 @@ void system_header() {
 }
 
 } // ignore_system_headers
+
+namespace conditional_op {
+RefCountable *provide_ref_ctnbl();
+bool bar();
+
+void foo() {
+  RefCountable *a = bar() ? nullptr : provide_ref_ctnbl();
+  // expected-warning@-1{{Local variable 'a' is uncounted and unsafe 
[alpha.webkit.UncountedLocalVarsChecker]}}
+  RefPtr b = provide_ref_ctnbl();
+  {
+RefCountable* c = bar() ? nullptr : b.get();
+c->method();
+RefCountable* d = bar() ? b.get() : nullptr;
+d->method();
+  }
+}
+
+} // namespace conditional_op

_______
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-05-09 Thread Hubert Tong via cfe-commits

https://github.com/hubert-reinterpretcast edited 
https://github.com/llvm/llvm-project/pull/88978
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-05-09 Thread Hubert Tong via cfe-commits


@@ -14572,6 +14572,9 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr 
*E) {
 int FrexpExp;
 llvm::RoundingMode RM = getActiveRoundingMode(Info, E);
 Result = llvm::frexp(Result, FrexpExp, RM);
+if (!Result.isZero() && !Result.isNaN() && !Result.isInfinity())
+  assert(llvm::APFloat::isInRange(Result) &&
+"The value is not in the expected range for frexp.");

hubert-reinterpretcast wrote:

assert((Result.isZero() || Result.isNaN() || Result.isInfinity() || ...) && 
"...");



https://github.com/llvm/llvm-project/pull/88978
___________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-05-09 Thread Hubert Tong via cfe-commits


@@ -951,6 +951,19 @@ class APFloat : public APFloatBase {
 
   bool needsCleanup() const { APFLOAT_DISPATCH_ON_SEMANTICS(needsCleanup()); }
 
+  //  Checks that the value x is in the range (-1;-0.5], [0.5; 1)
+  static bool isInRange(const llvm::APFloat ) {

hubert-reinterpretcast wrote:

I don't think this should be a member function of `APFloat`. It can be an 
implementation detail of `ExprConstant.cpp`. In either case, the function 
should be named something like `isInFrexpResultRange`.

https://github.com/llvm/llvm-project/pull/88978
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-05-09 Thread Hubert Tong via cfe-commits

https://github.com/hubert-reinterpretcast commented:

Partial review comments.

https://github.com/llvm/llvm-project/pull/88978
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [MC,llvm-readobj,yaml2obj] Support CREL relocation format (PR #91280)

2024-05-09 Thread Fangrui Song via cfe-commits

MaskRay wrote:

> I think it would be useful to nominate a source as the canonical reference 
> for the specification which is updated along with any implementation changes. 
> I think 
> [discourse.llvm.org/t/rfc-crel-a-compact-relocation-format-for-elf/77600/3](https://discourse.llvm.org/t/rfc-crel-a-compact-relocation-format-for-elf/77600/3)
>  is a good starting point.
> 
> Possible examples:
> 
> * A patch to the LLVM documentation.
> * A blog-post that is kept up to date with the implementation.
> * A discourse post that is updated.

Thanks. I frequently update my blog posts and 
https://maskray.me/blog/2024-03-09-a-compact-relocation-format-for-elf#crel-relocation-format
 will be kept up to date.

However, I feel not so good to name my personal website. Then, 
https://discourse.llvm.org/t/rfc-crel-a-compact-relocation-format-for-elf/77600/3
 should serve the purpose well. discourse.llvm.org posts become non-editable 
after a period of time. I'll need to make further applies if changes are made.

> Link: 
> [discourse.llvm.org/t/rfc-crel-a-compact-relocation-format-for-elf/77600](https://discourse.llvm.org/t/rfc-crel-a-compact-relocation-format-for-elf/77600)

I can edit the link to append `/3` to refer to the specification.

https://github.com/llvm/llvm-project/pull/91280
___________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[llvm-branch-commits] [llvm] release/18.x: [AArc64][GlobalISel] Fix legalizer assert for G_INSERT_VECTOR_ELT - manual merge (PR #91672)

2024-05-09 Thread Amara Emerson via llvm-branch-commits

https://github.com/aemerson milestoned 
https://github.com/llvm/llvm-project/pull/91672
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] release/18.x: [AArc64][GlobalISel] Fix legalizer assert for G_INSERT_VECTOR_ELT - manual merge (PR #91672)

2024-05-09 Thread Amara Emerson via llvm-branch-commits

aemerson wrote:

Test has been changed from original commit due to a fallback in a G_BITCAST. 
Added abort=2 so we can see partial legalization and check no crash.

https://github.com/llvm/llvm-project/pull/91672
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] release/18.x: [AArc64][GlobalISel] Fix legalizer assert for G_INSERT_VECTOR_ELT - manual merge (PR #91672)

2024-05-09 Thread via llvm-branch-commits
s + 8, align 8)
+  ; CHECK-NEXT:   G_BR %bb.1
+  bb.1:
+liveins: $w1, $w2, $w3, $x0
+
+%0:_(p0) = COPY $x0
+%2:_(s32) = COPY $w1
+%3:_(s32) = COPY $w2
+%4:_(s32) = COPY $w3
+%5:_(<3 x s32>) = G_BUILD_VECTOR %2(s32), %3(s32), %4(s32)
+%1:_(<3 x s8>) = G_TRUNC %5(<3 x s32>)
+%8:_(s64) = G_CONSTANT i64 0
+%11:_(s8) = G_IMPLICIT_DEF
+%7:_(s8) = G_CONSTANT i8 0
+%10:_(<3 x s8>) = G_BUILD_VECTOR %7(s8), %11(s8), %11(s8)
+
+  bb.2:
+%14:_(s64) = G_CONSTANT i64 0
+%15:_(s8) = G_CONSTANT i8 0
+%6:_(<3 x s8>) = G_INSERT_VECTOR_ELT %1, %15(s8), %14(s64)
+%9:_(<12 x s8>) = G_SHUFFLE_VECTOR %6(<3 x s8>), %10, shufflemask(0, 3, 3, 
3, 1, 3, 3, 3, 2, 3, 3, 3)
+%12:_(<3 x s32>) = G_BITCAST %9(<12 x s8>)
+%13:_(<3 x s32>) = G_UITOFP %12(<3 x s32>)
+G_STORE %13(<3 x s32>), %0(p0) :: (store (<3 x s32>))
+G_BR %bb.2
+
+...

``




https://github.com/llvm/llvm-project/pull/91672
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] release/18.x: [AArc64][GlobalISel] Fix legalizer assert for G_INSERT_VECTOR_ELT (PR #90827)

2024-05-09 Thread Amara Emerson via llvm-branch-commits

aemerson wrote:

New PR: https://github.com/llvm/llvm-project/pull/91672

https://github.com/llvm/llvm-project/pull/90827
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[Lldb-commits] [lldb] [lldb] Adds additional fields to ProcessInfo (PR #91544)

2024-05-09 Thread Fred Grim via lldb-commits


@@ -237,6 +250,16 @@ class ProcessInstanceInfo : public ProcessInfo {
m_cumulative_system_time.tv_usec > 0;
   }
 
+  int8_t GetNiceValue() const { return m_nice_value; }

feg208 wrote:

prpsinfo has pr_nice field to be populated 
https://github.com/llvm/llvm-project/blob/main/lldb/source/Plugins/Process/elf-core/ThreadElfCore.h#L99

https://github.com/llvm/llvm-project/pull/91544
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[clang] [analyzer] Support determining origins in a conditional operator in WebKit checkers. (PR #91143)

2024-05-09 Thread Ryosuke Niwa via cfe-commits
  const CXXRecordDecl *const MaybeGuardianArgCXXRecord =
-MaybeGuardianArgType->getAsCXXRecordDecl();
-if (MaybeGuardianArgCXXRecord) {
-  if (MaybeGuardian->isLocalVarDecl() &&
-  (isRefCounted(MaybeGuardianArgCXXRecord) ||
-   isRefcountedStringsHack(MaybeGuardian)) &&
-  isGuardedScopeEmbeddedInGuardianScope(V, MaybeGuardian))
-return;
-}
-  }
-
-  // Parameters are guaranteed to be safe for the duration of the call
-  // by another checker.
-  if (isa(MaybeGuardian))
-return;
-}
-  }
-
   reportBug(V);
 }
   }
diff --git a/clang/test/Analysis/Checkers/WebKit/call-args.cpp 
b/clang/test/Analysis/Checkers/WebKit/call-args.cpp
index 45d900d4ba880..e1bee8a23a250 100644
--- a/clang/test/Analysis/Checkers/WebKit/call-args.cpp
+++ b/clang/test/Analysis/Checkers/WebKit/call-args.cpp
@@ -344,3 +344,17 @@ namespace cxx_member_operator_call {
 // expected-warning@-1{{Call argument for parameter 'bad' is uncounted and 
unsafe}}
   }
 }
+
+namespace call_with_ptr_on_ref {
+  Ref provideProtected();
+  void bar(RefCountable* bad);
+  bool baz();
+  void foo(bool v) {
+bar(v ? nullptr : provideProtected().ptr());
+bar(baz() ? provideProtected().ptr() : nullptr);
+bar(v ? provide() : provideProtected().ptr());
+// expected-warning@-1{{Call argument for parameter 'bad' is uncounted and 
unsafe}}
+bar(v ? provideProtected().ptr() : provide());
+// expected-warning@-1{{Call argument for parameter 'bad' is uncounted and 
unsafe}}
+  }
+}
diff --git a/clang/test/Analysis/Checkers/WebKit/uncounted-local-vars.cpp 
b/clang/test/Analysis/Checkers/WebKit/uncounted-local-vars.cpp
index 8da1dc557a5a3..632a82eb0d8d1 100644
--- a/clang/test/Analysis/Checkers/WebKit/uncounted-local-vars.cpp
+++ b/clang/test/Analysis/Checkers/WebKit/uncounted-local-vars.cpp
@@ -198,3 +198,21 @@ void system_header() {
 }
 
 } // ignore_system_headers
+
+namespace conditional_op {
+RefCountable *provide_ref_ctnbl();
+bool bar();
+
+void foo() {
+  RefCountable *a = bar() ? nullptr : provide_ref_ctnbl();
+  // expected-warning@-1{{Local variable 'a' is uncounted and unsafe 
[alpha.webkit.UncountedLocalVarsChecker]}}
+  RefPtr b = provide_ref_ctnbl();
+  {
+RefCountable* c = bar() ? nullptr : b.get();
+c->method();
+RefCountable* d = bar() ? b.get() : nullptr;
+d->method();
+  }
+}
+
+} // namespace conditional_op

_______
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[llvm-branch-commits] [llvm] release/18.x: [AArc64][GlobalISel] Fix legalizer assert for G_INSERT_VECTOR_ELT (PR #90827)

2024-05-09 Thread Amara Emerson via llvm-branch-commits

https://github.com/aemerson closed 
https://github.com/llvm/llvm-project/pull/90827
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] release/18.x: [AArc64][GlobalISel] Fix legalizer assert for G_INSERT_VECTOR_ELT - manual merge (PR #91672)

2024-05-09 Thread Amara Emerson via llvm-branch-commits

https://github.com/aemerson ready_for_review 
https://github.com/llvm/llvm-project/pull/91672
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] [llvm] release/18.x: [llvm][lld] Pre-commit tests for RISCV TLSDESC symbols (PR #91632)

2024-05-09 Thread Fangrui Song via llvm-branch-commits

MaskRay wrote:

LGTM

https://github.com/llvm/llvm-project/pull/91632
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] release/18.x: [AArc64][GlobalISel] Fix legalizer assert for G_INSERT_VECTOR_ELT - manual merge (PR #91672)

2024-05-09 Thread Amara Emerson via llvm-branch-commits

https://github.com/aemerson edited 
https://github.com/llvm/llvm-project/pull/91672
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] release/18.x: [AArc64][GlobalISel] Fix legalizer assert for G_INSERT_VECTOR_ELT - manual merge (PR #91672)

2024-05-09 Thread Amara Emerson via llvm-branch-commits

https://github.com/aemerson edited 
https://github.com/llvm/llvm-project/pull/91672
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[Lldb-commits] [lldb] [lldb/aarch64] Fix unwinding when signal interrupts a leaf function (PR #91321)

2024-05-09 Thread Jason Molenda via lldb-commits

jasonmolenda wrote:

Ah, so the problem is,
```
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION 
(code=1, subcode=0xdead)
  * frame #0: 0x00013f2c b.out`signal_generating_add + 4 at 
signal-in-leaf-function-aarch64.c:5
frame #1: 0x00013f7c b.out`main + 44 at 
signal-in-leaf-function-aarch64.c:14
frame #2: 0x000185c76244 dyld`start + 2792
```

The bad instruction in `signal_generating_add()`, is sent to the program master 
a EXC_BAD_INSTRUCTION mach exception, not a posix signal (or maybe it was 
received by lldb as a mach exception and if it had continued to the process it 
would be recieved as a signal).

When I've done these kinds of test cases in the past, I usually add a signal 
handler and then send the signal to the inferior, e.g. 
`lldb/test/API/functionalities/unwind/sigtramp/main.c` -- this test is marked 
`@skipUnlessDarwin` with a comment of 
```
# On different platforms the "_sigtramp" and "__kill" frames are likely to 
be different.
# This test could probably be adapted to run on linux/*bsd easily enough.
```
(the test explicitly checks the stack for the function names that should appear 
above the signal handler)

https://github.com/llvm/llvm-project/pull/91321
_______
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

2024-05-09 Thread Samira Bazuzi via cfe-commits
port.h
@@ -355,8 +355,8 @@ checkDataflow(AnalysisInputs AI,
   auto SetupTest = [,
 PrevSetupTest = std::move(AI.SetupTest)](
AnalysisOutputs ) -> llvm::Error {
-auto MaybeStmtToAnnotations = buildStatementToAnnotationMapping(
-cast(AO.InitEnv.getDeclCtx()), AO.Code);
+auto MaybeStmtToAnnotations =
+buildStatementToAnnotationMapping(AO.InitEnv.getCurrentFunc(), 
AO.Code);
 if (!MaybeStmtToAnnotations) {
   return MaybeStmtToAnnotations.takeError();
 }

>From 6982564302fb3c9f524ae68c47fa5603d1216e09 Mon Sep 17 00:00:00 2001
From: Samira Bazuzi 
Date: Thu, 9 May 2024 18:01:07 -0400
Subject: [PATCH 2/2] Add test and crash fix for analysis of Stmt.

---
 .../FlowSensitive/DataflowEnvironment.cpp |  8 +++
 .../TypeErasedDataflowAnalysisTest.cpp| 24 +++
 2 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp 
b/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
index 41bdeaf0375ef..32547db4fd119 100644
--- a/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
+++ b/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
@@ -773,14 +773,12 @@ Environment Environment::join(const Environment , 
const Environment ,
   JoinedEnv.LocForRecordReturnVal = EnvA.LocForRecordReturnVal;
   JoinedEnv.ThisPointeeLoc = EnvA.ThisPointeeLoc;
 
-  if (EnvA.TargetStack.empty()) {
+  if (EnvA.TargetStack.empty() || !EnvA.getCurrentFunc()) {
 JoinedEnv.ReturnVal = nullptr;
   } else {
-auto *Func = EnvA.getCurrentFunc();
-assert(Func != nullptr);
 JoinedEnv.ReturnVal =
-joinValues(Func->getReturnType(), EnvA.ReturnVal, EnvA, EnvB.ReturnVal,
-   EnvB, JoinedEnv, Model);
+joinValues(EnvA.getCurrentFunc()->getReturnType(), EnvA.ReturnVal, 
EnvA,
+   EnvB.ReturnVal, EnvB, JoinedEnv, Model);
   }
 
   if (EnvA.ReturnLoc == EnvB.ReturnLoc)
diff --git 
a/clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp 
b/clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp
index b0b579d2bc19e..2ddf0a6f66fd4 100644
--- a/clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp
+++ b/clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp
@@ -146,6 +146,30 @@ TEST_F(DataflowAnalysisTest, 
DiagnoseFunctionDiagnoserCalledOnEachElement) {
" (Lifetime ends)\n")));
 }
 
+TEST_F(DataflowAnalysisTest, CanAnalyzeStmt) {
+  std::string Code = R"cc(
+  struct S {int i;};
+  S getAnS() {return S{1};};
+  void foo() {
+S AnS = getAnS();
+  }
+)cc";
+  AST = tooling::buildASTFromCodeWithArgs(Code, {"-std=c++11"});
+  const auto  = matchNode(declStmt());
+  const auto  = matchNode(functionDecl(hasName("foo")));
+
+  ACFG = std::make_unique(llvm::cantFail(AdornedCFG::build(
+  Func, const_cast(DeclStatement), AST->getASTContext(;
+
+  NoopAnalysis Analysis = NoopAnalysis(AST->getASTContext());
+  DACtx = std::make_unique(
+  std::make_unique());
+  Environment Env(*DACtx, const_cast(DeclStatement));
+
+  ASSERT_THAT_ERROR(runDataflowAnalysis(*ACFG, Analysis, Env).takeError(),
+llvm::Succeeded());
+}
+
 // Tests for the statement-to-block map.
 using StmtToBlockTest = DataflowAnalysisTest;
 

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[llvm-branch-commits] [BOLT][NFC] Define getExprValue helper (PR #91663)

2024-05-09 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/91663
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [BOLT][NFC] Simplify analyzeIndirectBranch (PR #91662)

2024-05-09 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/91662
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [BOLT] Support POSSIBLE_PIC_FIXED_BRANCH (PR #91667)

2024-05-09 Thread via llvm-branch-commits
MCInst *, unsigned ,
+unsigned , int64_t ,
+const MCExpr *, MCInst *,
+MCInst *) const override {
 // Try to find a (base) memory location from where the address for
 // the indirect branch is loaded. For X86-64 the memory will be specified
 // in the following format:
@@ -2044,6 +2072,7 @@ class X86MCPlusBuilder : public MCPlusBuilder {
 IndexRegNumOut = X86::NoRegister;
 DispValueOut = 0;
 DispExprOut = nullptr;
+FixedEntryLoadInst = nullptr;
 
 std::reverse_iterator II(End);
 std::reverse_iterator IE(Begin);
@@ -2076,7 +2105,8 @@ class X86MCPlusBuilder : public MCPlusBuilder {
   unsigned R2 = PrevInstr.getOperand(2).getReg();
   if (R1 == R2)
 return IndirectBranchType::UNKNOWN;
-  std::tie(Type, MemLocInstr) = analyzePICJumpTable(PrevII, IE, R1, 
R2);
+  std::tie(Type, MemLocInstr, FixedEntryLoadInst) =
+  analyzePICJumpTable(PrevII, IE, R1, R2);
   break;
 }
 return IndirectBranchType::UNKNOWN;
@@ -2120,6 +2150,8 @@ class X86MCPlusBuilder : public MCPlusBuilder {
   if (MO->ScaleImm != 1 || MO->BaseRegNum != RIPRegister)
 return IndirectBranchType::UNKNOWN;
   break;
+case IndirectBranchType::POSSIBLE_PIC_FIXED_BRANCH:
+  break;
 default:
   if (MO->ScaleImm != PtrSize)
 return IndirectBranchType::UNKNOWN;
diff --git a/bolt/test/X86/Inputs/jump-table-fixed-ref-pic.s 
b/bolt/test/X86/Inputs/jump-table-fixed-ref-pic.s
index 66629a4880e64..6407964593e2d 100644
--- a/bolt/test/X86/Inputs/jump-table-fixed-ref-pic.s
+++ b/bolt/test/X86/Inputs/jump-table-fixed-ref-pic.s
@@ -6,7 +6,7 @@ main:
   jae .L4
   cmpq $0x1, %rdi
   jne .L4
-  mov .Ljt_pic+8(%rip), %rax
+  movslq .Ljt_pic+8(%rip), %rax
   lea .Ljt_pic(%rip), %rdx
   add %rdx, %rax
   jmpq *%rax
diff --git a/bolt/test/X86/jump-table-fixed-ref-pic.test 
b/bolt/test/X86/jump-table-fixed-ref-pic.test
index 4195b97aac501..d2e90eb1d4099 100644
--- a/bolt/test/X86/jump-table-fixed-ref-pic.test
+++ b/bolt/test/X86/jump-table-fixed-ref-pic.test
@@ -1,9 +1,16 @@
 # Verify that BOLT detects fixed destination of indirect jump for PIC
 # case.
 
-XFAIL: *
-
 RUN: %clang %cflags -no-pie %S/Inputs/jump-table-fixed-ref-pic.s -Wl,-q -o %t
-RUN: llvm-bolt %t --relocs -o %t.null 2>&1 | FileCheck %s
+RUN: llvm-bolt %t --relocs -o %t.null -print-cfg 2>&1 | FileCheck %s
+
+CHECK: BOLT-INFO: fixed PIC indirect branch detected in main {{.*}} the 
destination value is 0x[[#TGT:]]
+CHECK: Binary Function "main" after building cfg
+
+CHECK: movslq  ".rodata/1"+8(%rip), %rax
+CHECK-NEXT: leaq    ".rodata/1"(%rip), %rdx
+CHECK-NEXT: addq%rdx, %rax
+CHECK-NEXT: jmp .Ltmp1
 
-CHECK: BOLT-INFO: fixed indirect branch detected in main
+CHECK: .Ltmp1 (2 instructions, align : 1)
+CHECK-NEXT: Secondary Entry Point: __ENTRY_main@0x[[#TGT]]

``




https://github.com/llvm/llvm-project/pull/91667
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [BOLT] Support POSSIBLE_PIC_FIXED_BRANCH (PR #91667)

2024-05-09 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov created 
https://github.com/llvm/llvm-project/pull/91667

Detect and support fixed PIC indirect jumps of the following form:
```
movslq  En(%rip), %r1
leaq  PIC_JUMP_TABLE(%rip), %r2
addq  %r2, %r1
jmpq  *%r1
```

with PIC_JUMP_TABLE that looks like following:

```
  JT:  --
   E1:| L1 - JT  |
  |--|
   E2:| L2 - JT  |
  |--|
  |  |
 ..
   En:| Ln - JT  |
   --
```

The code could be produced by compilers, see
https://github.com/llvm/llvm-project/issues/91648.

Test Plan: updated jump-table-fixed-ref-pic.test



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[Lldb-commits] [lldb] [lldb] Fixed SyntaxWarning: invalid escape sequence \[ \d \s (PR #91146)

2024-05-09 Thread Dmitry Vasilyev via lldb-commits

https://github.com/slydiman closed 
https://github.com/llvm/llvm-project/pull/91146
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] ba66dfb - [lldb] Fixed SyntaxWarning: invalid escape sequence \[ \d \s (#91146)

2024-05-09 Thread via lldb-commits

Author: Dmitry Vasilyev
Date: 2024-05-10T01:56:14+04:00
New Revision: ba66dfb11bcaef5e0dc21358b3712b491d61d020

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

LOG: [lldb] Fixed SyntaxWarning: invalid escape sequence \[ \d \s (#91146)

Reproduced with Python 3.12.3

Added: 


Modified: 
lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py

Removed: 




diff  --git 
a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py 
b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
index 75522158b3221..8c8e4abed0b45 100644
--- 
a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
+++ 
b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
@@ -130,9 +130,9 @@ def setUp(self):
 self.stub_sends_two_stop_notifications_on_kill = False
 if configuration.lldb_platform_url:
 if configuration.lldb_platform_url.startswith("unix-"):
-url_pattern = "(.+)://\[?(.+?)\]?/.*"
+url_pattern = r"(.+)://\[?(.+?)\]?/.*"
 else:
-url_pattern = "(.+)://(.+):\d+"
+url_pattern = r"(.+)://(.+):\d+"
 scheme, host = re.match(
 url_pattern, configuration.lldb_platform_url
 ).groups()

diff  --git 
a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py 
b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py
index 61c5c3a7c865a..d1a4119bac781 100644
--- 
a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py
+++ 
b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py
@@ -50,7 +50,7 @@ def get_debugserver_exe():
 
 
 _LOG_LINE_REGEX = re.compile(
-r"^(lldb-server|debugserver)\s+<\s*(\d+)>" + 
"\s+(read|send)\s+packet:\s+(.+)$"
+r"^(lldb-server|debugserver)\s+<\s*(\d+)>\s+(read|send)\s+packet:\s+(.+)$"
 )
 
 


    
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[llvm-branch-commits] [BOLT] Eliminate dead jump tables (PR #91666)

2024-05-09 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-bolt

Author: Amir Ayupov (aaupov)


Changes

Dead jump tables such as those arising from FIXED_PIC_BRANCH
optimization don't need to be updated or moved. Further, if any jump
table entry points to a block removed by unreachable code elimination,
we would be unable to update it and jump table emission would fail.

Identify non-referenced jump tables and delete them to prevent that.

Test Plan: NFC for existing tests.


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


1 Files Affected:

- (modified) bolt/lib/Core/BinaryFunction.cpp (+20) 


``diff
diff --git a/bolt/lib/Core/BinaryFunction.cpp b/bolt/lib/Core/BinaryFunction.cpp
index 11103f7bdce8..f74ecea8ac0a 100644
--- a/bolt/lib/Core/BinaryFunction.cpp
+++ b/bolt/lib/Core/BinaryFunction.cpp
@@ -1697,6 +1697,26 @@ void BinaryFunction::postProcessEntryPoints() {
 }
 
 void BinaryFunction::postProcessJumpTables() {
+  // Set of JTs accessed from this function.
+  std::unordered_set LiveJTs;
+  for (auto  : JTSites)
+LiveJTs.emplace(JTSite.second);
+
+  // Remove dead jump tables (reference removed as a result of
+  // POSSIBLE_PIC_FIXED_BRANCH optimization).
+  for (auto JTI = JumpTables.begin(), JTE = JumpTables.end(); JTI != JTE; ) {
+const uint64_t Address = JTI->first;
+JumpTable *JT = JTI->second;
+bool HasOneParent = JT->Parents.size() == 1;
+if (LiveJTs.count(Address) == 0 && HasOneParent) {
+  BC.deregisterJumpTable(Address);
+  delete JT;
+  JTI = JumpTables.erase(JTI);
+  continue;
+}
+++JTI;
+  }
+
   // Create labels for all entries.
   for (auto  : JumpTables) {
 JumpTable  = *JTI.second;

``




https://github.com/llvm/llvm-project/pull/91666
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [BOLT] Eliminate dead jump tables (PR #91666)

2024-05-09 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov created 
https://github.com/llvm/llvm-project/pull/91666

Dead jump tables such as those arising from FIXED_PIC_BRANCH
optimization don't need to be updated or moved. Further, if any jump
table entry points to a block removed by unreachable code elimination,
we would be unable to update it and jump table emission would fail.

Identify non-referenced jump tables and delete them to prevent that.

Test Plan: NFC for existing tests.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [BOLT][NFCI] Fix return type of BC::getSignedValueAtAddress (PR #91664)

2024-05-09 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-bolt

Author: Amir Ayupov (aaupov)


Changes

getSignedValueAtAddress calls DataExtractor::getSigned which naturally
returns a signed value.

Test Plan: NFCI


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


3 Files Affected:

- (modified) bolt/include/bolt/Core/BinaryContext.h (+1-2) 
- (modified) bolt/lib/Core/BinaryContext.cpp (+1-1) 
- (modified) bolt/lib/Rewrite/LinuxKernelRewriter.cpp (+1-1) 


``diff
diff --git a/bolt/include/bolt/Core/BinaryContext.h 
b/bolt/include/bolt/Core/BinaryContext.h
index 75765819ac464..4a59a581dfedb 100644
--- a/bolt/include/bolt/Core/BinaryContext.h
+++ b/bolt/include/bolt/Core/BinaryContext.h
@@ -1217,8 +1217,7 @@ class BinaryContext {
 
   /// Return a signed value of \p Size stored at \p Address. The address has
   /// to be a valid statically allocated address for the binary.
-  ErrorOr getSignedValueAtAddress(uint64_t Address,
-size_t Size) const;
+  ErrorOr getSignedValueAtAddress(uint64_t Address, size_t Size) 
const;
 
   /// Special case of getUnsignedValueAtAddress() that uses a pointer size.
   ErrorOr getPointerAtAddress(uint64_t Address) const {
diff --git a/bolt/lib/Core/BinaryContext.cpp b/bolt/lib/Core/BinaryContext.cpp
index ad2eb18caf109..507b203ea9d8b 100644
--- a/bolt/lib/Core/BinaryContext.cpp
+++ b/bolt/lib/Core/BinaryContext.cpp
@@ -2212,7 +2212,7 @@ ErrorOr 
BinaryContext::getUnsignedValueAtAddress(uint64_t Address,
   return DE.getUnsigned(, Size);
 }
 
-ErrorOr BinaryContext::getSignedValueAtAddress(uint64_t Address,
+ErrorOr BinaryContext::getSignedValueAtAddress(uint64_t Address,
  size_t Size) const {
   const ErrorOr Section = getSectionForAddress(Address);
   if (!Section)
diff --git a/bolt/lib/Rewrite/LinuxKernelRewriter.cpp 
b/bolt/lib/Rewrite/LinuxKernelRewriter.cpp
index 99775ccfe38d3..b2c8b2446f7e1 100644
--- a/bolt/lib/Rewrite/LinuxKernelRewriter.cpp
+++ b/bolt/lib/Rewrite/LinuxKernelRewriter.cpp
@@ -393,7 +393,7 @@ void LinuxKernelRewriter::processLKKSymtab(bool IsGPL) {
 
   for (uint64_t I = 0; I < SectionSize; I += 4) {
 const uint64_t EntryAddress = SectionAddress + I;
-ErrorOr Offset = BC.getSignedValueAtAddress(EntryAddress, 4);
+ErrorOr Offset = BC.getSignedValueAtAddress(EntryAddress, 4);
 assert(Offset && "Reading valid PC-relative offset for a ksymtab entry");
 const int32_t SignedOffset = *Offset;
 const uint64_t RefAddress = EntryAddress + SignedOffset;

``




https://github.com/llvm/llvm-project/pull/91664
_______
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [BOLT][NFCI] Fix return type of BC::getSignedValueAtAddress (PR #91664)

2024-05-09 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov created 
https://github.com/llvm/llvm-project/pull/91664

getSignedValueAtAddress calls DataExtractor::getSigned which naturally
returns a signed value.

Test Plan: NFCI



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] release/18.x: [AArc64][GlobalISel] Fix legalizer assert for G_INSERT_VECTOR_ELT (PR #90827)

2024-05-09 Thread Amara Emerson via llvm-branch-commits

aemerson wrote:

> @aemerson Did you submit a new pull request with a fix?

I have not yet, will do so now...

https://github.com/llvm/llvm-project/pull/90827
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [BOLT][NFC] Define getExprValue helper (PR #91663)

2024-05-09 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-bolt

Author: Amir Ayupov (aaupov)


Changes

Move out common code extracting the address of a MCExpr. To be reused in
a follow-up diff.

Test Plan: NFC


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


1 Files Affected:

- (modified) bolt/lib/Core/BinaryFunction.cpp (+10-6) 


``diff
diff --git a/bolt/lib/Core/BinaryFunction.cpp b/bolt/lib/Core/BinaryFunction.cpp
index de34421ebeb08..11103f7bdce8b 100644
--- a/bolt/lib/Core/BinaryFunction.cpp
+++ b/bolt/lib/Core/BinaryFunction.cpp
@@ -851,15 +851,19 @@ BinaryFunction::processIndirectBranch(MCInst 
, unsigned Size,
 return IndirectBranchType::UNKNOWN;
   }
 
-  // RIP-relative addressing should be converted to symbol form by now
-  // in processed instructions (but not in jump).
-  if (DispExpr) {
+  auto getExprValue = [&](const MCExpr *Expr) {
 const MCSymbol *TargetSym;
 uint64_t TargetOffset;
-std::tie(TargetSym, TargetOffset) = BC.MIB->getTargetSymbolInfo(DispExpr);
+std::tie(TargetSym, TargetOffset) = BC.MIB->getTargetSymbolInfo(Expr);
 ErrorOr SymValueOrError = BC.getSymbolValue(*TargetSym);
-assert(SymValueOrError && "global symbol needs a value");
-ArrayStart = *SymValueOrError + TargetOffset;
+assert(SymValueOrError && "Global symbol needs a value");
+return *SymValueOrError + TargetOffset;
+  };
+
+  // RIP-relative addressing should be converted to symbol form by now
+  // in processed instructions (but not in jump).
+  if (DispExpr) {
+ArrayStart = getExprValue(DispExpr);
 BaseRegNum = BC.MIB->getNoRegister();
 if (BC.isAArch64()) {
   ArrayStart &= ~0xFFFULL;

``




https://github.com/llvm/llvm-project/pull/91663
___________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [BOLT][NFC] Define getExprValue helper (PR #91663)

2024-05-09 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov created 
https://github.com/llvm/llvm-project/pull/91663

Move out common code extracting the address of a MCExpr. To be reused in
a follow-up diff.

Test Plan: NFC



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [BOLT][NFC] Simplify analyzeIndirectBranch (PR #91662)

2024-05-09 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-bolt

Author: Amir Ayupov (aaupov)


Changes

Simplify mutually exclusive sanity checks in analyzeIndirectBranch,
where an UNKNOWN IndirectBranchType is to be returned. Reduces confusion
and code duplication when adding a new IndirectBranchType (to be added
in a follow-up diff).

Test Plan: NFC


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


1 Files Affected:

- (modified) bolt/lib/Target/X86/X86MCPlusBuilder.cpp (+9-7) 


``diff
diff --git a/bolt/lib/Target/X86/X86MCPlusBuilder.cpp 
b/bolt/lib/Target/X86/X86MCPlusBuilder.cpp
index e7cabdabce90..86e7d4dfaed8 100644
--- a/bolt/lib/Target/X86/X86MCPlusBuilder.cpp
+++ b/bolt/lib/Target/X86/X86MCPlusBuilder.cpp
@@ -2115,13 +2115,15 @@ class X86MCPlusBuilder : public MCPlusBuilder {
   return IndirectBranchType::POSSIBLE_FIXED_BRANCH;
 }
 
-if (Type == IndirectBranchType::POSSIBLE_PIC_JUMP_TABLE &&
-(MO->ScaleImm != 1 || MO->BaseRegNum != RIPRegister))
-  return IndirectBranchType::UNKNOWN;
-
-if (Type != IndirectBranchType::POSSIBLE_PIC_JUMP_TABLE &&
-MO->ScaleImm != PtrSize)
-  return IndirectBranchType::UNKNOWN;
+switch (Type) {
+case IndirectBranchType::POSSIBLE_PIC_JUMP_TABLE:
+  if (MO->ScaleImm != 1 || MO->BaseRegNum != RIPRegister)
+return IndirectBranchType::UNKNOWN;
+  break;
+default:
+  if (MO->ScaleImm != PtrSize)
+return IndirectBranchType::UNKNOWN;
+}
 
 MemLocInstrOut = MemLocInstr;
 

``




https://github.com/llvm/llvm-project/pull/91662
_______
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


  1   2   3   4   5   6   7   8   9   10   >