Skip to content

[libc][math][c23] Fix totalorderf128 requiring support for 128-bit ints #101229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

overmighty
Copy link
Member

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Jul 30, 2024

@llvm/pr-subscribers-libc

Author: OverMighty (overmighty)

Changes

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

2 Files Affected:

  • (modified) libc/src/__support/FPUtil/BasicOperations.h (+2-1)
  • (modified) libc/src/__support/FPUtil/CMakeLists.txt (+1)
diff --git a/libc/src/__support/FPUtil/BasicOperations.h b/libc/src/__support/FPUtil/BasicOperations.h
index 50f1e19e08d64..d68f3ae6a26bb 100644
--- a/libc/src/__support/FPUtil/BasicOperations.h
+++ b/libc/src/__support/FPUtil/BasicOperations.h
@@ -14,6 +14,7 @@
 #include "dyadic_float.h"
 
 #include "src/__support/CPP/type_traits.h"
+#include "src/__support/big_int.h"
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
 #include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
@@ -320,7 +321,7 @@ totalorder(T x, T y) {
   StorageType x_u = x_bits.uintval();
   StorageType y_u = y_bits.uintval();
 
-  using signed_t = cpp::make_signed_t<StorageType>;
+  using signed_t = make_integral_or_big_int_signed_t<StorageType>;
   signed_t x_signed = static_cast<signed_t>(x_u);
   signed_t y_signed = static_cast<signed_t>(y_u);
 
diff --git a/libc/src/__support/FPUtil/CMakeLists.txt b/libc/src/__support/FPUtil/CMakeLists.txt
index bfdfffb85c255..ea1e0e8b39d10 100644
--- a/libc/src/__support/FPUtil/CMakeLists.txt
+++ b/libc/src/__support/FPUtil/CMakeLists.txt
@@ -189,6 +189,7 @@ add_header_library(
     .fp_bits
     .fenv_impl
     libc.src.__support.CPP.type_traits
+    libc.src.__support.big_int
     libc.src.__support.uint128
     libc.src.__support.common
     libc.src.__support.macros.optimization

@@ -320,7 +321,7 @@ totalorder(T x, T y) {
StorageType x_u = x_bits.uintval();
StorageType y_u = y_bits.uintval();

using signed_t = cpp::make_signed_t<StorageType>;
using signed_t = make_integral_or_big_int_signed_t<StorageType>;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason make_integral_or_big_int_signed_t was not used anywhere in LLVM libc. I'm guessing it used to be referenced by code that was changed.

@overmighty
Copy link
Member Author

cc @Jobhdez

@overmighty overmighty merged commit 5c406ea into llvm:main Jul 31, 2024
8 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 31, 2024

LLVM Buildbot has detected a new failure on builder openmp-offload-libc-amdgpu-runtime running on omp-vega20-1 while building libc at step 10 "Add check check-offload".

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

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

Step 10 (Add check check-offload) failure: 1200 seconds without output running [b'ninja', b'-j 32', b'check-offload'], attempting to kill
...
PASS: libomptarget :: amdgcn-amd-amdhsa :: offloading/bug49021.cpp (800 of 810)
PASS: libomptarget :: x86_64-pc-linux-gnu-LTO :: offloading/bug53727.cpp (801 of 810)
PASS: libomptarget :: x86_64-pc-linux-gnu :: offloading/std_complex_arithmetic.cpp (802 of 810)
PASS: libomptarget :: x86_64-pc-linux-gnu-LTO :: offloading/bug49779.cpp (803 of 810)
PASS: libomptarget :: x86_64-pc-linux-gnu-LTO :: offloading/wtime.c (804 of 810)
PASS: libomptarget :: x86_64-pc-linux-gnu-LTO :: offloading/bug50022.cpp (805 of 810)
PASS: libomptarget :: x86_64-pc-linux-gnu :: offloading/bug49021.cpp (806 of 810)
PASS: libomptarget :: x86_64-pc-linux-gnu-LTO :: offloading/complex_reduction.cpp (807 of 810)
PASS: libomptarget :: x86_64-pc-linux-gnu-LTO :: offloading/bug49021.cpp (808 of 810)
PASS: libomptarget :: x86_64-pc-linux-gnu-LTO :: offloading/std_complex_arithmetic.cpp (809 of 810)
command timed out: 1200 seconds without output running [b'ninja', b'-j 32', b'check-offload'], attempting to kill
process killed by signal 9
program finished with exit code -1
elapsedTime=1229.714432

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 31, 2024

LLVM Buildbot has detected a new failure on builder premerge-monolithic-linux running on premerge-linux-1 while building libc at step 7 "test-build-unified-tree-check-all".

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

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

Step 7 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: Analysis/StructuralHash/structural-hash-printer.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /build/buildbot/premerge-monolithic-linux/build/bin/opt -passes='print<structural-hash>' -disable-output /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/Analysis/StructuralHash/structural-hash-printer.ll 2>&1 | /build/buildbot/premerge-monolithic-linux/build/bin/FileCheck /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/Analysis/StructuralHash/structural-hash-printer.ll
+ /build/buildbot/premerge-monolithic-linux/build/bin/opt '-passes=print<structural-hash>' -disable-output /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/Analysis/StructuralHash/structural-hash-printer.ll
+ /build/buildbot/premerge-monolithic-linux/build/bin/FileCheck /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/Analysis/StructuralHash/structural-hash-printer.ll
RUN: at line 2: /build/buildbot/premerge-monolithic-linux/build/bin/opt -passes='print<structural-hash><detailed>' -disable-output /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/Analysis/StructuralHash/structural-hash-printer.ll 2>&1 | /build/buildbot/premerge-monolithic-linux/build/bin/FileCheck /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/Analysis/StructuralHash/structural-hash-printer.ll -check-prefix=DETAILED-HASH
+ /build/buildbot/premerge-monolithic-linux/build/bin/opt '-passes=print<structural-hash><detailed>' -disable-output /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/Analysis/StructuralHash/structural-hash-printer.ll
+ /build/buildbot/premerge-monolithic-linux/build/bin/FileCheck /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/Analysis/StructuralHash/structural-hash-printer.ll -check-prefix=DETAILED-HASH
/build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/Analysis/StructuralHash/structural-hash-printer.ll:24:23: error: DETAILED-HASH-NEXT: expected string not found in input
; DETAILED-HASH-NEXT: Function f2 Hash: {{([a-z0-9]{14,})}}
                      ^
<stdin>:2:35: note: scanning from here
Function f1 Hash: 5cf1028f02ae79ca
                                  ^
<stdin>:3:1: note: possible intended match here
Function f2 Hash: 5f7ffd3e8b5e7
^

Input file: <stdin>
Check file: /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/Analysis/StructuralHash/structural-hash-printer.ll

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

Input was:
<<<<<<
           1: Module Hash: 843b37c96eb46daf 
           2: Function f1 Hash: 5cf1028f02ae79ca 
next:24'0                                       X error: no match found
           3: Function f2 Hash: 5f7ffd3e8b5e7 
next:24'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next:24'1     ?                                possible intended match
>>>>>>

--

********************


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants