[llvm-branch-commits] [llvm] release/18.x: [AArch64][GlobalISel] Fail legalization for unknown libcalls. (#81873) (PR #82103)

2024-02-17 Thread via llvm-branch-commits

https://github.com/llvmbot milestoned 
https://github.com/llvm/llvm-project/pull/82103
___
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: [AArch64][GlobalISel] Fail legalization for unknown libcalls. (#81873) (PR #82103)

2024-02-17 Thread via llvm-branch-commits

https://github.com/llvmbot created 
https://github.com/llvm/llvm-project/pull/82103

Backport 47c65cf62d06add9f55a77c9d45390fa3b986fc5

Requested by: @davemgreen

>From 8a3d8f0c2531877c84203298a979419a2ba652ee Mon Sep 17 00:00:00 2001
From: David Green 
Date: Sat, 17 Feb 2024 08:57:14 +
Subject: [PATCH] [AArch64][GlobalISel] Fail legalization for unknown libcalls.
 (#81873)

If, like powi on windows, the libcall is unavailable we should fall back
to SDAG. Currently we try and generate a call to "".

(cherry picked from commit 47c65cf62d06add9f55a77c9d45390fa3b986fc5)
---
 .../CodeGen/GlobalISel/LegalizerHelper.cpp|   2 +
 llvm/test/CodeGen/AArch64/win64-fpowi.ll  | 136 ++
 2 files changed, 138 insertions(+)
 create mode 100644 llvm/test/CodeGen/AArch64/win64-fpowi.ll

diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp 
b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
index 3b2cf319109273..c0c22e36004f72 100644
--- a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
@@ -596,6 +596,8 @@ llvm::createLibcall(MachineIRBuilder &MIRBuilder, 
RTLIB::Libcall Libcall,
 LostDebugLocObserver &LocObserver, MachineInstr *MI) {
   auto &TLI = *MIRBuilder.getMF().getSubtarget().getTargetLowering();
   const char *Name = TLI.getLibcallName(Libcall);
+  if (!Name)
+return LegalizerHelper::UnableToLegalize;
   const CallingConv::ID CC = TLI.getLibcallCallingConv(Libcall);
   return createLibcall(MIRBuilder, Name, Result, Args, CC, LocObserver, MI);
 }
diff --git a/llvm/test/CodeGen/AArch64/win64-fpowi.ll 
b/llvm/test/CodeGen/AArch64/win64-fpowi.ll
new file mode 100644
index 00..3eb74f8394ec4e
--- /dev/null
+++ b/llvm/test/CodeGen/AArch64/win64-fpowi.ll
@@ -0,0 +1,136 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 
UTC_ARGS: --version 3
+; RUN: llc -mtriple=aarch64-pc-windows-msvc19 -verify-machineinstrs %s -o - | 
FileCheck %s
+; RUN: llc -mtriple=aarch64-pc-windows-msvc19 -global-isel 
-global-isel-abort=2 -verify-machineinstrs %s -o - | FileCheck %s
+
+define double @powi_f64(double %a, i32 %b) {
+; CHECK-LABEL: powi_f64:
+; CHECK:   // %bb.0: // %entry
+; CHECK-NEXT:scvtf d1, w0
+; CHECK-NEXT:b pow
+entry:
+  %c = call double @llvm.powi.f64.i32(double %a, i32 %b)
+  ret double %c
+}
+
+define float @powi_f32(float %a, i32 %b) {
+; CHECK-LABEL: powi_f32:
+; CHECK:   // %bb.0: // %entry
+; CHECK-NEXT:scvtf s1, w0
+; CHECK-NEXT:b powf
+entry:
+  %c = call float @llvm.powi.f32.i32(float %a, i32 %b)
+  ret float %c
+}
+
+define half @powi_f16(half %a, i32 %b) {
+; CHECK-LABEL: powi_f16:
+; CHECK:   .seh_proc powi_f16
+; CHECK-NEXT:  // %bb.0: // %entry
+; CHECK-NEXT:str x30, [sp, #-16]! // 8-byte Folded Spill
+; CHECK-NEXT:.seh_save_reg_x x30, 16
+; CHECK-NEXT:.seh_endprologue
+; CHECK-NEXT:fcvt s0, h0
+; CHECK-NEXT:scvtf s1, w0
+; CHECK-NEXT:bl powf
+; CHECK-NEXT:fcvt h0, s0
+; CHECK-NEXT:.seh_startepilogue
+; CHECK-NEXT:ldr x30, [sp], #16 // 8-byte Folded Reload
+; CHECK-NEXT:.seh_save_reg_x x30, 16
+; CHECK-NEXT:.seh_endepilogue
+; CHECK-NEXT:ret
+; CHECK-NEXT:.seh_endfunclet
+; CHECK-NEXT:.seh_endproc
+entry:
+  %c = call half @llvm.powi.f16.i32(half %a, i32 %b)
+  ret half %c
+}
+
+define <2 x double> @powi_v2f64(<2 x double> %a, i32 %b) {
+; CHECK-LABEL: powi_v2f64:
+; CHECK:   .seh_proc powi_v2f64
+; CHECK-NEXT:  // %bb.0: // %entry
+; CHECK-NEXT:sub sp, sp, #48
+; CHECK-NEXT:.seh_stackalloc 48
+; CHECK-NEXT:str x30, [sp, #32] // 8-byte Folded Spill
+; CHECK-NEXT:.seh_save_reg x30, 32
+; CHECK-NEXT:str d8, [sp, #40] // 8-byte Folded Spill
+; CHECK-NEXT:.seh_save_freg d8, 40
+; CHECK-NEXT:.seh_endprologue
+; CHECK-NEXT:scvtf d8, w0
+; CHECK-NEXT:str q0, [sp] // 16-byte Folded Spill
+; CHECK-NEXT:mov d0, v0.d[1]
+; CHECK-NEXT:fmov d1, d8
+; CHECK-NEXT:bl pow
+; CHECK-NEXT:fmov d1, d8
+; CHECK-NEXT:// kill: def $d0 killed $d0 def $q0
+; CHECK-NEXT:str q0, [sp, #16] // 16-byte Folded Spill
+; CHECK-NEXT:ldr q0, [sp] // 16-byte Folded Reload
+; CHECK-NEXT:// kill: def $d0 killed $d0 killed $q0
+; CHECK-NEXT:bl pow
+; CHECK-NEXT:ldr q1, [sp, #16] // 16-byte Folded Reload
+; CHECK-NEXT:// kill: def $d0 killed $d0 def $q0
+; CHECK-NEXT:mov v0.d[1], v1.d[0]
+; CHECK-NEXT:.seh_startepilogue
+; CHECK-NEXT:ldr d8, [sp, #40] // 8-byte Folded Reload
+; CHECK-NEXT:.seh_save_freg d8, 40
+; CHECK-NEXT:ldr x30, [sp, #32] // 8-byte Folded Reload
+; CHECK-NEXT:.seh_save_reg x30, 32
+; CHECK-NEXT:add sp, sp, #48
+; CHECK-NEXT:.seh_stackalloc 48
+; CHECK-NEXT:.seh_endepilogue
+; CHECK-NEXT:ret
+; CHECK-NEXT:.seh_endfunclet
+; CHECK-NEXT:.seh_endproc
+entry:
+  %c = call <2 x double> @llvm.powi.v2f64.i32(<2 x double> %a, i32 %b)
+  ret <2 x double> %c
+}
+
+define <2 x f

[llvm-branch-commits] [llvm] release/18.x: [AArch64][GlobalISel] Fail legalization for unknown libcalls. (#81873) (PR #82103)

2024-02-17 Thread via llvm-branch-commits

llvmbot wrote:

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

https://github.com/llvm/llvm-project/pull/82103
___
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: [AArch64][GlobalISel] Fail legalization for unknown libcalls. (#81873) (PR #82103)

2024-02-17 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-backend-aarch64

Author: None (llvmbot)


Changes

Backport 47c65cf62d06add9f55a77c9d45390fa3b986fc5

Requested by: @davemgreen

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


2 Files Affected:

- (modified) llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp (+2) 
- (added) llvm/test/CodeGen/AArch64/win64-fpowi.ll (+136) 


``diff
diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp 
b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
index 3b2cf319109273..c0c22e36004f72 100644
--- a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
@@ -596,6 +596,8 @@ llvm::createLibcall(MachineIRBuilder &MIRBuilder, 
RTLIB::Libcall Libcall,
 LostDebugLocObserver &LocObserver, MachineInstr *MI) {
   auto &TLI = *MIRBuilder.getMF().getSubtarget().getTargetLowering();
   const char *Name = TLI.getLibcallName(Libcall);
+  if (!Name)
+return LegalizerHelper::UnableToLegalize;
   const CallingConv::ID CC = TLI.getLibcallCallingConv(Libcall);
   return createLibcall(MIRBuilder, Name, Result, Args, CC, LocObserver, MI);
 }
diff --git a/llvm/test/CodeGen/AArch64/win64-fpowi.ll 
b/llvm/test/CodeGen/AArch64/win64-fpowi.ll
new file mode 100644
index 00..3eb74f8394ec4e
--- /dev/null
+++ b/llvm/test/CodeGen/AArch64/win64-fpowi.ll
@@ -0,0 +1,136 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 
UTC_ARGS: --version 3
+; RUN: llc -mtriple=aarch64-pc-windows-msvc19 -verify-machineinstrs %s -o - | 
FileCheck %s
+; RUN: llc -mtriple=aarch64-pc-windows-msvc19 -global-isel 
-global-isel-abort=2 -verify-machineinstrs %s -o - | FileCheck %s
+
+define double @powi_f64(double %a, i32 %b) {
+; CHECK-LABEL: powi_f64:
+; CHECK:   // %bb.0: // %entry
+; CHECK-NEXT:scvtf d1, w0
+; CHECK-NEXT:b pow
+entry:
+  %c = call double @llvm.powi.f64.i32(double %a, i32 %b)
+  ret double %c
+}
+
+define float @powi_f32(float %a, i32 %b) {
+; CHECK-LABEL: powi_f32:
+; CHECK:   // %bb.0: // %entry
+; CHECK-NEXT:scvtf s1, w0
+; CHECK-NEXT:b powf
+entry:
+  %c = call float @llvm.powi.f32.i32(float %a, i32 %b)
+  ret float %c
+}
+
+define half @powi_f16(half %a, i32 %b) {
+; CHECK-LABEL: powi_f16:
+; CHECK:   .seh_proc powi_f16
+; CHECK-NEXT:  // %bb.0: // %entry
+; CHECK-NEXT:str x30, [sp, #-16]! // 8-byte Folded Spill
+; CHECK-NEXT:.seh_save_reg_x x30, 16
+; CHECK-NEXT:.seh_endprologue
+; CHECK-NEXT:fcvt s0, h0
+; CHECK-NEXT:scvtf s1, w0
+; CHECK-NEXT:bl powf
+; CHECK-NEXT:fcvt h0, s0
+; CHECK-NEXT:.seh_startepilogue
+; CHECK-NEXT:ldr x30, [sp], #16 // 8-byte Folded Reload
+; CHECK-NEXT:.seh_save_reg_x x30, 16
+; CHECK-NEXT:.seh_endepilogue
+; CHECK-NEXT:ret
+; CHECK-NEXT:.seh_endfunclet
+; CHECK-NEXT:.seh_endproc
+entry:
+  %c = call half @llvm.powi.f16.i32(half %a, i32 %b)
+  ret half %c
+}
+
+define <2 x double> @powi_v2f64(<2 x double> %a, i32 %b) {
+; CHECK-LABEL: powi_v2f64:
+; CHECK:   .seh_proc powi_v2f64
+; CHECK-NEXT:  // %bb.0: // %entry
+; CHECK-NEXT:sub sp, sp, #48
+; CHECK-NEXT:.seh_stackalloc 48
+; CHECK-NEXT:str x30, [sp, #32] // 8-byte Folded Spill
+; CHECK-NEXT:.seh_save_reg x30, 32
+; CHECK-NEXT:str d8, [sp, #40] // 8-byte Folded Spill
+; CHECK-NEXT:.seh_save_freg d8, 40
+; CHECK-NEXT:.seh_endprologue
+; CHECK-NEXT:scvtf d8, w0
+; CHECK-NEXT:str q0, [sp] // 16-byte Folded Spill
+; CHECK-NEXT:mov d0, v0.d[1]
+; CHECK-NEXT:fmov d1, d8
+; CHECK-NEXT:bl pow
+; CHECK-NEXT:fmov d1, d8
+; CHECK-NEXT:// kill: def $d0 killed $d0 def $q0
+; CHECK-NEXT:str q0, [sp, #16] // 16-byte Folded Spill
+; CHECK-NEXT:ldr q0, [sp] // 16-byte Folded Reload
+; CHECK-NEXT:// kill: def $d0 killed $d0 killed $q0
+; CHECK-NEXT:bl pow
+; CHECK-NEXT:ldr q1, [sp, #16] // 16-byte Folded Reload
+; CHECK-NEXT:// kill: def $d0 killed $d0 def $q0
+; CHECK-NEXT:mov v0.d[1], v1.d[0]
+; CHECK-NEXT:.seh_startepilogue
+; CHECK-NEXT:ldr d8, [sp, #40] // 8-byte Folded Reload
+; CHECK-NEXT:.seh_save_freg d8, 40
+; CHECK-NEXT:ldr x30, [sp, #32] // 8-byte Folded Reload
+; CHECK-NEXT:.seh_save_reg x30, 32
+; CHECK-NEXT:add sp, sp, #48
+; CHECK-NEXT:.seh_stackalloc 48
+; CHECK-NEXT:.seh_endepilogue
+; CHECK-NEXT:ret
+; CHECK-NEXT:.seh_endfunclet
+; CHECK-NEXT:.seh_endproc
+entry:
+  %c = call <2 x double> @llvm.powi.v2f64.i32(<2 x double> %a, i32 %b)
+  ret <2 x double> %c
+}
+
+define <2 x float> @powi_v2f32(<2 x float> %a, i32 %b) {
+; CHECK-LABEL: powi_v2f32:
+; CHECK:   .seh_proc powi_v2f32
+; CHECK-NEXT:  // %bb.0: // %entry
+; CHECK-NEXT:sub sp, sp, #48
+; CHECK-NEXT:.seh_stackalloc 48
+; CHECK-NEXT:str x30, [sp, #32] // 8-byte Folded Spill
+; CHECK-NEXT:.seh_save_reg x30, 32
+; CHECK-NEXT:str d8, [sp, #40] // 8-byte Folded Spill
+; CHECK-NEXT:.seh_save_fre

[llvm-branch-commits] [llvm] release/18.x: [AArch64][GlobalISel] Fail legalization for unknown libcalls. (#81873) (PR #82103)

2024-02-17 Thread Kiran Chandramohan via llvm-branch-commits

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


https://github.com/llvm/llvm-project/pull/82103
___
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] [libcxx] release/18.x: [libc++] Only include from the C library if it exists (#81887) (PR #82045)

2024-02-17 Thread Mark de Wever via llvm-branch-commits

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

It looks like the Buildkite failures are due to the known Windows bot issues.

https://github.com/llvm/llvm-project/pull/82045
___
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] [libcxx] [libc++][chrono] Loads leap-seconds.list in tzdb. (PR #82113)

2024-02-17 Thread Mark de Wever via llvm-branch-commits

https://github.com/mordante created 
https://github.com/llvm/llvm-project/pull/82113

This implements the loading of the leap-seconds.list file and store its 
contents in the tzdb struct.

This adds the required `leap_seconds` member.

The class leap_seconds is fully implemented including its non-member functions.

Implements parts of:
- P0355 Extending  to Calendars and Time Zones
- P1614 The Mothership has Landed

Implements:
- P1981 Rename leap to leap_second
- LWG3359  leap second support should allow for negative leap seconds
- LWG3383 §[time.zone.leap.nonmembers] sys_seconds should be replaced with 
seconds

>From 3c588bde050451bc8cf3a934b101585b8519abd5 Mon Sep 17 00:00:00 2001
From: Mark de Wever 
Date: Fri, 23 Sep 2022 18:33:20 +0200
Subject: [PATCH] [libc++][chrono] Loads leap-seconds.list in tzdb.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This implements the loading of the leap-seconds.list file and store its
contents in the tzdb struct.

This adds the required `leap_seconds` member.

The class leap_seconds is fully implemented including its non-member
functions.

Implements parts of:
- P0355 Extending  to Calendars and Time Zones
- P1614 The Mothership has Landed

Implements:
- P1981 Rename leap to leap_second
- LWG3359  leap second support should allow for negative leap seconds
- LWG3383 §[time.zone.leap.nonmembers] sys_seconds should be replaced with 
seconds
---
 libcxx/docs/Status/Cxx20Issues.csv|   4 +-
 libcxx/docs/Status/Cxx20Papers.csv|   2 +-
 libcxx/docs/Status/SpaceshipProjects.csv  |   2 +-
 libcxx/include/CMakeLists.txt |   1 +
 libcxx/include/__chrono/leap_second.h | 112 ++
 libcxx/include/__chrono/tzdb.h|   3 +
 libcxx/include/chrono |  39 ++
 libcxx/include/libcxx.imp |   1 +
 libcxx/include/module.modulemap.in|   1 +
 libcxx/modules/std/chrono.inc |  28 ++---
 libcxx/src/CMakeLists.txt |   1 +
 libcxx/src/include/tzdb/leap_second_private.h |  27 +
 libcxx/src/tzdb.cpp   |  41 +++
 ...rono.nodiscard_extensions.compile.pass.cpp |   6 +
 .../chrono.nodiscard_extensions.verify.cpp|   6 +
 .../time.zone.db/leap_seconds.pass.cpp| 102 
 .../time.zone.db.access/get_tzdb.pass.cpp |   3 +
 .../time.zone.leap/assign.copy.pass.cpp   |  56 +
 .../time.zone.leap/cons.copy.pass.cpp |  51 
 .../time.zone.leap/members/date.pass.cpp  |  48 
 .../time.zone.leap/members/value.pass.cpp |  48 
 .../nonmembers/comparison.pass.cpp|  77 
 libcxx/test/support/test_chrono_leap_second.h |  53 +
 23 files changed, 693 insertions(+), 19 deletions(-)
 create mode 100644 libcxx/include/__chrono/leap_second.h
 create mode 100644 libcxx/src/include/tzdb/leap_second_private.h
 create mode 100644 
libcxx/test/libcxx/time/time.zone/time.zone.db/leap_seconds.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.leap/assign.copy.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.leap/cons.copy.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.leap/members/date.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.leap/members/value.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.leap/nonmembers/comparison.pass.cpp
 create mode 100644 libcxx/test/support/test_chrono_leap_second.h

diff --git a/libcxx/docs/Status/Cxx20Issues.csv 
b/libcxx/docs/Status/Cxx20Issues.csv
index f0e9c4090f9cf6..db57b15256a62f 100644
--- a/libcxx/docs/Status/Cxx20Issues.csv
+++ b/libcxx/docs/Status/Cxx20Issues.csv
@@ -269,7 +269,7 @@
 "`3355 `__","The memory algorithms should support 
move-only input iterators introduced by 
P1207","Prague","|Complete|","15.0","|ranges|"
 "`3356 `__","``__cpp_lib_nothrow_convertible``\  
should be ``__cpp_lib_is_nothrow_convertible``\ ","Prague","|Complete|","12.0"
 "`3358 `__","|sect|\ [span.cons] is mistaken that 
``to_address``\  can throw","Prague","|Complete|","17.0"
-"`3359 `__","\  leap second support 
should allow for negative leap seconds","Prague","","","|chrono|"
+"`3359 `__","\  leap second support 
should allow for negative leap seconds","Prague","|Complete|","19.0","|chrono|"
 "`3360 `__","``three_way_comparable_with``\  is 
inconsistent with similar concepts","Prague","|Nothing To Do|","","|spaceship|"
 "`3362 `__","Strike ``stop_source``\ 's 
``operator!=``\ ","Prague","",""
 "`3363 `__","``drop_while_view``\  should opt-out 
of ``sized_range``\ ","Prague","|Nothing To Do|","","|ranges|"
@@ -286,7 +286,7 @@

[llvm-branch-commits] [libcxx] [libc++][chrono] Loads leap-seconds.list in tzdb. (PR #82113)

2024-02-17 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-libcxx

Author: Mark de Wever (mordante)


Changes

This implements the loading of the leap-seconds.list file and store its 
contents in the tzdb struct.

This adds the required `leap_seconds` member.

The class leap_seconds is fully implemented including its non-member functions.

Implements parts of:
- P0355 Extending  to Calendars and Time Zones
- P1614 The Mothership has Landed

Implements:
- P1981 Rename leap to leap_second
- LWG3359  leap second support should allow for negative leap 
seconds
- LWG3383 §[time.zone.leap.nonmembers] sys_seconds should be replaced with 
seconds

---

Patch is 39.88 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/82113.diff


23 Files Affected:

- (modified) libcxx/docs/Status/Cxx20Issues.csv (+2-2) 
- (modified) libcxx/docs/Status/Cxx20Papers.csv (+1-1) 
- (modified) libcxx/docs/Status/SpaceshipProjects.csv (+1-1) 
- (modified) libcxx/include/CMakeLists.txt (+1) 
- (added) libcxx/include/__chrono/leap_second.h (+112) 
- (modified) libcxx/include/__chrono/tzdb.h (+3) 
- (modified) libcxx/include/chrono (+39) 
- (modified) libcxx/include/libcxx.imp (+1) 
- (modified) libcxx/include/module.modulemap.in (+1) 
- (modified) libcxx/modules/std/chrono.inc (+13-15) 
- (modified) libcxx/src/CMakeLists.txt (+1) 
- (added) libcxx/src/include/tzdb/leap_second_private.h (+27) 
- (modified) libcxx/src/tzdb.cpp (+41) 
- (modified) 
libcxx/test/libcxx/diagnostics/chrono.nodiscard_extensions.compile.pass.cpp 
(+6) 
- (modified) 
libcxx/test/libcxx/diagnostics/chrono.nodiscard_extensions.verify.cpp (+6) 
- (added) libcxx/test/libcxx/time/time.zone/time.zone.db/leap_seconds.pass.cpp 
(+102) 
- (modified) 
libcxx/test/std/time/time.zone/time.zone.db/time.zone.db.access/get_tzdb.pass.cpp
 (+3) 
- (added) libcxx/test/std/time/time.zone/time.zone.leap/assign.copy.pass.cpp 
(+56) 
- (added) libcxx/test/std/time/time.zone/time.zone.leap/cons.copy.pass.cpp 
(+51) 
- (added) libcxx/test/std/time/time.zone/time.zone.leap/members/date.pass.cpp 
(+48) 
- (added) libcxx/test/std/time/time.zone/time.zone.leap/members/value.pass.cpp 
(+48) 
- (added) 
libcxx/test/std/time/time.zone/time.zone.leap/nonmembers/comparison.pass.cpp 
(+77) 
- (added) libcxx/test/support/test_chrono_leap_second.h (+53) 


``diff
diff --git a/libcxx/docs/Status/Cxx20Issues.csv 
b/libcxx/docs/Status/Cxx20Issues.csv
index f0e9c4090f9cf6..db57b15256a62f 100644
--- a/libcxx/docs/Status/Cxx20Issues.csv
+++ b/libcxx/docs/Status/Cxx20Issues.csv
@@ -269,7 +269,7 @@
 "`3355 `__","The memory algorithms should support 
move-only input iterators introduced by 
P1207","Prague","|Complete|","15.0","|ranges|"
 "`3356 `__","``__cpp_lib_nothrow_convertible``\  
should be ``__cpp_lib_is_nothrow_convertible``\ ","Prague","|Complete|","12.0"
 "`3358 `__","|sect|\ [span.cons] is mistaken that 
``to_address``\  can throw","Prague","|Complete|","17.0"
-"`3359 `__","\  leap second support 
should allow for negative leap seconds","Prague","","","|chrono|"
+"`3359 `__","\  leap second support 
should allow for negative leap seconds","Prague","|Complete|","19.0","|chrono|"
 "`3360 `__","``three_way_comparable_with``\  is 
inconsistent with similar concepts","Prague","|Nothing To Do|","","|spaceship|"
 "`3362 `__","Strike ``stop_source``\ 's 
``operator!=``\ ","Prague","",""
 "`3363 `__","``drop_while_view``\  should opt-out 
of ``sized_range``\ ","Prague","|Nothing To Do|","","|ranges|"
@@ -286,7 +286,7 @@
 "`3380 `__","``common_type``\  and comparison 
categories","Prague","|Complete|","15.0","|spaceship|"
 "`3381 `__","``begin``\  and ``data``\  must agree 
for ``contiguous_range``\ ","Prague","|Nothing To Do|","","|ranges|"
 "`3382 `__","NTTP for ``pair``\  and ``array``\ 
","Prague","",""
-"`3383 `__","|sect|\ [time.zone.leap.nonmembers] 
``sys_seconds``\  should be replaced with ``seconds``\ 
","Prague","","","|chrono|"
+"`3383 `__","|sect|\ [time.zone.leap.nonmembers] 
``sys_seconds``\  should be replaced with ``seconds``\ 
","Prague","|Complete|","19.0","|chrono|"
 "`3384 `__","``transform_view::*sentinel*``\  has 
an incorrect ``operator-``\ ","Prague","|Complete|","15.0","|ranges|"
 "`3385 `__","``common_iterator``\  is not 
sufficiently constrained for non-copyable 
iterators","Prague","|Complete|","15.0","|ranges|"
 "`3387 `__","|sect|\ [range.reverse.view] 
``reverse_view``\  unintentionally requires ``range``\ 
","Prague","|Complete|","15.0","|ranges|"
diff --git a/libcxx/docs/Status/Cxx20Papers.csv 
b/

[llvm-branch-commits] [llvm] release/18.x: [ValueTracking] Fix computeKnownFPClass for fpext (#81972) (PR #82117)

2024-02-17 Thread via llvm-branch-commits

https://github.com/llvmbot milestoned 
https://github.com/llvm/llvm-project/pull/82117
___
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: [ValueTracking] Fix computeKnownFPClass for fpext (#81972) (PR #82117)

2024-02-17 Thread via llvm-branch-commits

https://github.com/llvmbot created 
https://github.com/llvm/llvm-project/pull/82117

Backport a5865c3c3dbbd17ae12ecc1c297fe1fc2605df52

Requested by: @dtcxzyw

>From e65d16783235c2cf91305da810d854e10d1ac158 Mon Sep 17 00:00:00 2001
From: Yingwei Zheng 
Date: Sat, 17 Feb 2024 23:30:45 +0800
Subject: [PATCH] [ValueTracking] Fix computeKnownFPClass for fpext (#81972)

This patch adds the missing `subnormal -> normal` part for `fpext` in
`computeKnownFPClass`.
Fixes the miscompilation reported by
https://github.com/llvm/llvm-project/pull/80941#issuecomment-1947302100.

(cherry picked from commit a5865c3c3dbbd17ae12ecc1c297fe1fc2605df52)
---
 llvm/lib/Analysis/ValueTracking.cpp   |  7 +++-
 .../Transforms/Attributor/nofpclass-fpext.ll  | 34 +--
 llvm/test/Transforms/InstCombine/pr80941.ll   | 32 +
 3 files changed, 70 insertions(+), 3 deletions(-)
 create mode 100644 llvm/test/Transforms/InstCombine/pr80941.ll

diff --git a/llvm/lib/Analysis/ValueTracking.cpp 
b/llvm/lib/Analysis/ValueTracking.cpp
index 5d6c3465a0c364..412115eb649c2f 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -5083,8 +5083,13 @@ void computeKnownFPClass(const Value *V, const APInt 
&DemandedElts,
 Op->getOperand(0)->getType()->getScalarType()->getFltSemantics();
 
 // All subnormal inputs should be in the normal range in the result type.
-if (APFloat::isRepresentableAsNormalIn(SrcTy, DstTy))
+if (APFloat::isRepresentableAsNormalIn(SrcTy, DstTy)) {
+  if (Known.KnownFPClasses & fcPosSubnormal)
+Known.KnownFPClasses |= fcPosNormal;
+  if (Known.KnownFPClasses & fcNegSubnormal)
+Known.KnownFPClasses |= fcNegNormal;
   Known.knownNot(fcSubnormal);
+}
 
 // Sign bit of a nan isn't guaranteed.
 if (!Known.isKnownNeverNaN())
diff --git a/llvm/test/Transforms/Attributor/nofpclass-fpext.ll 
b/llvm/test/Transforms/Attributor/nofpclass-fpext.ll
index 0ba114117ceec6..ee36f949529d4f 100644
--- a/llvm/test/Transforms/Attributor/nofpclass-fpext.ll
+++ b/llvm/test/Transforms/Attributor/nofpclass-fpext.ll
@@ -142,7 +142,7 @@ define double @ret_fpext_f32_to_f64_nosub(float 
nofpclass(sub) %arg0) {
 }
 
 define double @ret_fpext_f32_to_f64_nonorm(float nofpclass(norm) %arg0) {
-; CHECK-LABEL: define nofpclass(sub norm) double @ret_fpext_f32_to_f64_nonorm
+; CHECK-LABEL: define nofpclass(sub) double @ret_fpext_f32_to_f64_nonorm
 ; CHECK-SAME: (float nofpclass(sub norm) [[ARG0:%.*]]) #[[ATTR0]] {
 ; CHECK-NEXT:[[EXT:%.*]] = fpext float [[ARG0]] to double
 ; CHECK-NEXT:ret double [[EXT]]
@@ -482,7 +482,37 @@ define double @ret_fpext_bf16_f64_nosub(bfloat 
nofpclass(sub) %arg0) {
 }
 
 define double @ret_fpext_bf16_f64_nonorm(bfloat nofpclass(norm) %arg0) {
-; CHECK-LABEL: define nofpclass(sub norm) double @ret_fpext_bf16_f64_nonorm
+; CHECK-LABEL: define nofpclass(sub) double @ret_fpext_bf16_f64_nonorm
+; CHECK-SAME: (bfloat nofpclass(sub norm) [[ARG0:%.*]]) #[[ATTR0]] {
+; CHECK-NEXT:[[EXT:%.*]] = fpext bfloat [[ARG0]] to double
+; CHECK-NEXT:ret double [[EXT]]
+;
+  %ext = fpext bfloat %arg0 to double
+  ret double %ext
+}
+
+define double @ret_fpext_bf16_f64_nonorm_psub(bfloat nofpclass(norm psub) 
%arg0) {
+; CHECK-LABEL: define nofpclass(sub pnorm) double 
@ret_fpext_bf16_f64_nonorm_psub
+; CHECK-SAME: (bfloat nofpclass(sub norm) [[ARG0:%.*]]) #[[ATTR0]] {
+; CHECK-NEXT:[[EXT:%.*]] = fpext bfloat [[ARG0]] to double
+; CHECK-NEXT:ret double [[EXT]]
+;
+  %ext = fpext bfloat %arg0 to double
+  ret double %ext
+}
+
+define double @ret_fpext_bf16_f64_nonorm_nsub(bfloat nofpclass(norm nsub) 
%arg0) {
+; CHECK-LABEL: define nofpclass(sub nnorm) double 
@ret_fpext_bf16_f64_nonorm_nsub
+; CHECK-SAME: (bfloat nofpclass(sub norm) [[ARG0:%.*]]) #[[ATTR0]] {
+; CHECK-NEXT:[[EXT:%.*]] = fpext bfloat [[ARG0]] to double
+; CHECK-NEXT:ret double [[EXT]]
+;
+  %ext = fpext bfloat %arg0 to double
+  ret double %ext
+}
+
+define double @ret_fpext_bf16_f64_nonorm_sub(bfloat nofpclass(norm sub) %arg0) 
{
+; CHECK-LABEL: define nofpclass(sub norm) double @ret_fpext_bf16_f64_nonorm_sub
 ; CHECK-SAME: (bfloat nofpclass(sub norm) [[ARG0:%.*]]) #[[ATTR0]] {
 ; CHECK-NEXT:[[EXT:%.*]] = fpext bfloat [[ARG0]] to double
 ; CHECK-NEXT:ret double [[EXT]]
diff --git a/llvm/test/Transforms/InstCombine/pr80941.ll 
b/llvm/test/Transforms/InstCombine/pr80941.ll
new file mode 100644
index 00..95242b1d1407bf
--- /dev/null
+++ b/llvm/test/Transforms/InstCombine/pr80941.ll
@@ -0,0 +1,32 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py 
UTC_ARGS: --version 4
+; RUN: opt -S -passes=instcombine < %s | FileCheck %s
+
+define float @pr80941(float %arg) {
+; CHECK-LABEL: define float @pr80941(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:[[COND:%.*]] = tail call i1 @llvm.is.fpclass.f32(float 
[[ARG]], i32 144)
+; CHECK-NEXT:br i1 [[COND]], lab

[llvm-branch-commits] [llvm] release/18.x: [ValueTracking] Fix computeKnownFPClass for fpext (#81972) (PR #82117)

2024-02-17 Thread via llvm-branch-commits

llvmbot wrote:

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

https://github.com/llvm/llvm-project/pull/82117
___
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: [ValueTracking] Fix computeKnownFPClass for fpext (#81972) (PR #82117)

2024-02-17 Thread via llvm-branch-commits

llvmbot wrote:



@llvm/pr-subscribers-llvm-analysis

@llvm/pr-subscribers-llvm-transforms

Author: None (llvmbot)


Changes

Backport a5865c3c3dbbd17ae12ecc1c297fe1fc2605df52

Requested by: @dtcxzyw

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


3 Files Affected:

- (modified) llvm/lib/Analysis/ValueTracking.cpp (+6-1) 
- (modified) llvm/test/Transforms/Attributor/nofpclass-fpext.ll (+32-2) 
- (added) llvm/test/Transforms/InstCombine/pr80941.ll (+32) 


``diff
diff --git a/llvm/lib/Analysis/ValueTracking.cpp 
b/llvm/lib/Analysis/ValueTracking.cpp
index 5d6c3465a0c364..412115eb649c2f 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -5083,8 +5083,13 @@ void computeKnownFPClass(const Value *V, const APInt 
&DemandedElts,
 Op->getOperand(0)->getType()->getScalarType()->getFltSemantics();
 
 // All subnormal inputs should be in the normal range in the result type.
-if (APFloat::isRepresentableAsNormalIn(SrcTy, DstTy))
+if (APFloat::isRepresentableAsNormalIn(SrcTy, DstTy)) {
+  if (Known.KnownFPClasses & fcPosSubnormal)
+Known.KnownFPClasses |= fcPosNormal;
+  if (Known.KnownFPClasses & fcNegSubnormal)
+Known.KnownFPClasses |= fcNegNormal;
   Known.knownNot(fcSubnormal);
+}
 
 // Sign bit of a nan isn't guaranteed.
 if (!Known.isKnownNeverNaN())
diff --git a/llvm/test/Transforms/Attributor/nofpclass-fpext.ll 
b/llvm/test/Transforms/Attributor/nofpclass-fpext.ll
index 0ba114117ceec6..ee36f949529d4f 100644
--- a/llvm/test/Transforms/Attributor/nofpclass-fpext.ll
+++ b/llvm/test/Transforms/Attributor/nofpclass-fpext.ll
@@ -142,7 +142,7 @@ define double @ret_fpext_f32_to_f64_nosub(float 
nofpclass(sub) %arg0) {
 }
 
 define double @ret_fpext_f32_to_f64_nonorm(float nofpclass(norm) %arg0) {
-; CHECK-LABEL: define nofpclass(sub norm) double @ret_fpext_f32_to_f64_nonorm
+; CHECK-LABEL: define nofpclass(sub) double @ret_fpext_f32_to_f64_nonorm
 ; CHECK-SAME: (float nofpclass(sub norm) [[ARG0:%.*]]) #[[ATTR0]] {
 ; CHECK-NEXT:[[EXT:%.*]] = fpext float [[ARG0]] to double
 ; CHECK-NEXT:ret double [[EXT]]
@@ -482,7 +482,37 @@ define double @ret_fpext_bf16_f64_nosub(bfloat 
nofpclass(sub) %arg0) {
 }
 
 define double @ret_fpext_bf16_f64_nonorm(bfloat nofpclass(norm) %arg0) {
-; CHECK-LABEL: define nofpclass(sub norm) double @ret_fpext_bf16_f64_nonorm
+; CHECK-LABEL: define nofpclass(sub) double @ret_fpext_bf16_f64_nonorm
+; CHECK-SAME: (bfloat nofpclass(sub norm) [[ARG0:%.*]]) #[[ATTR0]] {
+; CHECK-NEXT:[[EXT:%.*]] = fpext bfloat [[ARG0]] to double
+; CHECK-NEXT:ret double [[EXT]]
+;
+  %ext = fpext bfloat %arg0 to double
+  ret double %ext
+}
+
+define double @ret_fpext_bf16_f64_nonorm_psub(bfloat nofpclass(norm psub) 
%arg0) {
+; CHECK-LABEL: define nofpclass(sub pnorm) double 
@ret_fpext_bf16_f64_nonorm_psub
+; CHECK-SAME: (bfloat nofpclass(sub norm) [[ARG0:%.*]]) #[[ATTR0]] {
+; CHECK-NEXT:[[EXT:%.*]] = fpext bfloat [[ARG0]] to double
+; CHECK-NEXT:ret double [[EXT]]
+;
+  %ext = fpext bfloat %arg0 to double
+  ret double %ext
+}
+
+define double @ret_fpext_bf16_f64_nonorm_nsub(bfloat nofpclass(norm nsub) 
%arg0) {
+; CHECK-LABEL: define nofpclass(sub nnorm) double 
@ret_fpext_bf16_f64_nonorm_nsub
+; CHECK-SAME: (bfloat nofpclass(sub norm) [[ARG0:%.*]]) #[[ATTR0]] {
+; CHECK-NEXT:[[EXT:%.*]] = fpext bfloat [[ARG0]] to double
+; CHECK-NEXT:ret double [[EXT]]
+;
+  %ext = fpext bfloat %arg0 to double
+  ret double %ext
+}
+
+define double @ret_fpext_bf16_f64_nonorm_sub(bfloat nofpclass(norm sub) %arg0) 
{
+; CHECK-LABEL: define nofpclass(sub norm) double @ret_fpext_bf16_f64_nonorm_sub
 ; CHECK-SAME: (bfloat nofpclass(sub norm) [[ARG0:%.*]]) #[[ATTR0]] {
 ; CHECK-NEXT:[[EXT:%.*]] = fpext bfloat [[ARG0]] to double
 ; CHECK-NEXT:ret double [[EXT]]
diff --git a/llvm/test/Transforms/InstCombine/pr80941.ll 
b/llvm/test/Transforms/InstCombine/pr80941.ll
new file mode 100644
index 00..95242b1d1407bf
--- /dev/null
+++ b/llvm/test/Transforms/InstCombine/pr80941.ll
@@ -0,0 +1,32 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py 
UTC_ARGS: --version 4
+; RUN: opt -S -passes=instcombine < %s | FileCheck %s
+
+define float @pr80941(float %arg) {
+; CHECK-LABEL: define float @pr80941(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:[[COND:%.*]] = tail call i1 @llvm.is.fpclass.f32(float 
[[ARG]], i32 144)
+; CHECK-NEXT:br i1 [[COND]], label [[IF_THEN:%.*]], label [[IF_EXIT:%.*]]
+; CHECK:   if.then:
+; CHECK-NEXT:[[FPEXT:%.*]] = fpext float [[ARG]] to double
+; CHECK-NEXT:[[SIGN:%.*]] = call double @llvm.copysign.f64(double 
0.00e+00, double [[FPEXT]])
+; CHECK-NEXT:[[FPTRUNC:%.*]] = fptrunc double [[SIGN]] to float
+; CHECK-NEXT:br label [[IF_EXIT]]
+; CHECK:   if.exit:
+; CHECK-NEXT:[[RET:%.*]] = phi float [ [[FPTRUNC]], [[IF_THEN]] ], [ 
[[ARG]], [[ENTRY:%.

[llvm-branch-commits] PR for llvm/llvm-project#81000 (PR #81003)

2024-02-17 Thread via llvm-branch-commits

https://github.com/llvmbot closed 
https://github.com/llvm/llvm-project/pull/81003
___
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] PR for llvm/llvm-project#81000 (PR #81003)

2024-02-17 Thread via llvm-branch-commits

https://github.com/llvmbot updated 
https://github.com/llvm/llvm-project/pull/81003


___
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] PR for llvm/llvm-project#81000 (PR #81003)

2024-02-17 Thread Tom Stellard via llvm-branch-commits

tstellar wrote:

Looks like this was already backported in 
9fc4cf7223181c33e0844d7c4f552d08fb68cf5a.

https://github.com/llvm/llvm-project/pull/81003
___
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] 8a3d8f0 - [AArch64][GlobalISel] Fail legalization for unknown libcalls. (#81873)

2024-02-17 Thread via llvm-branch-commits

Author: David Green
Date: 2024-02-17T09:03:56Z
New Revision: 8a3d8f0c2531877c84203298a979419a2ba652ee

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

LOG: [AArch64][GlobalISel] Fail legalization for unknown libcalls. (#81873)

If, like powi on windows, the libcall is unavailable we should fall back
to SDAG. Currently we try and generate a call to "".

(cherry picked from commit 47c65cf62d06add9f55a77c9d45390fa3b986fc5)

Added: 
llvm/test/CodeGen/AArch64/win64-fpowi.ll

Modified: 
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp

Removed: 




diff  --git a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp 
b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
index 3b2cf319109273..c0c22e36004f72 100644
--- a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
@@ -596,6 +596,8 @@ llvm::createLibcall(MachineIRBuilder &MIRBuilder, 
RTLIB::Libcall Libcall,
 LostDebugLocObserver &LocObserver, MachineInstr *MI) {
   auto &TLI = *MIRBuilder.getMF().getSubtarget().getTargetLowering();
   const char *Name = TLI.getLibcallName(Libcall);
+  if (!Name)
+return LegalizerHelper::UnableToLegalize;
   const CallingConv::ID CC = TLI.getLibcallCallingConv(Libcall);
   return createLibcall(MIRBuilder, Name, Result, Args, CC, LocObserver, MI);
 }

diff  --git a/llvm/test/CodeGen/AArch64/win64-fpowi.ll 
b/llvm/test/CodeGen/AArch64/win64-fpowi.ll
new file mode 100644
index 00..3eb74f8394ec4e
--- /dev/null
+++ b/llvm/test/CodeGen/AArch64/win64-fpowi.ll
@@ -0,0 +1,136 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 
UTC_ARGS: --version 3
+; RUN: llc -mtriple=aarch64-pc-windows-msvc19 -verify-machineinstrs %s -o - | 
FileCheck %s
+; RUN: llc -mtriple=aarch64-pc-windows-msvc19 -global-isel 
-global-isel-abort=2 -verify-machineinstrs %s -o - | FileCheck %s
+
+define double @powi_f64(double %a, i32 %b) {
+; CHECK-LABEL: powi_f64:
+; CHECK:   // %bb.0: // %entry
+; CHECK-NEXT:scvtf d1, w0
+; CHECK-NEXT:b pow
+entry:
+  %c = call double @llvm.powi.f64.i32(double %a, i32 %b)
+  ret double %c
+}
+
+define float @powi_f32(float %a, i32 %b) {
+; CHECK-LABEL: powi_f32:
+; CHECK:   // %bb.0: // %entry
+; CHECK-NEXT:scvtf s1, w0
+; CHECK-NEXT:b powf
+entry:
+  %c = call float @llvm.powi.f32.i32(float %a, i32 %b)
+  ret float %c
+}
+
+define half @powi_f16(half %a, i32 %b) {
+; CHECK-LABEL: powi_f16:
+; CHECK:   .seh_proc powi_f16
+; CHECK-NEXT:  // %bb.0: // %entry
+; CHECK-NEXT:str x30, [sp, #-16]! // 8-byte Folded Spill
+; CHECK-NEXT:.seh_save_reg_x x30, 16
+; CHECK-NEXT:.seh_endprologue
+; CHECK-NEXT:fcvt s0, h0
+; CHECK-NEXT:scvtf s1, w0
+; CHECK-NEXT:bl powf
+; CHECK-NEXT:fcvt h0, s0
+; CHECK-NEXT:.seh_startepilogue
+; CHECK-NEXT:ldr x30, [sp], #16 // 8-byte Folded Reload
+; CHECK-NEXT:.seh_save_reg_x x30, 16
+; CHECK-NEXT:.seh_endepilogue
+; CHECK-NEXT:ret
+; CHECK-NEXT:.seh_endfunclet
+; CHECK-NEXT:.seh_endproc
+entry:
+  %c = call half @llvm.powi.f16.i32(half %a, i32 %b)
+  ret half %c
+}
+
+define <2 x double> @powi_v2f64(<2 x double> %a, i32 %b) {
+; CHECK-LABEL: powi_v2f64:
+; CHECK:   .seh_proc powi_v2f64
+; CHECK-NEXT:  // %bb.0: // %entry
+; CHECK-NEXT:sub sp, sp, #48
+; CHECK-NEXT:.seh_stackalloc 48
+; CHECK-NEXT:str x30, [sp, #32] // 8-byte Folded Spill
+; CHECK-NEXT:.seh_save_reg x30, 32
+; CHECK-NEXT:str d8, [sp, #40] // 8-byte Folded Spill
+; CHECK-NEXT:.seh_save_freg d8, 40
+; CHECK-NEXT:.seh_endprologue
+; CHECK-NEXT:scvtf d8, w0
+; CHECK-NEXT:str q0, [sp] // 16-byte Folded Spill
+; CHECK-NEXT:mov d0, v0.d[1]
+; CHECK-NEXT:fmov d1, d8
+; CHECK-NEXT:bl pow
+; CHECK-NEXT:fmov d1, d8
+; CHECK-NEXT:// kill: def $d0 killed $d0 def $q0
+; CHECK-NEXT:str q0, [sp, #16] // 16-byte Folded Spill
+; CHECK-NEXT:ldr q0, [sp] // 16-byte Folded Reload
+; CHECK-NEXT:// kill: def $d0 killed $d0 killed $q0
+; CHECK-NEXT:bl pow
+; CHECK-NEXT:ldr q1, [sp, #16] // 16-byte Folded Reload
+; CHECK-NEXT:// kill: def $d0 killed $d0 def $q0
+; CHECK-NEXT:mov v0.d[1], v1.d[0]
+; CHECK-NEXT:.seh_startepilogue
+; CHECK-NEXT:ldr d8, [sp, #40] // 8-byte Folded Reload
+; CHECK-NEXT:.seh_save_freg d8, 40
+; CHECK-NEXT:ldr x30, [sp, #32] // 8-byte Folded Reload
+; CHECK-NEXT:.seh_save_reg x30, 32
+; CHECK-NEXT:add sp, sp, #48
+; CHECK-NEXT:.seh_stackalloc 48
+; CHECK-NEXT:.seh_endepilogue
+; CHECK-NEXT:ret
+; CHECK-NEXT:.seh_endfunclet
+; CHECK-NEXT:.seh_endproc
+entry:
+  %c = call <2 x double> @llvm.powi.v2f64.i32(<2 x double> %a, i32 %b)
+  ret <2 x double> %c
+}
+
+define <2 x float> @powi_v2f32(<2 x

[llvm-branch-commits] [llvm] release/18.x: [AArch64][GlobalISel] Fail legalization for unknown libcalls. (#81873) (PR #82103)

2024-02-17 Thread Tom Stellard via llvm-branch-commits

https://github.com/tstellar closed 
https://github.com/llvm/llvm-project/pull/82103
___
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] [libcxx] [libc++][chrono] Loads leap-seconds.list in tzdb. (PR #82113)

2024-02-17 Thread Mark de Wever via llvm-branch-commits

https://github.com/mordante updated 
https://github.com/llvm/llvm-project/pull/82113

>From 3710cf0f9e8fa6065b25123e9b2158079e10805c Mon Sep 17 00:00:00 2001
From: Mark de Wever 
Date: Fri, 23 Sep 2022 18:33:20 +0200
Subject: [PATCH] [libc++][chrono] Loads leap-seconds.list in tzdb.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This implements the loading of the leap-seconds.list file and store its
contents in the tzdb struct.

This adds the required `leap_seconds` member.

The class leap_seconds is fully implemented including its non-member
functions.

Implements parts of:
- P0355 Extending  to Calendars and Time Zones
- P1614 The Mothership has Landed

Implements:
- P1981 Rename leap to leap_second
- LWG3359  leap second support should allow for negative leap seconds
- LWG3383 §[time.zone.leap.nonmembers] sys_seconds should be replaced with 
seconds
---
 libcxx/docs/Status/Cxx20Issues.csv|   4 +-
 libcxx/docs/Status/Cxx20Papers.csv|   2 +-
 libcxx/docs/Status/SpaceshipProjects.csv  |   2 +-
 libcxx/include/CMakeLists.txt |   1 +
 libcxx/include/__chrono/leap_second.h | 112 ++
 libcxx/include/__chrono/tzdb.h|   3 +
 libcxx/include/chrono |  39 ++
 libcxx/include/libcxx.imp |   1 +
 libcxx/include/module.modulemap.in|   1 +
 libcxx/modules/std/chrono.inc |  28 ++---
 libcxx/src/CMakeLists.txt |   1 +
 libcxx/src/include/tzdb/leap_second_private.h |  27 +
 libcxx/src/tzdb.cpp   |  41 +++
 ...rono.nodiscard_extensions.compile.pass.cpp |   6 +
 .../chrono.nodiscard_extensions.verify.cpp|   6 +
 .../time.zone.db/leap_seconds.pass.cpp| 102 
 .../time.zone.db.access/get_tzdb.pass.cpp |   3 +
 .../time.zone.leap/assign.copy.pass.cpp   |  56 +
 .../time.zone.leap/cons.copy.pass.cpp |  51 
 .../time.zone.leap/members/date.pass.cpp  |  48 
 .../time.zone.leap/members/value.pass.cpp |  48 
 .../nonmembers/comparison.pass.cpp|  77 
 libcxx/test/support/test_chrono_leap_second.h |  53 +
 23 files changed, 693 insertions(+), 19 deletions(-)
 create mode 100644 libcxx/include/__chrono/leap_second.h
 create mode 100644 libcxx/src/include/tzdb/leap_second_private.h
 create mode 100644 
libcxx/test/libcxx/time/time.zone/time.zone.db/leap_seconds.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.leap/assign.copy.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.leap/cons.copy.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.leap/members/date.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.leap/members/value.pass.cpp
 create mode 100644 
libcxx/test/std/time/time.zone/time.zone.leap/nonmembers/comparison.pass.cpp
 create mode 100644 libcxx/test/support/test_chrono_leap_second.h

diff --git a/libcxx/docs/Status/Cxx20Issues.csv 
b/libcxx/docs/Status/Cxx20Issues.csv
index f0e9c4090f9cf6..db57b15256a62f 100644
--- a/libcxx/docs/Status/Cxx20Issues.csv
+++ b/libcxx/docs/Status/Cxx20Issues.csv
@@ -269,7 +269,7 @@
 "`3355 `__","The memory algorithms should support 
move-only input iterators introduced by 
P1207","Prague","|Complete|","15.0","|ranges|"
 "`3356 `__","``__cpp_lib_nothrow_convertible``\  
should be ``__cpp_lib_is_nothrow_convertible``\ ","Prague","|Complete|","12.0"
 "`3358 `__","|sect|\ [span.cons] is mistaken that 
``to_address``\  can throw","Prague","|Complete|","17.0"
-"`3359 `__","\  leap second support 
should allow for negative leap seconds","Prague","","","|chrono|"
+"`3359 `__","\  leap second support 
should allow for negative leap seconds","Prague","|Complete|","19.0","|chrono|"
 "`3360 `__","``three_way_comparable_with``\  is 
inconsistent with similar concepts","Prague","|Nothing To Do|","","|spaceship|"
 "`3362 `__","Strike ``stop_source``\ 's 
``operator!=``\ ","Prague","",""
 "`3363 `__","``drop_while_view``\  should opt-out 
of ``sized_range``\ ","Prague","|Nothing To Do|","","|ranges|"
@@ -286,7 +286,7 @@
 "`3380 `__","``common_type``\  and comparison 
categories","Prague","|Complete|","15.0","|spaceship|"
 "`3381 `__","``begin``\  and ``data``\  must agree 
for ``contiguous_range``\ ","Prague","|Nothing To Do|","","|ranges|"
 "`3382 `__","NTTP for ``pair``\  and ``array``\ 
","Prague","",""
-"`3383 `__","|sect|\ [time.zone.leap.nonmembers] 
``sys_seconds``\  should be replaced with ``seconds``\ 
","Prague","","","|chrono|"

[llvm-branch-commits] [llvm] release/18.x: [ValueTracking] Fix computeKnownFPClass for fpext (#81972) (PR #82117)

2024-02-17 Thread Nikita Popov via llvm-branch-commits

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

LGTM

https://github.com/llvm/llvm-project/pull/82117
___
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] 784cd68 - Revert "[Support] Introduce formatv variant of createStringError (#80493)"

2024-02-17 Thread via llvm-branch-commits

Author: Alex Langford
Date: 2024-02-17T12:00:10-08:00
New Revision: 784cd6883d930be89ad8fc114364f575cf1f5766

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

LOG: Revert "[Support] Introduce formatv variant of createStringError (#80493)"

This reverts commit 4bb0ca655bb65aae0a1d251ba5053aadff678101.

Added: 


Modified: 
llvm/include/llvm/Support/Error.h
llvm/unittests/Support/ErrorTest.cpp

Removed: 




diff  --git a/llvm/include/llvm/Support/Error.h 
b/llvm/include/llvm/Support/Error.h
index ddc1afb9623097..bb4f38f7ec355e 100644
--- a/llvm/include/llvm/Support/Error.h
+++ b/llvm/include/llvm/Support/Error.h
@@ -22,7 +22,6 @@
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/ErrorOr.h"
 #include "llvm/Support/Format.h"
-#include "llvm/Support/FormatVariadic.h"
 #include "llvm/Support/raw_ostream.h"
 #include 
 #include 
@@ -1262,15 +1261,6 @@ inline Error createStringError(std::errc EC, char const 
*Fmt,
   return createStringError(std::make_error_code(EC), Fmt, Vals...);
 }
 
-template 
-inline Error createStringErrorV(std::error_code EC, const char *Fmt,
-const Ts &...Vals) {
-  std::string Buffer;
-  raw_string_ostream Stream(Buffer);
-  Stream << formatv(Fmt, Vals...);
-  return make_error(Stream.str(), EC);
-}
-
 /// This class wraps a filename and another Error.
 ///
 /// In some cases, an error needs to live along a 'source' name, in order to

diff  --git a/llvm/unittests/Support/ErrorTest.cpp 
b/llvm/unittests/Support/ErrorTest.cpp
index a700a50e1d4337..11f93203597bf0 100644
--- a/llvm/unittests/Support/ErrorTest.cpp
+++ b/llvm/unittests/Support/ErrorTest.cpp
@@ -472,23 +472,6 @@ TEST(Error, createStringError) {
 << "Failed to convert createStringError() result to error_code.";
 }
 
-TEST(Error, createStringErrorV) {
-  static llvm::StringRef Bar("bar");
-  static const std::error_code EC = errc::invalid_argument;
-  std::string Msg;
-  raw_string_ostream S(Msg);
-  logAllUnhandledErrors(createStringErrorV(EC, "foo{0}{1}{2:x}", Bar, 1, 0xff),
-S);
-  EXPECT_EQ(S.str(), "foobar10xff\n")
-  << "Unexpected createStringErrorV() log result";
-
-  S.flush();
-  Msg.clear();
-  auto Res = errorToErrorCode(createStringErrorV(EC, "foo{0}", Bar));
-  EXPECT_EQ(Res, EC)
-  << "Failed to convert createStringErrorV() result to error_code.";
-}
-
 // Test that the ExitOnError utility works as expected.
 TEST(ErrorDeathTest, ExitOnError) {
   ExitOnError ExitOnErr;



___
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] Expose YAMLProfileWriter::convert function (PR #76909)

2024-02-17 Thread Amir Ayupov via llvm-branch-commits

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


___
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] Expose YAMLProfileWriter::convert function (PR #76909)

2024-02-17 Thread Amir Ayupov via llvm-branch-commits

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


___
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 YAMLProfileWriter::convert (PR #82129)

2024-02-17 Thread Amir Ayupov via llvm-branch-commits

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

Use `getAnnotationWithDefault` instead of testing if the annotation is
set. If the default value is used, and `CSI.Count` is set to zero, the
target is discarded by a check below.

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] Set EntryDiscriminator in YAML profile for indirect calls (PR #82128)

2024-02-17 Thread Amir Ayupov via llvm-branch-commits

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

Indirect call handling missed setting an `EntryDiscriminator` while it's
set for direct calls and tail calls.

Improve YAML profile accuracy by unifying the destination setting
between direct and indirect calls into `setCSIDestination` method.

Test Plan: `bin/llvm-lit -a tools/bolt/test`



___
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] [compiler-rt] release/18.x: [compiler-rt][profile] Fix InstrProfilingFile possible resource leak. (#81363) (PR #81402)

2024-02-17 Thread Petr Hosek via llvm-branch-commits

petrhosek wrote:

> @petrhosek What do you think about merging this PR to the release branch?

LGTM

https://github.com/llvm/llvm-project/pull/81402
___
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] Use container on Linux to run llvm-project-tests workflow (#81349) (PR #81807)

2024-02-17 Thread Tom Stellard via llvm-branch-commits

https://github.com/tstellar closed 
https://github.com/llvm/llvm-project/pull/81807
___
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: [Support/ELF] Add OpenBSD PT_OPENBSD_SYSCALLS constant. (PR #82143)

2024-02-17 Thread via llvm-branch-commits

https://github.com/llvmbot created 
https://github.com/llvm/llvm-project/pull/82143

Backport 97eff26d0ca4d187a5efb8534af484dbb68bce30

Requested by: @brad0

>From 4f1b19793acccbebdbe80136f5500a7198a507b6 Mon Sep 17 00:00:00 2001
From: Frederic Cambus 
Date: Sat, 17 Feb 2024 15:38:05 +0100
Subject: [PATCH] [Support/ELF] Add OpenBSD PT_OPENBSD_SYSCALLS constant.

Reference: https://github.com/openbsd/src/blob/master/sys/sys/exec_elf.h
(cherry picked from commit 97eff26d0ca4d187a5efb8534af484dbb68bce30)
---
 llvm/include/llvm/BinaryFormat/ELF.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/llvm/include/llvm/BinaryFormat/ELF.h 
b/llvm/include/llvm/BinaryFormat/ELF.h
index 81cdd39afc6bab..f17ba75e3efa6a 100644
--- a/llvm/include/llvm/BinaryFormat/ELF.h
+++ b/llvm/include/llvm/BinaryFormat/ELF.h
@@ -1464,6 +1464,7 @@ enum {
   PT_OPENBSD_RANDOMIZE = 0x65a3dbe6, // Fill with random data.
   PT_OPENBSD_WXNEEDED = 0x65a3dbe7,  // Program does W^X violations.
   PT_OPENBSD_NOBTCFI = 0x65a3dbe8,   // Do not enforce branch target CFI.
+  PT_OPENBSD_SYSCALLS = 0x65a3dbe9,  // System call sites.
   PT_OPENBSD_BOOTDATA = 0x65a41be6,  // Section for boot arguments.
 
   // ARM program header types.

___
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: [Support/ELF] Add OpenBSD PT_OPENBSD_SYSCALLS constant. (PR #82143)

2024-02-17 Thread via llvm-branch-commits

https://github.com/llvmbot milestoned 
https://github.com/llvm/llvm-project/pull/82143
___
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: [Support/ELF] Add OpenBSD PT_OPENBSD_SYSCALLS constant. (PR #82143)

2024-02-17 Thread via llvm-branch-commits

llvmbot wrote:




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

Author: None (llvmbot)


Changes

Backport 97eff26d0ca4d187a5efb8534af484dbb68bce30

Requested by: @brad0

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


1 Files Affected:

- (modified) llvm/include/llvm/BinaryFormat/ELF.h (+1) 


``diff
diff --git a/llvm/include/llvm/BinaryFormat/ELF.h 
b/llvm/include/llvm/BinaryFormat/ELF.h
index 81cdd39afc6bab..f17ba75e3efa6a 100644
--- a/llvm/include/llvm/BinaryFormat/ELF.h
+++ b/llvm/include/llvm/BinaryFormat/ELF.h
@@ -1464,6 +1464,7 @@ enum {
   PT_OPENBSD_RANDOMIZE = 0x65a3dbe6, // Fill with random data.
   PT_OPENBSD_WXNEEDED = 0x65a3dbe7,  // Program does W^X violations.
   PT_OPENBSD_NOBTCFI = 0x65a3dbe8,   // Do not enforce branch target CFI.
+  PT_OPENBSD_SYSCALLS = 0x65a3dbe9,  // System call sites.
   PT_OPENBSD_BOOTDATA = 0x65a41be6,  // Section for boot arguments.
 
   // ARM program header types.

``




https://github.com/llvm/llvm-project/pull/82143
___
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: [Support/ELF] Add OpenBSD PT_OPENBSD_SYSCALLS constant. (PR #82143)

2024-02-17 Thread Brad Smith via llvm-branch-commits

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


https://github.com/llvm/llvm-project/pull/82143
___
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] [RISCV] Support select optimization (PR #80124)

2024-02-17 Thread Wang Pengcheng via llvm-branch-commits

https://github.com/wangpc-pp updated 
https://github.com/llvm/llvm-project/pull/80124

>From e3fb1fe7bdd4b7c24f9361c4d14dd1206fc8c067 Mon Sep 17 00:00:00 2001
From: wangpc 
Date: Sun, 18 Feb 2024 11:12:16 +0800
Subject: [PATCH] Move after addIRPasses

Created using spr 1.3.4
---
 llvm/lib/Target/RISCV/RISCVTargetMachine.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp 
b/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
index fdf1c023fff878..7a26e1956424cb 100644
--- a/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
+++ b/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
@@ -450,15 +450,15 @@ void RISCVPassConfig::addIRPasses() {
 if (EnableLoopDataPrefetch)
   addPass(createLoopDataPrefetchPass());
 
-if (EnableSelectOpt && getOptLevel() == CodeGenOptLevel::Aggressive)
-  addPass(createSelectOptimizePass());
-
 addPass(createRISCVGatherScatterLoweringPass());
 addPass(createInterleavedAccessPass());
 addPass(createRISCVCodeGenPreparePass());
   }
 
   TargetPassConfig::addIRPasses();
+
+  if (getOptLevel() == CodeGenOptLevel::Aggressive && EnableSelectOpt)
+addPass(createSelectOptimizePass());
 }
 
 bool RISCVPassConfig::addPreISel() {

___
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] [openmp] release/18.x: [OpenMP][AIX] Set worker stack size to 2 x KMP_DEFAULT_STKSIZE if system stack size is too big (#81996) (PR #82146)

2024-02-17 Thread via llvm-branch-commits

https://github.com/llvmbot created 
https://github.com/llvm/llvm-project/pull/82146

Backport 2de269a641e4ffbb7a44e559c4c0a91bb66df823

Requested by: @brad0

>From 57516c5e7735434c909b644abc2bac9584d1f7f2 Mon Sep 17 00:00:00 2001
From: Xing Xue 
Date: Fri, 16 Feb 2024 15:12:41 -0500
Subject: [PATCH] [OpenMP][AIX] Set worker stack size to 2 x
 KMP_DEFAULT_STKSIZE if system stack size is too big (#81996)

This patch sets the stack size of worker threads to `2 x
KMP_DEFAULT_STKSIZE` (2 x 4MB) for AIX if the system stack size is too
big. Also defines maximum stack size for 32-bit AIX.

(cherry picked from commit 2de269a641e4ffbb7a44e559c4c0a91bb66df823)
---
 openmp/runtime/src/kmp.h| 4 
 openmp/runtime/src/kmp_settings.cpp | 5 +
 2 files changed, 9 insertions(+)

diff --git a/openmp/runtime/src/kmp.h b/openmp/runtime/src/kmp.h
index b147063d228263..259c57b5afbca5 100644
--- a/openmp/runtime/src/kmp.h
+++ b/openmp/runtime/src/kmp.h
@@ -1181,7 +1181,11 @@ extern void __kmp_init_target_task();
 #define KMP_MIN_STKSIZE ((size_t)(32 * 1024))
 #endif
 
+#if KMP_OS_AIX && KMP_ARCH_PPC
+#define KMP_MAX_STKSIZE 0x1000 /* 256Mb max size on 32-bit AIX */
+#else
 #define KMP_MAX_STKSIZE (~((size_t)1 << ((sizeof(size_t) * (1 << 3)) - 1)))
+#endif
 
 #if KMP_ARCH_X86
 #define KMP_DEFAULT_STKSIZE ((size_t)(2 * 1024 * 1024))
diff --git a/openmp/runtime/src/kmp_settings.cpp 
b/openmp/runtime/src/kmp_settings.cpp
index d2157b10b7819a..ec86ee07472c1e 100644
--- a/openmp/runtime/src/kmp_settings.cpp
+++ b/openmp/runtime/src/kmp_settings.cpp
@@ -255,8 +255,13 @@ static void __kmp_stg_parse_bool(char const *name, char 
const *value,
 // placed here in order to use __kmp_round4k static function
 void __kmp_check_stksize(size_t *val) {
   // if system stack size is too big then limit the size for worker threads
+#if KMP_OS_AIX
+  if (*val > KMP_DEFAULT_STKSIZE * 2) // Use 2 times, 16 is too large for AIX.
+*val = KMP_DEFAULT_STKSIZE * 2;
+#else
   if (*val > KMP_DEFAULT_STKSIZE * 16) // just a heuristics...
 *val = KMP_DEFAULT_STKSIZE * 16;
+#endif
   if (*val < __kmp_sys_min_stksize)
 *val = __kmp_sys_min_stksize;
   if (*val > KMP_MAX_STKSIZE)

___
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] [openmp] release/18.x: [OpenMP][AIX] Set worker stack size to 2 x KMP_DEFAULT_STKSIZE if system stack size is too big (#81996) (PR #82146)

2024-02-17 Thread via llvm-branch-commits

https://github.com/llvmbot milestoned 
https://github.com/llvm/llvm-project/pull/82146
___
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] [openmp] release/18.x: [OpenMP][AIX] Set worker stack size to 2 x KMP_DEFAULT_STKSIZE if system stack size is too big (#81996) (PR #82146)

2024-02-17 Thread via llvm-branch-commits

llvmbot wrote:

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

https://github.com/llvm/llvm-project/pull/82146
___
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] [openmp] release/18.x: [OpenMP][AIX] Set worker stack size to 2 x KMP_DEFAULT_STKSIZE if system stack size is too big (#81996) (PR #82146)

2024-02-17 Thread Shilei Tian via llvm-branch-commits

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


https://github.com/llvm/llvm-project/pull/82146
___
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] [compiler-rt] release/18.x: [AIX] Add a dummy variable in the __llvm_orderfile section (#81968) (PR #82148)

2024-02-17 Thread via llvm-branch-commits

https://github.com/llvmbot created 
https://github.com/llvm/llvm-project/pull/82148

Backport 1555919d27eb2e89379a65f6c7809f679fda

Requested by: @brad0

>From b27f0b4fae68fea5c2468bc080e31bcecfb7faa7 Mon Sep 17 00:00:00 2001
From: Wael Yehia <44115484+w2ye...@users.noreply.github.com>
Date: Fri, 16 Feb 2024 12:55:20 -0500
Subject: [PATCH] [AIX] Add a dummy variable in the __llvm_orderfile section
 (#81968)

to satisfy the __start___llvm_orderfile reference when linking with
-bexpfull and -fprofile-generate on AIX.

(cherry picked from commit 1555919d27eb2e89379a65f6c7809f679fda)
---
 compiler-rt/lib/profile/InstrProfilingPlatformAIX.c | 4 +++-
 compiler-rt/test/profile/AIX/bexpfull-pgo.c | 7 +++
 2 files changed, 10 insertions(+), 1 deletion(-)
 create mode 100644 compiler-rt/test/profile/AIX/bexpfull-pgo.c

diff --git a/compiler-rt/lib/profile/InstrProfilingPlatformAIX.c 
b/compiler-rt/lib/profile/InstrProfilingPlatformAIX.c
index 9f46a98d78ac4e..002bec164d7e85 100644
--- a/compiler-rt/lib/profile/InstrProfilingPlatformAIX.c
+++ b/compiler-rt/lib/profile/InstrProfilingPlatformAIX.c
@@ -195,6 +195,8 @@ static const int dummy_name[0] COMPILER_RT_SECTION(
 COMPILER_RT_SEG INSTR_PROF_NAME_SECT_NAME);
 static int dummy_vnds[0] COMPILER_RT_SECTION(
 COMPILER_RT_SEG INSTR_PROF_VNODES_SECT_NAME);
+static int dummy_orderfile[0] COMPILER_RT_SECTION(
+COMPILER_RT_SEG INSTR_PROF_ORDERFILE_SECT_NAME);
 
 // To avoid GC'ing of the dummy variables by the linker, reference them in an
 // array and reference the array in the runtime registration code
@@ -206,7 +208,7 @@ static int dummy_vnds[0] COMPILER_RT_SECTION(
 COMPILER_RT_VISIBILITY
 void *__llvm_profile_keep[] = {(void *)&dummy_cnts, (void *)&dummy_bits,
(void *)&dummy_data, (void *)&dummy_name,
-   (void *)&dummy_vnds};
+   (void *)&dummy_vnds, (void *)&dummy_orderfile};
 #ifdef __GNUC__
 #pragma GCC diagnostic pop
 #endif
diff --git a/compiler-rt/test/profile/AIX/bexpfull-pgo.c 
b/compiler-rt/test/profile/AIX/bexpfull-pgo.c
new file mode 100644
index 00..f48242ec6bfeaa
--- /dev/null
+++ b/compiler-rt/test/profile/AIX/bexpfull-pgo.c
@@ -0,0 +1,7 @@
+// RUN: %clang_pgogen %s -bexpall
+// RUN: %clang_pgogen %s -bexpfull
+
+#include 
+int ar[10];
+int n;
+int main() { memcpy(ar, ar + 1, n); };

___
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] [compiler-rt] release/18.x: [AIX] Add a dummy variable in the __llvm_orderfile section (#81968) (PR #82148)

2024-02-17 Thread via llvm-branch-commits

https://github.com/llvmbot milestoned 
https://github.com/llvm/llvm-project/pull/82148
___
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] [compiler-rt] release/18.x: [AIX] Add a dummy variable in the __llvm_orderfile section (#81968) (PR #82148)

2024-02-17 Thread via llvm-branch-commits

llvmbot wrote:

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

https://github.com/llvm/llvm-project/pull/82148
___
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] [compiler-rt] release/18.x: [AIX] Add a dummy variable in the __llvm_orderfile section (#81968) (PR #82148)

2024-02-17 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-pgo

Author: None (llvmbot)


Changes

Backport 1555919d27eb2e89379a65f6c7809f679fda

Requested by: @brad0

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


2 Files Affected:

- (modified) compiler-rt/lib/profile/InstrProfilingPlatformAIX.c (+3-1) 
- (added) compiler-rt/test/profile/AIX/bexpfull-pgo.c (+7) 


``diff
diff --git a/compiler-rt/lib/profile/InstrProfilingPlatformAIX.c 
b/compiler-rt/lib/profile/InstrProfilingPlatformAIX.c
index 9f46a98d78ac4e..002bec164d7e85 100644
--- a/compiler-rt/lib/profile/InstrProfilingPlatformAIX.c
+++ b/compiler-rt/lib/profile/InstrProfilingPlatformAIX.c
@@ -195,6 +195,8 @@ static const int dummy_name[0] COMPILER_RT_SECTION(
 COMPILER_RT_SEG INSTR_PROF_NAME_SECT_NAME);
 static int dummy_vnds[0] COMPILER_RT_SECTION(
 COMPILER_RT_SEG INSTR_PROF_VNODES_SECT_NAME);
+static int dummy_orderfile[0] COMPILER_RT_SECTION(
+COMPILER_RT_SEG INSTR_PROF_ORDERFILE_SECT_NAME);
 
 // To avoid GC'ing of the dummy variables by the linker, reference them in an
 // array and reference the array in the runtime registration code
@@ -206,7 +208,7 @@ static int dummy_vnds[0] COMPILER_RT_SECTION(
 COMPILER_RT_VISIBILITY
 void *__llvm_profile_keep[] = {(void *)&dummy_cnts, (void *)&dummy_bits,
(void *)&dummy_data, (void *)&dummy_name,
-   (void *)&dummy_vnds};
+   (void *)&dummy_vnds, (void *)&dummy_orderfile};
 #ifdef __GNUC__
 #pragma GCC diagnostic pop
 #endif
diff --git a/compiler-rt/test/profile/AIX/bexpfull-pgo.c 
b/compiler-rt/test/profile/AIX/bexpfull-pgo.c
new file mode 100644
index 00..f48242ec6bfeaa
--- /dev/null
+++ b/compiler-rt/test/profile/AIX/bexpfull-pgo.c
@@ -0,0 +1,7 @@
+// RUN: %clang_pgogen %s -bexpall
+// RUN: %clang_pgogen %s -bexpfull
+
+#include 
+int ar[10];
+int n;
+int main() { memcpy(ar, ar + 1, n); };

``




https://github.com/llvm/llvm-project/pull/82148
___
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] [lldb] a147a6b - Revert "Report only loaded debug info in statistics dump (#81706)"

2024-02-17 Thread via llvm-branch-commits

Author: Jonas Devlieghere
Date: 2024-02-17T21:32:08-08:00
New Revision: a147a6b5d8b26c644b8efd5a99ab7c6727079a9a

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

LOG: Revert "Report only loaded debug info in statistics dump (#81706)"

This reverts commit 21ddd7ff2b166c5e133b460b1a09ee8adb786ccd.

Added: 


Modified: 
lldb/bindings/interface/SBStatisticsOptionsDocstrings.i
lldb/include/lldb/API/SBStatisticsOptions.h
lldb/include/lldb/Symbol/SymbolFile.h
lldb/include/lldb/Symbol/SymbolFileOnDemand.h
lldb/include/lldb/Target/Statistics.h
lldb/source/API/SBStatisticsOptions.cpp
lldb/source/Commands/CommandObjectStats.cpp
lldb/source/Commands/Options.td
lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h
lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
lldb/source/Symbol/SymbolFile.cpp
lldb/source/Symbol/SymbolFileOnDemand.cpp
lldb/source/Target/Statistics.cpp
lldb/test/API/functionalities/stats_api/TestStatisticsAPI.py

Removed: 
lldb/test/API/functionalities/stats_api/main.dwo.yaml
lldb/test/API/functionalities/stats_api/main.o.yaml



diff  --git a/lldb/bindings/interface/SBStatisticsOptionsDocstrings.i 
b/lldb/bindings/interface/SBStatisticsOptionsDocstrings.i
index 087f6ab8786630..f72cf84319e19b 100644
--- a/lldb/bindings/interface/SBStatisticsOptionsDocstrings.i
+++ b/lldb/bindings/interface/SBStatisticsOptionsDocstrings.i
@@ -6,9 +6,3 @@
 ) lldb::SBStatisticsOptions::SetSummaryOnly;
 %feature("docstring", "Gets whether the statistics only dump a summary."
 ) lldb::SBStatisticsOptions::GetSummaryOnly;
-%feature("docstring", "
-Sets whether the statistics will force loading all possible debug info."
-) lldb::SBStatisticsOptions::SetReportAllAvailableDebugInfo;
-%feature("docstring", "
-Gets whether the statistics will force loading all possible debug info."
-) lldb::SBStatisticsOptions::GetReportAllAvailableDebugInfo;

diff  --git a/lldb/include/lldb/API/SBStatisticsOptions.h 
b/lldb/include/lldb/API/SBStatisticsOptions.h
index a0055135e36c2a..8019ed4315ca21 100644
--- a/lldb/include/lldb/API/SBStatisticsOptions.h
+++ b/lldb/include/lldb/API/SBStatisticsOptions.h
@@ -25,14 +25,6 @@ class LLDB_API SBStatisticsOptions {
   void SetSummaryOnly(bool b);
   bool GetSummaryOnly();
 
-  /// If set to true, the debugger will load all debug info that is available
-  /// and report statistics on the total amount. If this is set to false, then
-  /// only report statistics on the currently loaded debug information.
-  /// This can avoid loading debug info from separate files just so it can
-  /// report the total size which can slow down statistics reporting.
-  void SetReportAllAvailableDebugInfo(bool b);
-  bool GetReportAllAvailableDebugInfo();
-
 protected:
   friend class SBTarget;
   const lldb_private::StatisticsOptions &ref() const;

diff  --git a/lldb/include/lldb/Symbol/SymbolFile.h 
b/lldb/include/lldb/Symbol/SymbolFile.h
index d20766788192f7..f356f7b789fa38 100644
--- a/lldb/include/lldb/Symbol/SymbolFile.h
+++ b/lldb/include/lldb/Symbol/SymbolFile.h
@@ -381,8 +381,7 @@ class SymbolFile : public PluginInterface {
 
   /// Metrics gathering functions
 
-  /// Return the size in bytes of all loaded debug information or total 
possible
-  /// debug info in the symbol file.
+  /// Return the size in bytes of all debug information in the symbol file.
   ///
   /// If the debug information is contained in sections of an ObjectFile, then
   /// this call should add the size of all sections that contain debug
@@ -392,14 +391,7 @@ class SymbolFile : public PluginInterface {
   /// entire file should be returned. The default implementation of this
   /// function will iterate over all sections in a module and add up their
   /// debug info only section byte sizes.
-  ///
-  /// \param load_all_debug_info
-  ///   If true, force loading any symbol files if they are not yet loaded and
-  ///   add to the total size. Default to false.
-  ///
-  /// \returns
-  ///   Total currently loaded debug info size in bytes
-  virtual uint64_t GetDebugInfoSize(bool load_all_debug_info = false) = 0;
+  virtual uint64_t GetDebugInfoSize() = 0;
 
   /// Return the time taken to parse the debug information.
   ///
@@ -542,7 +534,7 @@ cla