Skip to content

Enable logf128 constant folding for hosts with 128bit long double #104929

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 4 commits into from
Aug 22, 2024

Conversation

MDevereau
Copy link
Contributor

@MDevereau MDevereau commented Aug 20, 2024

This is a reland of (#96287). This patch attempts to reduce the reverted patch's clang compile time by removing #includes of float128.h and inlining convertToQuad functions instead.

This is a reland of (llvm#96287). This patch attempts to reduce
clang's compile time by removing #includes of float128.h and
inlining convertToQuad functions instead.
@llvmbot llvmbot added cmake Build system in general and CMake in particular llvm:support llvm:analysis llvm:adt labels Aug 20, 2024
@llvmbot
Copy link
Member

llvmbot commented Aug 20, 2024

@llvm/pr-subscribers-llvm-adt

@llvm/pr-subscribers-llvm-support

Author: Matthew Devereau (MDevereau)

Changes

This is a reland of (#96287). This patch attempts to reduce clang's compile time by removing #includes of float128.h and inlining convertToQuad functions instead.


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

8 Files Affected:

  • (modified) llvm/CMakeLists.txt (-2)
  • (modified) llvm/cmake/config-ix.cmake (+7-11)
  • (modified) llvm/include/llvm/ADT/APFloat.h (+3-12)
  • (modified) llvm/include/llvm/ADT/APInt.h (+6-14)
  • (modified) llvm/include/llvm/Support/float128.h (+6-8)
  • (modified) llvm/lib/Analysis/CMakeLists.txt (-6)
  • (modified) llvm/lib/Analysis/ConstantFolding.cpp (+19-5)
  • (modified) llvm/lib/Support/APFloat.cpp (+2-22)
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index d681b1ccab6299..b03d89a43c34b0 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -560,8 +560,6 @@ set(LLVM_USE_STATIC_ZSTD FALSE CACHE BOOL "Use static version of zstd. Can be TR
 
 set(LLVM_ENABLE_CURL "OFF" CACHE STRING "Use libcurl for the HTTP client if available. Can be ON, OFF, or FORCE_ON")
 
-set(LLVM_HAS_LOGF128 "OFF" CACHE STRING "Use logf128 to constant fold fp128 logarithm calls. Can be ON, OFF, or FORCE_ON")
-
 set(LLVM_ENABLE_HTTPLIB "OFF" CACHE STRING "Use cpp-httplib HTTP server library if available. Can be ON, OFF, or FORCE_ON")
 
 set(LLVM_Z3_INSTALL_DIR "" CACHE STRING "Install directory of the Z3 solver.")
diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
index 0aae13e30f2ab4..976213bb9e948a 100644
--- a/llvm/cmake/config-ix.cmake
+++ b/llvm/cmake/config-ix.cmake
@@ -247,17 +247,6 @@ else()
   set(HAVE_LIBEDIT 0)
 endif()
 
-if(LLVM_HAS_LOGF128)
-  include(CheckCXXSymbolExists)
-  check_cxx_symbol_exists(logf128 math.h HAS_LOGF128)
-
-  if(LLVM_HAS_LOGF128 STREQUAL FORCE_ON AND NOT HAS_LOGF128)
-    message(FATAL_ERROR "Failed to configure logf128")
-  endif()
-
-  set(LLVM_HAS_LOGF128 "${HAS_LOGF128}")
-endif()
-
 # function checks
 check_symbol_exists(arc4random "stdlib.h" HAVE_DECL_ARC4RANDOM)
 find_package(Backtrace)
@@ -271,6 +260,13 @@ if(C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW)
   set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror=unguarded-availability-new")
 endif()
 
+check_cxx_symbol_exists(logf128 cmath HAS_LOGF128)
+check_symbol_exists(__powerpc64le__ "" __PPC64LE)
+if(HAS_LOGF128 AND NOT __PPC64LE)
+    set(LLVM_HAS_LOGF128 On)
+    add_compile_definitions(HAS_LOGF128)
+endif()
+
 # Determine whether we can register EH tables.
 check_symbol_exists(__register_frame "${CMAKE_CURRENT_LIST_DIR}/unwind.h" HAVE_REGISTER_FRAME)
 check_symbol_exists(__deregister_frame "${CMAKE_CURRENT_LIST_DIR}/unwind.h" HAVE_DEREGISTER_FRAME)
diff --git a/llvm/include/llvm/ADT/APFloat.h b/llvm/include/llvm/ADT/APFloat.h
index 7039e961bff82d..925d03d4c06670 100644
--- a/llvm/include/llvm/ADT/APFloat.h
+++ b/llvm/include/llvm/ADT/APFloat.h
@@ -19,7 +19,6 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/FloatingPointMode.h"
 #include "llvm/Support/ErrorHandling.h"
-#include "llvm/Support/float128.h"
 #include <memory>
 
 #define APFLOAT_DISPATCH_ON_SEMANTICS(METHOD_CALL)                             \
@@ -378,9 +377,6 @@ class IEEEFloat final : public APFloatBase {
   Expected<opStatus> convertFromString(StringRef, roundingMode);
   APInt bitcastToAPInt() const;
   double convertToDouble() const;
-#ifdef HAS_IEE754_FLOAT128
-  float128 convertToQuad() const;
-#endif
   float convertToFloat() const;
 
   /// @}
@@ -1274,14 +1270,9 @@ class APFloat : public APFloatBase {
   /// shorter semantics, like IEEEsingle and others.
   double convertToDouble() const;
 
-  /// Converts this APFloat to host float value.
-  ///
-  /// \pre The APFloat must be built using semantics, that can be represented by
-  /// the host float type without loss of precision. It can be IEEEquad and
-  /// shorter semantics, like IEEEdouble and others.
-#ifdef HAS_IEE754_FLOAT128
-  float128 convertToQuad() const;
-#endif
+  /// Return true if this APFloat has quadruple precision floating point
+  /// semantics
+  bool isValidIEEEQuad() const;
 
   /// Converts this APFloat to host float value.
   ///
diff --git a/llvm/include/llvm/ADT/APInt.h b/llvm/include/llvm/ADT/APInt.h
index 108df7e0eaeaa3..62e41ce88710b1 100644
--- a/llvm/include/llvm/ADT/APInt.h
+++ b/llvm/include/llvm/ADT/APInt.h
@@ -17,7 +17,6 @@
 
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
-#include "llvm/Support/float128.h"
 #include <cassert>
 #include <climits>
 #include <cstring>
@@ -1679,13 +1678,6 @@ class [[nodiscard]] APInt {
   /// any bit width. Exactly 64 bits will be translated.
   double bitsToDouble() const { return llvm::bit_cast<double>(getWord(0)); }
 
-#ifdef HAS_IEE754_FLOAT128
-  float128 bitsToQuad() const {
-    __uint128_t ul = ((__uint128_t)U.pVal[1] << 64) + U.pVal[0];
-    return llvm::bit_cast<float128>(ul);
-  }
-#endif
-
   /// Converts APInt bits to a float
   ///
   /// The conversion does not do a translation from integer to float, it just
@@ -1883,6 +1875,12 @@ class [[nodiscard]] APInt {
   /// Returns whether this instance allocated memory.
   bool needsCleanup() const { return !isSingleWord(); }
 
+  /// Get the word corresponding to a bit position
+  /// \returns the corresponding word for the specified bit position.
+  uint64_t getWord(unsigned bitPosition) const {
+    return isSingleWord() ? U.VAL : U.pVal[whichWord(bitPosition)];
+  }
+
 private:
   /// This union is used to store the integer value. When the
   /// integer bit-width <= 64, it uses VAL, otherwise it uses pVal.
@@ -1948,12 +1946,6 @@ class [[nodiscard]] APInt {
     return *this;
   }
 
-  /// Get the word corresponding to a bit position
-  /// \returns the corresponding word for the specified bit position.
-  uint64_t getWord(unsigned bitPosition) const {
-    return isSingleWord() ? U.VAL : U.pVal[whichWord(bitPosition)];
-  }
-
   /// Utility method to change the bit width of this APInt to new bit width,
   /// allocating and/or deallocating as necessary. There is no guarantee on the
   /// value of any bits upon return. Caller should populate the bits after.
diff --git a/llvm/include/llvm/Support/float128.h b/llvm/include/llvm/Support/float128.h
index e15a98dc5a6779..618b320086ba59 100644
--- a/llvm/include/llvm/Support/float128.h
+++ b/llvm/include/llvm/Support/float128.h
@@ -9,18 +9,16 @@
 #ifndef LLVM_FLOAT128
 #define LLVM_FLOAT128
 
+#include <cmath>
+
 namespace llvm {
 
-#if defined(__clang__) && defined(__FLOAT128__) &&                             \
-    defined(__SIZEOF_INT128__) && !defined(__LONG_DOUBLE_IBM128__)
-#define HAS_IEE754_FLOAT128
-typedef __float128 float128;
-#elif defined(__FLOAT128__) && defined(__SIZEOF_INT128__) &&                   \
-    !defined(__LONG_DOUBLE_IBM128__) &&                                        \
-    (defined(__GNUC__) || defined(__GNUG__))
+#ifdef HAS_LOGF128
+#if !defined(__LONG_DOUBLE_IBM128__) && (__SIZEOF_INT128__ == 16)
+typedef decltype(logf128(0.)) float128;
 #define HAS_IEE754_FLOAT128
-typedef _Float128 float128;
 #endif
+#endif // HAS_LOGF128
 
 } // namespace llvm
 #endif // LLVM_FLOAT128
diff --git a/llvm/lib/Analysis/CMakeLists.txt b/llvm/lib/Analysis/CMakeLists.txt
index 393803fad89383..3127f45cc54cb1 100644
--- a/llvm/lib/Analysis/CMakeLists.txt
+++ b/llvm/lib/Analysis/CMakeLists.txt
@@ -162,9 +162,3 @@ add_llvm_component_library(LLVMAnalysis
   Support
   TargetParser
   )
-
-include(CheckCXXSymbolExists)
-check_cxx_symbol_exists(logf128 math.h HAS_LOGF128)
-if(HAS_LOGF128)
- target_compile_definitions(LLVMAnalysis PRIVATE HAS_LOGF128)
-endif()
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index defcacdfa8b105..b3bea0722f7530 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -54,6 +54,7 @@
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/KnownBits.h"
 #include "llvm/Support/MathExtras.h"
+#include "llvm/Support/float128.h"
 #include <cassert>
 #include <cerrno>
 #include <cfenv>
@@ -1741,7 +1742,7 @@ Constant *GetConstantFoldFPValue(double V, Type *Ty) {
   llvm_unreachable("Can only constant fold half/float/double");
 }
 
-#if defined(HAS_IEE754_FLOAT128) && defined(HAS_LOGF128)
+#if defined(HAS_IEE754_FLOAT128)
 Constant *GetConstantFoldFPValue128(float128 V, Type *Ty) {
   if (Ty->isFP128Ty())
     return ConstantFP::get(Ty, V);
@@ -1781,11 +1782,18 @@ Constant *ConstantFoldFP(double (*NativeFP)(double), const APFloat &V,
   return GetConstantFoldFPValue(Result, Ty);
 }
 
-#if defined(HAS_IEE754_FLOAT128) && defined(HAS_LOGF128)
+#if defined(HAS_IEE754_FLOAT128)
 Constant *ConstantFoldFP128(float128 (*NativeFP)(float128), const APFloat &V,
                             Type *Ty) {
   llvm_fenv_clearexcept();
-  float128 Result = NativeFP(V.convertToQuad());
+
+  if (!V.isValidIEEEQuad())
+    return nullptr;
+
+  APInt Api = V.bitcastToAPInt();
+  __uint128_t Int128 = ((__uint128_t)Api.getWord(64) << 64) + Api.getWord(0);
+  float128 Result = NativeFP(llvm::bit_cast<float128>(Int128));
+
   if (llvm_fenv_testexcept()) {
     llvm_fenv_clearexcept();
     return nullptr;
@@ -2114,10 +2122,16 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
     if (IntrinsicID == Intrinsic::canonicalize)
       return constantFoldCanonicalize(Ty, Call, U);
 
-#if defined(HAS_IEE754_FLOAT128) && defined(HAS_LOGF128)
+#if defined(HAS_IEE754_FLOAT128)
     if (Ty->isFP128Ty()) {
       if (IntrinsicID == Intrinsic::log) {
-        float128 Result = logf128(Op->getValueAPF().convertToQuad());
+        APFloat Value = Op->getValueAPF();
+        if (!Value.isValidIEEEQuad())
+          return nullptr;
+        APInt api = Value.bitcastToAPInt();
+        __uint128_t Int128 =
+            ((__uint128_t)api.getWord(64) << 64) + api.getWord(0);
+        float128 Result = logf128(llvm::bit_cast<float128>(Int128));
         return GetConstantFoldFPValue128(Result, Ty);
       }
 
diff --git a/llvm/lib/Support/APFloat.cpp b/llvm/lib/Support/APFloat.cpp
index 7f68c5ab9b7cf7..2ddf99f56f88d5 100644
--- a/llvm/lib/Support/APFloat.cpp
+++ b/llvm/lib/Support/APFloat.cpp
@@ -3749,15 +3749,6 @@ double IEEEFloat::convertToDouble() const {
   return api.bitsToDouble();
 }
 
-#ifdef HAS_IEE754_FLOAT128
-float128 IEEEFloat::convertToQuad() const {
-  assert(semantics == (const llvm::fltSemantics *)&semIEEEquad &&
-         "Float semantics are not IEEEquads");
-  APInt api = bitcastToAPInt();
-  return api.bitsToQuad();
-}
-#endif
-
 /// Integer bit is explicit in this format.  Intel hardware (387 and later)
 /// does not support these bit patterns:
 ///  exponent = all 1's, integer bit 0, significand 0 ("pseudoinfinity")
@@ -5406,20 +5397,9 @@ double APFloat::convertToDouble() const {
   return Temp.getIEEE().convertToDouble();
 }
 
-#ifdef HAS_IEE754_FLOAT128
-float128 APFloat::convertToQuad() const {
-  if (&getSemantics() == (const llvm::fltSemantics *)&semIEEEquad)
-    return getIEEE().convertToQuad();
-  assert(getSemantics().isRepresentableBy(semIEEEquad) &&
-         "Float semantics is not representable by IEEEquad");
-  APFloat Temp = *this;
-  bool LosesInfo;
-  opStatus St = Temp.convert(semIEEEquad, rmNearestTiesToEven, &LosesInfo);
-  assert(!(St & opInexact) && !LosesInfo && "Unexpected imprecision");
-  (void)St;
-  return Temp.getIEEE().convertToQuad();
+bool APFloat::isValidIEEEQuad() const {
+  return (&getSemantics() == (const llvm::fltSemantics *)&semIEEEquad);
 }
-#endif
 
 float APFloat::convertToFloat() const {
   if (&getSemantics() == (const llvm::fltSemantics *)&semIEEEsingle)

@llvmbot
Copy link
Member

llvmbot commented Aug 20, 2024

@llvm/pr-subscribers-llvm-analysis

Author: Matthew Devereau (MDevereau)

Changes

This is a reland of (#96287). This patch attempts to reduce clang's compile time by removing #includes of float128.h and inlining convertToQuad functions instead.


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

8 Files Affected:

  • (modified) llvm/CMakeLists.txt (-2)
  • (modified) llvm/cmake/config-ix.cmake (+7-11)
  • (modified) llvm/include/llvm/ADT/APFloat.h (+3-12)
  • (modified) llvm/include/llvm/ADT/APInt.h (+6-14)
  • (modified) llvm/include/llvm/Support/float128.h (+6-8)
  • (modified) llvm/lib/Analysis/CMakeLists.txt (-6)
  • (modified) llvm/lib/Analysis/ConstantFolding.cpp (+19-5)
  • (modified) llvm/lib/Support/APFloat.cpp (+2-22)
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index d681b1ccab6299..b03d89a43c34b0 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -560,8 +560,6 @@ set(LLVM_USE_STATIC_ZSTD FALSE CACHE BOOL "Use static version of zstd. Can be TR
 
 set(LLVM_ENABLE_CURL "OFF" CACHE STRING "Use libcurl for the HTTP client if available. Can be ON, OFF, or FORCE_ON")
 
-set(LLVM_HAS_LOGF128 "OFF" CACHE STRING "Use logf128 to constant fold fp128 logarithm calls. Can be ON, OFF, or FORCE_ON")
-
 set(LLVM_ENABLE_HTTPLIB "OFF" CACHE STRING "Use cpp-httplib HTTP server library if available. Can be ON, OFF, or FORCE_ON")
 
 set(LLVM_Z3_INSTALL_DIR "" CACHE STRING "Install directory of the Z3 solver.")
diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
index 0aae13e30f2ab4..976213bb9e948a 100644
--- a/llvm/cmake/config-ix.cmake
+++ b/llvm/cmake/config-ix.cmake
@@ -247,17 +247,6 @@ else()
   set(HAVE_LIBEDIT 0)
 endif()
 
-if(LLVM_HAS_LOGF128)
-  include(CheckCXXSymbolExists)
-  check_cxx_symbol_exists(logf128 math.h HAS_LOGF128)
-
-  if(LLVM_HAS_LOGF128 STREQUAL FORCE_ON AND NOT HAS_LOGF128)
-    message(FATAL_ERROR "Failed to configure logf128")
-  endif()
-
-  set(LLVM_HAS_LOGF128 "${HAS_LOGF128}")
-endif()
-
 # function checks
 check_symbol_exists(arc4random "stdlib.h" HAVE_DECL_ARC4RANDOM)
 find_package(Backtrace)
@@ -271,6 +260,13 @@ if(C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW)
   set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror=unguarded-availability-new")
 endif()
 
+check_cxx_symbol_exists(logf128 cmath HAS_LOGF128)
+check_symbol_exists(__powerpc64le__ "" __PPC64LE)
+if(HAS_LOGF128 AND NOT __PPC64LE)
+    set(LLVM_HAS_LOGF128 On)
+    add_compile_definitions(HAS_LOGF128)
+endif()
+
 # Determine whether we can register EH tables.
 check_symbol_exists(__register_frame "${CMAKE_CURRENT_LIST_DIR}/unwind.h" HAVE_REGISTER_FRAME)
 check_symbol_exists(__deregister_frame "${CMAKE_CURRENT_LIST_DIR}/unwind.h" HAVE_DEREGISTER_FRAME)
diff --git a/llvm/include/llvm/ADT/APFloat.h b/llvm/include/llvm/ADT/APFloat.h
index 7039e961bff82d..925d03d4c06670 100644
--- a/llvm/include/llvm/ADT/APFloat.h
+++ b/llvm/include/llvm/ADT/APFloat.h
@@ -19,7 +19,6 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/FloatingPointMode.h"
 #include "llvm/Support/ErrorHandling.h"
-#include "llvm/Support/float128.h"
 #include <memory>
 
 #define APFLOAT_DISPATCH_ON_SEMANTICS(METHOD_CALL)                             \
@@ -378,9 +377,6 @@ class IEEEFloat final : public APFloatBase {
   Expected<opStatus> convertFromString(StringRef, roundingMode);
   APInt bitcastToAPInt() const;
   double convertToDouble() const;
-#ifdef HAS_IEE754_FLOAT128
-  float128 convertToQuad() const;
-#endif
   float convertToFloat() const;
 
   /// @}
@@ -1274,14 +1270,9 @@ class APFloat : public APFloatBase {
   /// shorter semantics, like IEEEsingle and others.
   double convertToDouble() const;
 
-  /// Converts this APFloat to host float value.
-  ///
-  /// \pre The APFloat must be built using semantics, that can be represented by
-  /// the host float type without loss of precision. It can be IEEEquad and
-  /// shorter semantics, like IEEEdouble and others.
-#ifdef HAS_IEE754_FLOAT128
-  float128 convertToQuad() const;
-#endif
+  /// Return true if this APFloat has quadruple precision floating point
+  /// semantics
+  bool isValidIEEEQuad() const;
 
   /// Converts this APFloat to host float value.
   ///
diff --git a/llvm/include/llvm/ADT/APInt.h b/llvm/include/llvm/ADT/APInt.h
index 108df7e0eaeaa3..62e41ce88710b1 100644
--- a/llvm/include/llvm/ADT/APInt.h
+++ b/llvm/include/llvm/ADT/APInt.h
@@ -17,7 +17,6 @@
 
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
-#include "llvm/Support/float128.h"
 #include <cassert>
 #include <climits>
 #include <cstring>
@@ -1679,13 +1678,6 @@ class [[nodiscard]] APInt {
   /// any bit width. Exactly 64 bits will be translated.
   double bitsToDouble() const { return llvm::bit_cast<double>(getWord(0)); }
 
-#ifdef HAS_IEE754_FLOAT128
-  float128 bitsToQuad() const {
-    __uint128_t ul = ((__uint128_t)U.pVal[1] << 64) + U.pVal[0];
-    return llvm::bit_cast<float128>(ul);
-  }
-#endif
-
   /// Converts APInt bits to a float
   ///
   /// The conversion does not do a translation from integer to float, it just
@@ -1883,6 +1875,12 @@ class [[nodiscard]] APInt {
   /// Returns whether this instance allocated memory.
   bool needsCleanup() const { return !isSingleWord(); }
 
+  /// Get the word corresponding to a bit position
+  /// \returns the corresponding word for the specified bit position.
+  uint64_t getWord(unsigned bitPosition) const {
+    return isSingleWord() ? U.VAL : U.pVal[whichWord(bitPosition)];
+  }
+
 private:
   /// This union is used to store the integer value. When the
   /// integer bit-width <= 64, it uses VAL, otherwise it uses pVal.
@@ -1948,12 +1946,6 @@ class [[nodiscard]] APInt {
     return *this;
   }
 
-  /// Get the word corresponding to a bit position
-  /// \returns the corresponding word for the specified bit position.
-  uint64_t getWord(unsigned bitPosition) const {
-    return isSingleWord() ? U.VAL : U.pVal[whichWord(bitPosition)];
-  }
-
   /// Utility method to change the bit width of this APInt to new bit width,
   /// allocating and/or deallocating as necessary. There is no guarantee on the
   /// value of any bits upon return. Caller should populate the bits after.
diff --git a/llvm/include/llvm/Support/float128.h b/llvm/include/llvm/Support/float128.h
index e15a98dc5a6779..618b320086ba59 100644
--- a/llvm/include/llvm/Support/float128.h
+++ b/llvm/include/llvm/Support/float128.h
@@ -9,18 +9,16 @@
 #ifndef LLVM_FLOAT128
 #define LLVM_FLOAT128
 
+#include <cmath>
+
 namespace llvm {
 
-#if defined(__clang__) && defined(__FLOAT128__) &&                             \
-    defined(__SIZEOF_INT128__) && !defined(__LONG_DOUBLE_IBM128__)
-#define HAS_IEE754_FLOAT128
-typedef __float128 float128;
-#elif defined(__FLOAT128__) && defined(__SIZEOF_INT128__) &&                   \
-    !defined(__LONG_DOUBLE_IBM128__) &&                                        \
-    (defined(__GNUC__) || defined(__GNUG__))
+#ifdef HAS_LOGF128
+#if !defined(__LONG_DOUBLE_IBM128__) && (__SIZEOF_INT128__ == 16)
+typedef decltype(logf128(0.)) float128;
 #define HAS_IEE754_FLOAT128
-typedef _Float128 float128;
 #endif
+#endif // HAS_LOGF128
 
 } // namespace llvm
 #endif // LLVM_FLOAT128
diff --git a/llvm/lib/Analysis/CMakeLists.txt b/llvm/lib/Analysis/CMakeLists.txt
index 393803fad89383..3127f45cc54cb1 100644
--- a/llvm/lib/Analysis/CMakeLists.txt
+++ b/llvm/lib/Analysis/CMakeLists.txt
@@ -162,9 +162,3 @@ add_llvm_component_library(LLVMAnalysis
   Support
   TargetParser
   )
-
-include(CheckCXXSymbolExists)
-check_cxx_symbol_exists(logf128 math.h HAS_LOGF128)
-if(HAS_LOGF128)
- target_compile_definitions(LLVMAnalysis PRIVATE HAS_LOGF128)
-endif()
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index defcacdfa8b105..b3bea0722f7530 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -54,6 +54,7 @@
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/KnownBits.h"
 #include "llvm/Support/MathExtras.h"
+#include "llvm/Support/float128.h"
 #include <cassert>
 #include <cerrno>
 #include <cfenv>
@@ -1741,7 +1742,7 @@ Constant *GetConstantFoldFPValue(double V, Type *Ty) {
   llvm_unreachable("Can only constant fold half/float/double");
 }
 
-#if defined(HAS_IEE754_FLOAT128) && defined(HAS_LOGF128)
+#if defined(HAS_IEE754_FLOAT128)
 Constant *GetConstantFoldFPValue128(float128 V, Type *Ty) {
   if (Ty->isFP128Ty())
     return ConstantFP::get(Ty, V);
@@ -1781,11 +1782,18 @@ Constant *ConstantFoldFP(double (*NativeFP)(double), const APFloat &V,
   return GetConstantFoldFPValue(Result, Ty);
 }
 
-#if defined(HAS_IEE754_FLOAT128) && defined(HAS_LOGF128)
+#if defined(HAS_IEE754_FLOAT128)
 Constant *ConstantFoldFP128(float128 (*NativeFP)(float128), const APFloat &V,
                             Type *Ty) {
   llvm_fenv_clearexcept();
-  float128 Result = NativeFP(V.convertToQuad());
+
+  if (!V.isValidIEEEQuad())
+    return nullptr;
+
+  APInt Api = V.bitcastToAPInt();
+  __uint128_t Int128 = ((__uint128_t)Api.getWord(64) << 64) + Api.getWord(0);
+  float128 Result = NativeFP(llvm::bit_cast<float128>(Int128));
+
   if (llvm_fenv_testexcept()) {
     llvm_fenv_clearexcept();
     return nullptr;
@@ -2114,10 +2122,16 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
     if (IntrinsicID == Intrinsic::canonicalize)
       return constantFoldCanonicalize(Ty, Call, U);
 
-#if defined(HAS_IEE754_FLOAT128) && defined(HAS_LOGF128)
+#if defined(HAS_IEE754_FLOAT128)
     if (Ty->isFP128Ty()) {
       if (IntrinsicID == Intrinsic::log) {
-        float128 Result = logf128(Op->getValueAPF().convertToQuad());
+        APFloat Value = Op->getValueAPF();
+        if (!Value.isValidIEEEQuad())
+          return nullptr;
+        APInt api = Value.bitcastToAPInt();
+        __uint128_t Int128 =
+            ((__uint128_t)api.getWord(64) << 64) + api.getWord(0);
+        float128 Result = logf128(llvm::bit_cast<float128>(Int128));
         return GetConstantFoldFPValue128(Result, Ty);
       }
 
diff --git a/llvm/lib/Support/APFloat.cpp b/llvm/lib/Support/APFloat.cpp
index 7f68c5ab9b7cf7..2ddf99f56f88d5 100644
--- a/llvm/lib/Support/APFloat.cpp
+++ b/llvm/lib/Support/APFloat.cpp
@@ -3749,15 +3749,6 @@ double IEEEFloat::convertToDouble() const {
   return api.bitsToDouble();
 }
 
-#ifdef HAS_IEE754_FLOAT128
-float128 IEEEFloat::convertToQuad() const {
-  assert(semantics == (const llvm::fltSemantics *)&semIEEEquad &&
-         "Float semantics are not IEEEquads");
-  APInt api = bitcastToAPInt();
-  return api.bitsToQuad();
-}
-#endif
-
 /// Integer bit is explicit in this format.  Intel hardware (387 and later)
 /// does not support these bit patterns:
 ///  exponent = all 1's, integer bit 0, significand 0 ("pseudoinfinity")
@@ -5406,20 +5397,9 @@ double APFloat::convertToDouble() const {
   return Temp.getIEEE().convertToDouble();
 }
 
-#ifdef HAS_IEE754_FLOAT128
-float128 APFloat::convertToQuad() const {
-  if (&getSemantics() == (const llvm::fltSemantics *)&semIEEEquad)
-    return getIEEE().convertToQuad();
-  assert(getSemantics().isRepresentableBy(semIEEEquad) &&
-         "Float semantics is not representable by IEEEquad");
-  APFloat Temp = *this;
-  bool LosesInfo;
-  opStatus St = Temp.convert(semIEEEquad, rmNearestTiesToEven, &LosesInfo);
-  assert(!(St & opInexact) && !LosesInfo && "Unexpected imprecision");
-  (void)St;
-  return Temp.getIEEE().convertToQuad();
+bool APFloat::isValidIEEEQuad() const {
+  return (&getSemantics() == (const llvm::fltSemantics *)&semIEEEquad);
 }
-#endif
 
 float APFloat::convertToFloat() const {
   if (&getSemantics() == (const llvm::fltSemantics *)&semIEEEsingle)

@MDevereau MDevereau requested review from nikic and davemgreen August 20, 2024 13:55
@@ -1883,6 +1875,12 @@ class [[nodiscard]] APInt {
/// Returns whether this instance allocated memory.
bool needsCleanup() const { return !isSingleWord(); }

/// Get the word corresponding to a bit position
/// \returns the corresponding word for the specified bit position.
uint64_t getWord(unsigned bitPosition) const {
Copy link
Collaborator

@davemgreen davemgreen Aug 20, 2024

Choose a reason for hiding this comment

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

Would it be possible to avoid adding this by using LowHalf == APInt.getWord(0) == APint.trunc(64).getZExtValue() and HighHalf == APInt.getWord(64) == APInt.lshr(64).trunc(64).getZExtValue().

It might help prevent making the internal function public, at the expense of some relatively messier combining back into a __uint128_t.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is what the extractBitsAsZExtValue API is for.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

extractBitsAsZExtValue is much better, thanks.

@nikic
Copy link
Contributor

nikic commented Aug 20, 2024

I confirmed that this version doesn't have an impact on clang build times.

Copy link
Collaborator

@davemgreen davemgreen left a comment

Choose a reason for hiding this comment

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

Thanks for checking, thats good to hear. The changes LGTM, with a suggestion to common some code even if it doesn't end up in a header.

Comment on lines 1793 to 1796
APInt Api = V.bitcastToAPInt();
__uint128_t Int128 = ((__uint128_t)Api.extractBitsAsZExtValue(64, 64) << 64) +
Api.extractBitsAsZExtValue(64, 0);
float128 Result = NativeFP(llvm::bit_cast<float128>(Int128));
Copy link
Collaborator

Choose a reason for hiding this comment

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

It might be worth having a method to abstract the two converts in this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@MDevereau MDevereau merged commit 14c7e4a into llvm:main Aug 22, 2024
7 of 8 checks passed
@MDevereau MDevereau deleted the logf128 branch August 22, 2024 09:13
@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 22, 2024

LLVM Buildbot has detected a new failure on builder llvm-nvptx64-nvidia-ubuntu running on as-builder-7 while building llvm at step 6 "test-build-unified-tree-check-llvm".

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

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

Step 6 (test-build-unified-tree-check-llvm) failure: test (failure)
******************** TEST 'LLVM :: Transforms/InstSimplify/ConstProp/logf128.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/bin/opt < /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll -passes=instsimplify -S | /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/bin/FileCheck /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
+ /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/bin/opt -passes=instsimplify -S
+ /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/bin/FileCheck /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:75:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:41:35: note: scanning from here
define fp128 @log_e_negative_2() {
                                  ^
<stdin>:42:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:107:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:57:42: note: scanning from here
define fp128 @log_e_negative_infinity() {
                                         ^
<stdin>:58:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:123:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret <2 x fp128> <fp128 0xL00000000000000007FFF800000000000, fp128 0xL00000000000000007FFF800000000000>
              ^
<stdin>:65:48: note: scanning from here
define <2 x fp128> @log_e_negative_2_vector() {
                                               ^
<stdin>:66:2: note: possible intended match here
 ret <2 x fp128> <fp128 0xL0000000000000000FFFF800000000000, fp128 0xL0000000000000000FFFF800000000000>
 ^

Input file: <stdin>
Check file: /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll

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

Input was:
<<<<<<
            .
            .
            .
           36:  
           37: define fp128 @log_e_smallest_number_larger_than_one() { 
           38:  ret fp128 0xL00000000000000003F8F000000000000 
           39: } 
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 22, 2024

LLVM Buildbot has detected a new failure on builder llvm-nvptx-nvidia-ubuntu running on as-builder-7 while building llvm at step 6 "test-build-unified-tree-check-llvm".

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

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

Step 6 (test-build-unified-tree-check-llvm) failure: test (failure)
******************** TEST 'LLVM :: Transforms/InstSimplify/ConstProp/logf128.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/build/bin/opt < /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll -passes=instsimplify -S | /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/build/bin/FileCheck /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
+ /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/build/bin/opt -passes=instsimplify -S
+ /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/build/bin/FileCheck /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:75:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:41:35: note: scanning from here
define fp128 @log_e_negative_2() {
                                  ^
<stdin>:42:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:107:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:57:42: note: scanning from here
define fp128 @log_e_negative_infinity() {
                                         ^
<stdin>:58:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:123:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret <2 x fp128> <fp128 0xL00000000000000007FFF800000000000, fp128 0xL00000000000000007FFF800000000000>
              ^
<stdin>:65:48: note: scanning from here
define <2 x fp128> @log_e_negative_2_vector() {
                                               ^
<stdin>:66:2: note: possible intended match here
 ret <2 x fp128> <fp128 0xL0000000000000000FFFF800000000000, fp128 0xL0000000000000000FFFF800000000000>
 ^

Input file: <stdin>
Check file: /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll

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

Input was:
<<<<<<
            .
            .
            .
           36:  
           37: define fp128 @log_e_smallest_number_larger_than_one() { 
           38:  ret fp128 0xL00000000000000003F8F000000000000 
           39: } 
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 22, 2024

LLVM Buildbot has detected a new failure on builder clang-cmake-x86_64-avx512-linux running on avx512-intel64 while building llvm at step 7 "ninja check 1".

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

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

Step 7 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'LLVM :: Transforms/InstSimplify/ConstProp/logf128.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/stage1/bin/opt < /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll -passes=instsimplify -S | /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/stage1/bin/FileCheck /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
+ /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/stage1/bin/opt -passes=instsimplify -S
+ /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/stage1/bin/FileCheck /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:75:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:41:35: note: scanning from here
define fp128 @log_e_negative_2() {
                                  ^
<stdin>:42:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:107:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:57:42: note: scanning from here
define fp128 @log_e_negative_infinity() {
                                         ^
<stdin>:58:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:123:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret <2 x fp128> <fp128 0xL00000000000000007FFF800000000000, fp128 0xL00000000000000007FFF800000000000>
              ^
<stdin>:65:48: note: scanning from here
define <2 x fp128> @log_e_negative_2_vector() {
                                               ^
<stdin>:66:2: note: possible intended match here
 ret <2 x fp128> <fp128 0xL0000000000000000FFFF800000000000, fp128 0xL0000000000000000FFFF800000000000>
 ^

Input file: <stdin>
Check file: /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll

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

Input was:
<<<<<<
            .
            .
            .
           36:  
           37: define fp128 @log_e_smallest_number_larger_than_one() { 
           38:  ret fp128 0xL00000000000000003F8F000000000000 
           39: } 
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 22, 2024

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-sie-ubuntu-fast running on sie-linux-worker while building llvm at step 6 "test-build-unified-tree-check-all".

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

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

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: Transforms/InstSimplify/ConstProp/logf128.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/opt < /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll -passes=instsimplify -S | /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/FileCheck /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
+ /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/opt -passes=instsimplify -S
+ /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/FileCheck /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
�[1m/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:75:15: �[0m�[0;1;31merror: �[0m�[1mCHECK-NEXT: expected string not found in input
�[0m; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
�[0;1;32m              ^
�[0m�[1m<stdin>:41:35: �[0m�[0;1;30mnote: �[0m�[1mscanning from here
�[0mdefine fp128 @log_e_negative_2() {
�[0;1;32m                                  ^
�[0m�[1m<stdin>:42:2: �[0m�[0;1;30mnote: �[0m�[1mpossible intended match here
�[0m ret fp128 0xL0000000000000000FFFF800000000000
�[0;1;32m ^
�[0m�[1m/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:107:15: �[0m�[0;1;31merror: �[0m�[1mCHECK-NEXT: expected string not found in input
�[0m; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
�[0;1;32m              ^
�[0m�[1m<stdin>:57:42: �[0m�[0;1;30mnote: �[0m�[1mscanning from here
�[0mdefine fp128 @log_e_negative_infinity() {
�[0;1;32m                                         ^
�[0m�[1m<stdin>:58:2: �[0m�[0;1;30mnote: �[0m�[1mpossible intended match here
�[0m ret fp128 0xL0000000000000000FFFF800000000000
�[0;1;32m ^
�[0m�[1m/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:123:15: �[0m�[0;1;31merror: �[0m�[1mCHECK-NEXT: expected string not found in input
�[0m; CHECK-NEXT: ret <2 x fp128> <fp128 0xL00000000000000007FFF800000000000, fp128 0xL00000000000000007FFF800000000000>
�[0;1;32m              ^
�[0m�[1m<stdin>:65:48: �[0m�[0;1;30mnote: �[0m�[1mscanning from here
�[0mdefine <2 x fp128> @log_e_negative_2_vector() {
�[0;1;32m                                               ^
�[0m�[1m<stdin>:66:2: �[0m�[0;1;30mnote: �[0m�[1mpossible intended match here
�[0m ret <2 x fp128> <fp128 0xL0000000000000000FFFF800000000000, fp128 0xL0000000000000000FFFF800000000000>
�[0;1;32m ^
�[0m
Input file: <stdin>
Check file: /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll

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

Input was:
<<<<<<
�[1m�[0m�[0;1;30m             1: �[0m�[1m�[0;1;46m; ModuleID = '<stdin>' �[0m
�[0;1;30m             2: �[0m�[1m�[0;1;46msource_filename = "<stdin>" �[0m
�[0;1;30m             3: �[0m�[1m�[0;1;46m �[0m
�[0;1;30m             4: �[0m�[1m�[0;1;46m; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) �[0m
�[0;1;30m             5: �[0m�[1m�[0;1;46mdeclare fp128 @llvm.log.f128(fp128) #0 �[0m
�[0;1;30m             6: �[0m�[1m�[0;1;46m �[0m
�[0;1;30m             7: �[0m�[1m�[0;1;46mdeclare fp128 @logl(fp128) �[0m
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 22, 2024

LLVM Buildbot has detected a new failure on builder ml-opt-rel-x86-64 running on ml-opt-rel-x86-64-b1 while building llvm at step 6 "test-build-unified-tree-check-all".

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

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

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: Transforms/InstSimplify/ConstProp/logf128.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /b/ml-opt-rel-x86-64-b1/build/bin/opt < /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll -passes=instsimplify -S | /b/ml-opt-rel-x86-64-b1/build/bin/FileCheck /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
+ /b/ml-opt-rel-x86-64-b1/build/bin/opt -passes=instsimplify -S
+ /b/ml-opt-rel-x86-64-b1/build/bin/FileCheck /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
/b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:75:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:41:35: note: scanning from here
define fp128 @log_e_negative_2() {
                                  ^
<stdin>:42:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:107:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:57:42: note: scanning from here
define fp128 @log_e_negative_infinity() {
                                         ^
<stdin>:58:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:123:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret <2 x fp128> <fp128 0xL00000000000000007FFF800000000000, fp128 0xL00000000000000007FFF800000000000>
              ^
<stdin>:65:48: note: scanning from here
define <2 x fp128> @log_e_negative_2_vector() {
                                               ^
<stdin>:66:2: note: possible intended match here
 ret <2 x fp128> <fp128 0xL0000000000000000FFFF800000000000, fp128 0xL0000000000000000FFFF800000000000>
 ^

Input file: <stdin>
Check file: /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll

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

Input was:
<<<<<<
            .
            .
            .
           36:  
           37: define fp128 @log_e_smallest_number_larger_than_one() { 
           38:  ret fp128 0xL00000000000000003F8F000000000000 
           39: } 
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 22, 2024

LLVM Buildbot has detected a new failure on builder openmp-offload-sles-build-only running on rocm-worker-hw-04-sles while building llvm at step 8 "Add check check-llvm".

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

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

Step 8 (Add check check-llvm) failure: test (failure)
******************** TEST 'LLVM :: Transforms/InstSimplify/ConstProp/logf128.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/bin/opt < /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll -passes=instsimplify -S | /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/bin/FileCheck /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
+ /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/bin/FileCheck /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
+ /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/bin/opt -passes=instsimplify -S
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:75:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:41:35: note: scanning from here
define fp128 @log_e_negative_2() {
                                  ^
<stdin>:42:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:107:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:57:42: note: scanning from here
define fp128 @log_e_negative_infinity() {
                                         ^
<stdin>:58:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:123:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret <2 x fp128> <fp128 0xL00000000000000007FFF800000000000, fp128 0xL00000000000000007FFF800000000000>
              ^
<stdin>:65:48: note: scanning from here
define <2 x fp128> @log_e_negative_2_vector() {
                                               ^
<stdin>:66:2: note: possible intended match here
 ret <2 x fp128> <fp128 0xL0000000000000000FFFF800000000000, fp128 0xL0000000000000000FFFF800000000000>
 ^

Input file: <stdin>
Check file: /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll

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

Input was:
<<<<<<
            .
            .
            .
           36:  
           37: define fp128 @log_e_smallest_number_larger_than_one() { 
           38:  ret fp128 0xL00000000000000003F8F000000000000 
           39: } 
...

@MDevereau
Copy link
Contributor Author

ccb2b79 Has been pushed and should tix negative NaN values in tests.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 22, 2024

LLVM Buildbot has detected a new failure on builder ml-opt-dev-x86-64 running on ml-opt-dev-x86-64-b2 while building llvm at step 6 "test-build-unified-tree-check-all".

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

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

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: Transforms/InstSimplify/ConstProp/logf128.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /b/ml-opt-dev-x86-64-b1/build/bin/opt < /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll -passes=instsimplify -S | /b/ml-opt-dev-x86-64-b1/build/bin/FileCheck /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
+ /b/ml-opt-dev-x86-64-b1/build/bin/opt -passes=instsimplify -S
+ /b/ml-opt-dev-x86-64-b1/build/bin/FileCheck /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:75:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:41:35: note: scanning from here
define fp128 @log_e_negative_2() {
                                  ^
<stdin>:42:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:107:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:57:42: note: scanning from here
define fp128 @log_e_negative_infinity() {
                                         ^
<stdin>:58:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:123:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret <2 x fp128> <fp128 0xL00000000000000007FFF800000000000, fp128 0xL00000000000000007FFF800000000000>
              ^
<stdin>:65:48: note: scanning from here
define <2 x fp128> @log_e_negative_2_vector() {
                                               ^
<stdin>:66:2: note: possible intended match here
 ret <2 x fp128> <fp128 0xL0000000000000000FFFF800000000000, fp128 0xL0000000000000000FFFF800000000000>
 ^

Input file: <stdin>
Check file: /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll

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

Input was:
<<<<<<
            .
            .
            .
           36:  
           37: define fp128 @log_e_smallest_number_larger_than_one() { 
           38:  ret fp128 0xL00000000000000003F8F000000000000 
           39: } 
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 22, 2024

LLVM Buildbot has detected a new failure on builder ml-opt-devrel-x86-64 running on ml-opt-devrel-x86-64-b1 while building llvm at step 6 "test-build-unified-tree-check-all".

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

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

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: Transforms/InstSimplify/ConstProp/logf128.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /b/ml-opt-devrel-x86-64-b1/build/bin/opt < /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll -passes=instsimplify -S | /b/ml-opt-devrel-x86-64-b1/build/bin/FileCheck /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
+ /b/ml-opt-devrel-x86-64-b1/build/bin/FileCheck /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
+ /b/ml-opt-devrel-x86-64-b1/build/bin/opt -passes=instsimplify -S
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:75:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:41:35: note: scanning from here
define fp128 @log_e_negative_2() {
                                  ^
<stdin>:42:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:107:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:57:42: note: scanning from here
define fp128 @log_e_negative_infinity() {
                                         ^
<stdin>:58:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:123:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret <2 x fp128> <fp128 0xL00000000000000007FFF800000000000, fp128 0xL00000000000000007FFF800000000000>
              ^
<stdin>:65:48: note: scanning from here
define <2 x fp128> @log_e_negative_2_vector() {
                                               ^
<stdin>:66:2: note: possible intended match here
 ret <2 x fp128> <fp128 0xL0000000000000000FFFF800000000000, fp128 0xL0000000000000000FFFF800000000000>
 ^

Input file: <stdin>
Check file: /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll

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

Input was:
<<<<<<
            .
            .
            .
           36:  
           37: define fp128 @log_e_smallest_number_larger_than_one() { 
           38:  ret fp128 0xL00000000000000003F8F000000000000 
           39: } 
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 22, 2024

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

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

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

Step 8 (Add check check-llvm) failure: test (failure)
******************** TEST 'LLVM :: Transforms/InstSimplify/ConstProp/logf128.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/bin/opt < /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll -passes=instsimplify -S | /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/bin/FileCheck /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
+ /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/bin/opt -passes=instsimplify -S
+ /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/bin/FileCheck /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:75:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:41:35: note: scanning from here
define fp128 @log_e_negative_2() {
                                  ^
<stdin>:42:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:107:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:57:42: note: scanning from here
define fp128 @log_e_negative_infinity() {
                                         ^
<stdin>:58:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:123:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret <2 x fp128> <fp128 0xL00000000000000007FFF800000000000, fp128 0xL00000000000000007FFF800000000000>
              ^
<stdin>:65:48: note: scanning from here
define <2 x fp128> @log_e_negative_2_vector() {
                                               ^
<stdin>:66:2: note: possible intended match here
 ret <2 x fp128> <fp128 0xL0000000000000000FFFF800000000000, fp128 0xL0000000000000000FFFF800000000000>
 ^

Input file: <stdin>
Check file: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll

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

Input was:
<<<<<<
            .
            .
            .
           36:  
           37: define fp128 @log_e_smallest_number_larger_than_one() { 
           38:  ret fp128 0xL00000000000000003F8F000000000000 
           39: } 
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 22, 2024

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-expensive-checks-ubuntu running on as-builder-4 while building llvm at step 6 "test-build-unified-tree-check-all".

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

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

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: Transforms/InstSimplify/ConstProp/logf128.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/build/bin/opt < /home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll -passes=instsimplify -S | /home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/build/bin/FileCheck /home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
+ /home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/build/bin/opt -passes=instsimplify -S
+ /home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/build/bin/FileCheck /home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
/home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:75:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:41:35: note: scanning from here
define fp128 @log_e_negative_2() {
                                  ^
<stdin>:42:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:107:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:57:42: note: scanning from here
define fp128 @log_e_negative_infinity() {
                                         ^
<stdin>:58:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:123:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret <2 x fp128> <fp128 0xL00000000000000007FFF800000000000, fp128 0xL00000000000000007FFF800000000000>
              ^
<stdin>:65:48: note: scanning from here
define <2 x fp128> @log_e_negative_2_vector() {
                                               ^
<stdin>:66:2: note: possible intended match here
 ret <2 x fp128> <fp128 0xL0000000000000000FFFF800000000000, fp128 0xL0000000000000000FFFF800000000000>
 ^

Input file: <stdin>
Check file: /home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll

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

Input was:
<<<<<<
            .
            .
            .
           36:  
           37: define fp128 @log_e_smallest_number_larger_than_one() { 
           38:  ret fp128 0xL00000000000000003F8F000000000000 
           39: } 
...

@chapuni
Copy link
Contributor

chapuni commented Aug 23, 2024

@MDevereau I wonder this causes different behavior, for generated binaries by clang, between !HAS_LOGF128 and HAS_LOGF128.

My case: I am making my builders check artifacts between "aarch64 object files built by aarch64-clang" and "aarch64 object files built by x86_64-clang for targeting aarch64". This triggers the incompatibility. Investigating.

I hope LLVM_HAS_LOGF128 to remain optional, if HAS_LOGF128 would introduce the different behavior.
I'd be really happy if you could revert this for now.

@amy-kwan
Copy link
Contributor

I would also be ok with a revert of this patch for now. Would that be possible?
It's still causing issues on three of the PPC buildbots:
https://lab.llvm.org/buildbot/#/builders/95/builds/2838
https://lab.llvm.org/buildbot/#/builders/76/builds/2182
https://lab.llvm.org/buildbot/#/builders/168/builds/2502

cjdb pushed a commit to cjdb/llvm-project that referenced this pull request Aug 23, 2024
…vm#104929)

This is a reland of (llvm#96287). This patch attempts to reduce the reverted
patch's clang compile time by removing #includes of float128.h and
inlining convertToQuad functions instead.
cjdb pushed a commit to cjdb/llvm-project that referenced this pull request Aug 23, 2024
@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 24, 2024

LLVM Buildbot has detected a new failure on builder clang-with-thin-lto-ubuntu running on as-worker-92 while building llvm at step 7 "test-stage1-compiler".

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

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

Step 7 (test-stage1-compiler) failure: build (failure)
...
llvm-lit: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/utils/lit/lit/llvm/config.py:508: note: using ld64.lld: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/bin/ld64.lld
llvm-lit: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/utils/lit/lit/llvm/config.py:508: note: using wasm-ld: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/bin/wasm-ld
llvm-lit: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/utils/lit/tests/lit.cfg:111: warning: Setting a timeout per test not supported. Requires the Python psutil module but it could not be found. Try installing it via pip or via your operating system's package manager.
 Some tests will be skipped and the --timeout command line argument will not work.
llvm-lit: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/utils/lit/lit/llvm/config.py:508: note: using ld.lld: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/bin/ld.lld
llvm-lit: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/utils/lit/lit/llvm/config.py:508: note: using lld-link: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/bin/lld-link
llvm-lit: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/utils/lit/lit/llvm/config.py:508: note: using ld64.lld: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/bin/ld64.lld
llvm-lit: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/utils/lit/lit/llvm/config.py:508: note: using wasm-ld: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/bin/wasm-ld
-- Testing: 80096 tests, 72 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 
FAIL: LLVM :: Transforms/InstSimplify/ConstProp/logf128.ll (64327 of 80096)
******************** TEST 'LLVM :: Transforms/InstSimplify/ConstProp/logf128.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/bin/opt < /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll -passes=instsimplify -S | /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/bin/FileCheck /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
+ /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/bin/opt -passes=instsimplify -S
+ /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/bin/FileCheck /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:75:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:41:35: note: scanning from here
define fp128 @log_e_negative_2() {
                                  ^
<stdin>:42:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:107:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:57:42: note: scanning from here
define fp128 @log_e_negative_infinity() {
                                         ^
<stdin>:58:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:123:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret <2 x fp128> <fp128 0xL00000000000000007FFF800000000000, fp128 0xL00000000000000007FFF800000000000>
              ^
<stdin>:65:48: note: scanning from here
define <2 x fp128> @log_e_negative_2_vector() {
                                               ^
<stdin>:66:2: note: possible intended match here
 ret <2 x fp128> <fp128 0xL0000000000000000FFFF800000000000, fp128 0xL0000000000000000FFFF800000000000>
 ^

Input file: <stdin>
Check file: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll

chapuni added a commit that referenced this pull request Aug 24, 2024
…uble (#104929)"

ConstantFolding behaves differently depending on host's `HAS_IEE754_FLOAT128`.
LLVM should not change the behavior depending on host configurations.

This reverts commit 14c7e4a.
(llvmorg-20-init-3262-g14c7e4a18449 and llvmorg-20-init-3498-g001e423ac626)
Copy link
Contributor

@chapuni chapuni left a comment

Choose a reason for hiding this comment

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

Excuse me, I have reverted.

LLVM should not change its behavior depending on host configurations.

if (!Value.isValidIEEEQuad())
return nullptr;

float128 Result = logf128(ConvertToQuad(Value));
Copy link
Contributor

Choose a reason for hiding this comment

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

APFloat should have a software emulator that behaves bit-identical.
Then, the native logf128 may be used as an optimization in it.

@davemgreen
Copy link
Collaborator

Hello. The behaviour of llvm fp already depends on the host architecture, you have just found another place where that is again true. The compiler has for a long time used the host architectures c library implementation to perform constant folding of fp values. I can appreciate why the determinism you talk about is useful but this is causing some very large performance problems with the difference between fp128 soft-float routines and constant folding. In the long run we would like it to work as you say with an implementation in APFloat, but as far as I understand from looking around that does not exist yet given the current constraints inside llvm (no exp for newton iterations, no sqrt for whatever agm is).

The two machines you mention (aarch64 on x86 and aarch64 on aarch64) I would expect should both have logf128 providing they are new enough (or fp128 would not be relevant for them).

I believe all the buildbots and reported issues were fixed with the changes from 001e423 and 83a5c7c. It is a shame this got so close before being reverted.

@chapuni
Copy link
Contributor

chapuni commented Aug 28, 2024

@davemgreen Thanks for your explanation of the background and I am sorry for bothering you.

The two machines you mention (aarch64 on x86 and aarch64 on aarch64) I would expect should both have logf128 providing they are new enough (or fp128 would not be relevant for them).

In fact, my environment, (Ubuntu-20.04 glibc-2.31, gcc-9.4, libstdc++-9), didn't detect HAS_LOGF128 on x86-64 clang but did on g++-9.4 and aarch64-clang. As my further investigation, /usr/include/x86_64-linux-gnu/bits/floatn.h has the condition;

/* Defined to 1 if the current compiler invocation provides a
   floating-point type with the IEEE 754 binary128 format, and this
   glibc includes corresponding *f128 interfaces for it.  The required
   libgcc support was added some time after the basic compiler
   support, for x86_64 and x86.  */
#if (defined __x86_64__                                                 \
     ? __GNUC_PREREQ (4, 3)                                             \
     : (defined __GNU__ ? __GNUC_PREREQ (4, 5) : __GNUC_PREREQ (4, 4))) \
     &&  !defined(__CUDACC__)
# define __HAVE_FLOAT128 1
#else
# define __HAVE_FLOAT128 0
#endif

x86_64-clang doesn't set __HAVE_FLOAT128=1 since clang pretends gcc-4.2.1.

For now, I hope logf128-specific behavior may be suppressed with CMake configuration.
Also ppc64 is incompatible.

@MDevereau
Copy link
Contributor Author

MDevereau commented Aug 28, 2024

It is known that clang on x86-64 doesn't include logf128 via #include cmath (See #96287 (comment)). This was planned to be implemented once this patch landed and will need some extra care to get working. This feature is still a work in progress and is not yet exhaustive for all targets. Thank you for the information about the contents of floatn.h, that's useful to know.

ppc is not compatible due to usage of the ibm128 floating point representation rather than IEE754 floats. Thus, we have disabled this for ppc (and the tests now properly do not run now thanks to 001e423). I personally do not have plans to implement a ppc compatible solution for this and will disable it for this host type.

@MDevereau
Copy link
Contributor Author

@chapuni Would you be happy with this patch if I relanded it with constant folding enabled by default but with a way to opt out of the behaviour via CMake?

check_symbol_exists(__powerpc64le__ "" __PPC64LE)
if(HAS_LOGF128 AND NOT __PPC64LE)
set(LLVM_HAS_LOGF128 On)
add_compile_definitions(HAS_LOGF128)
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this have a cmakedefine entry in llvm/Config/config.h.cmake instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was meant to always be enabled if available, and thus cmake would do a test and define the cmake variable LLVM_HAS_LOGF128 if the test passed. This patch has been reverted now, but what is likely to happen is this behaviour will be enabled by default, but be eligible to opt-out via a cmake definition which will have an entry in llvm/Config/config.h.cmake

@chapuni
Copy link
Contributor

chapuni commented Aug 29, 2024

@MDevereau Thanks. I am less happy with it but fair enough since it is configurable.

I think we need to discuss. Could you post a survey to the forum before it would be turned on, please?

@MDevereau MDevereau restored the logf128 branch August 29, 2024 14:43
@MDevereau MDevereau deleted the logf128 branch August 29, 2024 14:50
@MDevereau MDevereau restored the logf128 branch August 29, 2024 14:50
@MDevereau MDevereau deleted the logf128 branch August 29, 2024 14:51
MDevereau added a commit to MDevereau/llvm-project that referenced this pull request Aug 29, 2024
Hosts with a long double size of 128 bits can benefit highly
from constant fp128 folding with the function logf128

This patch relands llvm#104929. With commits 001e423 and 83a5c7c
fixing buildbot failures.

This patch also adds the option to manually disable the behaviour
with the cmake option -DLLVM_DISABLE_LOGF128=On
@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 29, 2024

LLVM Buildbot has detected a new failure on builder clang-with-lto-ubuntu running on as-worker-91 while building llvm at step 7 "test-stage1-compiler".

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

Here is the relevant piece of the build log for the reference
Step 7 (test-stage1-compiler) failure: build (failure)
...
llvm-lit: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/llvm-project/llvm/utils/lit/lit/llvm/config.py:508: note: using ld64.lld: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/build/stage1/bin/ld64.lld
llvm-lit: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/llvm-project/llvm/utils/lit/lit/llvm/config.py:508: note: using wasm-ld: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/build/stage1/bin/wasm-ld
llvm-lit: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/build/stage1/utils/lit/tests/lit.cfg:111: warning: Setting a timeout per test not supported. Requires the Python psutil module but it could not be found. Try installing it via pip or via your operating system's package manager.
 Some tests will be skipped and the --timeout command line argument will not work.
llvm-lit: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/llvm-project/llvm/utils/lit/lit/llvm/config.py:508: note: using ld.lld: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/build/stage1/bin/ld.lld
llvm-lit: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/llvm-project/llvm/utils/lit/lit/llvm/config.py:508: note: using lld-link: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/build/stage1/bin/lld-link
llvm-lit: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/llvm-project/llvm/utils/lit/lit/llvm/config.py:508: note: using ld64.lld: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/build/stage1/bin/ld64.lld
llvm-lit: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/llvm-project/llvm/utils/lit/lit/llvm/config.py:508: note: using wasm-ld: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/build/stage1/bin/wasm-ld
-- Testing: 80096 tests, 72 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 
FAIL: LLVM :: Transforms/InstSimplify/ConstProp/logf128.ll (64334 of 80096)
******************** TEST 'LLVM :: Transforms/InstSimplify/ConstProp/logf128.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/build/stage1/bin/opt < /home/buildbot/as-worker-91/clang-with-lto-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll -passes=instsimplify -S | /home/buildbot/as-worker-91/clang-with-lto-ubuntu/build/stage1/bin/FileCheck /home/buildbot/as-worker-91/clang-with-lto-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
+ /home/buildbot/as-worker-91/clang-with-lto-ubuntu/build/stage1/bin/opt -passes=instsimplify -S
+ /home/buildbot/as-worker-91/clang-with-lto-ubuntu/build/stage1/bin/FileCheck /home/buildbot/as-worker-91/clang-with-lto-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
/home/buildbot/as-worker-91/clang-with-lto-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:75:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:41:35: note: scanning from here
define fp128 @log_e_negative_2() {
                                  ^
<stdin>:42:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/home/buildbot/as-worker-91/clang-with-lto-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:107:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:57:42: note: scanning from here
define fp128 @log_e_negative_infinity() {
                                         ^
<stdin>:58:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/home/buildbot/as-worker-91/clang-with-lto-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:123:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret <2 x fp128> <fp128 0xL00000000000000007FFF800000000000, fp128 0xL00000000000000007FFF800000000000>
              ^
<stdin>:65:48: note: scanning from here
define <2 x fp128> @log_e_negative_2_vector() {
                                               ^
<stdin>:66:2: note: possible intended match here
 ret <2 x fp128> <fp128 0xL0000000000000000FFFF800000000000, fp128 0xL0000000000000000FFFF800000000000>
 ^

Input file: <stdin>
Check file: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/llvm-project/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll

@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 21, 2024

LLVM Buildbot has detected a new failure on builder clang-m68k-linux-cross running on suse-gary-m68k-cross while building llvm at step 5 "ninja check 1".

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

Here is the relevant piece of the build log for the reference
Step 5 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'LLVM :: Transforms/InstSimplify/ConstProp/logf128.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /srv/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/bin/opt < /srv/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll -passes=instsimplify -S | /srv/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/bin/FileCheck /srv/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
+ /srv/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/bin/opt -passes=instsimplify -S
+ /srv/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/bin/FileCheck /srv/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
/srv/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:75:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:41:35: note: scanning from here
define fp128 @log_e_negative_2() {
                                  ^
<stdin>:42:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/srv/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:107:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:57:42: note: scanning from here
define fp128 @log_e_negative_infinity() {
                                         ^
<stdin>:58:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/srv/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:123:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret <2 x fp128> <fp128 0xL00000000000000007FFF800000000000, fp128 0xL00000000000000007FFF800000000000>
              ^
<stdin>:65:48: note: scanning from here
define <2 x fp128> @log_e_negative_2_vector() {
                                               ^
<stdin>:66:2: note: possible intended match here
 ret <2 x fp128> <fp128 0xL0000000000000000FFFF800000000000, fp128 0xL0000000000000000FFFF800000000000>
 ^

Input file: <stdin>
Check file: /srv/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll

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

Input was:
<<<<<<
            .
            .
            .
           36:  
           37: define fp128 @log_e_smallest_number_larger_than_one() { 
           38:  ret fp128 0xL00000000000000003F8F000000000000 
           39: } 
...

qiaojbao pushed a commit to GPUOpen-Drivers/llvm-project that referenced this pull request Sep 30, 2024
…93b7eeddf

Local branch amd-gfx 3b493b7 Merged main:b9a02765504f8b83701ffffc097531638c4fc22e into amd-gfx:3906fefcb801
Remote branch main 3ef64f7 Revert "Enable logf128 constant folding for hosts with 128bit long double (llvm#104929)"
@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 6, 2024

LLVM Buildbot has detected a new failure on builder premerge-monolithic-windows running on premerge-windows-1 while building llvm at step 5 "clean-build-dir".

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

Here is the relevant piece of the build log for the reference
Step 5 (clean-build-dir) failure: Delete failed. (failure)
Step 7 (build-unified-tree) failure: build (failure)
...
[8124/12528] Building CXX object tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\symbol.cpp.obj
[8125/12528] Building CXX object tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\semantics.cpp.obj
C:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Semantics\semantics.cpp(667): warning C4927: illegal conversion; more than one user-defined conversion has been implicitly applied
C:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Semantics\semantics.cpp(667): note: while calling the constructor 'Fortran::semantics::Symbol::Symbol(const Fortran::semantics::Symbol &) noexcept(false)'
C:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\include\flang\Semantics\symbol.h(959): note: compiler has generated 'Fortran::semantics::Symbol::Symbol' here
[8126/12528] Building CXX object tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\tools.cpp.obj
[8127/12528] Building CXX object tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\type.cpp.obj
[8128/12528] Building CXX object tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\unparse-with-symbols.cpp.obj
[8129/12528] Building CXX object tools\flang\lib\Frontend\CMakeFiles\flangFrontend.dir\CodeGenOptions.cpp.obj
[8130/12528] Building CXX object tools\flang\lib\Frontend\CMakeFiles\flangFrontend.dir\CompilerInvocation.cpp.obj
FAILED: tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/CompilerInvocation.cpp.obj 
sccache C:\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe  /nologo /TP -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\flang\lib\Frontend -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Frontend -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\include -Itools\flang\include -Iinclude -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\mlir\include -Itools\mlir\include -Itools\clang\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\clang\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw /O2 /Ob2  -MD  /EHs-c- /GR- -UNDEBUG -std:c++17 /showIncludes /Fotools\flang\lib\Frontend\CMakeFiles\flangFrontend.dir\CompilerInvocation.cpp.obj /Fdtools\flang\lib\Frontend\CMakeFiles\flangFrontend.dir\flangFrontend.pdb /FS -c C:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Frontend\CompilerInvocation.cpp
tools\clang\include\clang/Driver/Options.inc(1834): fatal error C1060: compiler is out of heap space
[8131/12528] Linking CXX static library lib\FortranSemantics.lib
FAILED: lib/FortranSemantics.lib 
cmd.exe /C "cd . && C:\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\lib.exe /nologo /machine:x64 /out:lib\FortranSemantics.lib tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\assignment.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\attr.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\canonicalize-acc.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\canonicalize-directives.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\canonicalize-do.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\canonicalize-omp.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\check-acc-structure.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\check-allocate.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\check-arithmeticif.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\check-call.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\check-case.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\check-coarray.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\check-cuda.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\check-data.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\check-deallocate.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\check-declarations.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\check-do-forall.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\check-if-stmt.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\check-io.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\check-namelist.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\check-nullify.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\check-omp-structure.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\check-purity.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\check-return.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\check-select-rank.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\check-select-type.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\check-stop.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\compute-offsets.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\data-to-inits.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\definable.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\expression.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\mod-file.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\pointer-assignment.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\program-tree.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\resolve-labels.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\resolve-directives.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\resolve-names-utils.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\resolve-names.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\rewrite-directives.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\rewrite-parse-tree.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\runtime-type-info.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\scope.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\semantics.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\symbol.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\tools.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\type.cpp.obj tools\flang\lib\Semantics\CMakeFiles\FortranSemantics.dir\unparse-with-symbols.cpp.obj  && cd ."
LINK : fatal error LNK1102: out of memory

[8132/12528] Building CXX object tools\flang\lib\Frontend\CMakeFiles\flangFrontend.dir\CompilerInstance.cpp.obj
FAILED: tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/CompilerInstance.cpp.obj 
sccache C:\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe  /nologo /TP -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\flang\lib\Frontend -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Frontend -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\include -Itools\flang\include -Iinclude -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\mlir\include -Itools\mlir\include -Itools\clang\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\clang\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw /O2 /Ob2  -MD  /EHs-c- /GR- -UNDEBUG -std:c++17 /showIncludes /Fotools\flang\lib\Frontend\CMakeFiles\flangFrontend.dir\CompilerInstance.cpp.obj /Fdtools\flang\lib\Frontend\CMakeFiles\flangFrontend.dir\flangFrontend.pdb /FS -c C:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Frontend\CompilerInstance.cpp
C:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\include\llvm/Frontend/Debug/Options.h(13): fatal error C1060: compiler is out of heap space
[8133/12528] Building CXX object tools\flang\lib\Lower\CMakeFiles\FortranLower.dir\VectorSubscripts.cpp.obj
FAILED: tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/VectorSubscripts.cpp.obj 
sccache C:\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe  /nologo /TP -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\include -Itools\flang\include -Iinclude -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\mlir\include -Itools\mlir\include -Itools\clang\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\clang\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw /O2 /Ob2  -MD  /EHs-c- /GR- -UNDEBUG -std:c++17 /showIncludes /Fotools\flang\lib\Lower\CMakeFiles\FortranLower.dir\VectorSubscripts.cpp.obj /Fdtools\flang\lib\Lower\CMakeFiles\FortranLower.dir\FortranLower.pdb /FS -c C:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower\VectorSubscripts.cpp
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\variant(1529): fatal error C1060: compiler is out of heap space
[8134/12528] Building CXX object tools\flang\lib\Lower\CMakeFiles\FortranLower.dir\Runtime.cpp.obj
FAILED: tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/Runtime.cpp.obj 
sccache C:\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe  /nologo /TP -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\include -Itools\flang\include -Iinclude -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\mlir\include -Itools\mlir\include -Itools\clang\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\clang\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw /O2 /Ob2  -MD  /EHs-c- /GR- -UNDEBUG -std:c++17 /showIncludes /Fotools\flang\lib\Lower\CMakeFiles\FortranLower.dir\Runtime.cpp.obj /Fdtools\flang\lib\Lower\CMakeFiles\FortranLower.dir\FortranLower.pdb /FS -c C:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower\Runtime.cpp
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\variant(481): fatal error C1060: compiler is out of heap space
[8135/12528] Building CXX object tools\flang\lib\Lower\CMakeFiles\FortranLower.dir\OpenMP\ClauseProcessor.cpp.obj
FAILED: tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/ClauseProcessor.cpp.obj 
sccache C:\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe  /nologo /TP -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\include -Itools\flang\include -Iinclude -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\mlir\include -Itools\mlir\include -Itools\clang\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\clang\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw /O2 /Ob2  -MD  /EHs-c- /GR- -UNDEBUG -std:c++17 /showIncludes /Fotools\flang\lib\Lower\CMakeFiles\FortranLower.dir\OpenMP\ClauseProcessor.cpp.obj /Fdtools\flang\lib\Lower\CMakeFiles\FortranLower.dir\FortranLower.pdb /FS -c C:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower\OpenMP\ClauseProcessor.cpp
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\variant(479): fatal error C1060: compiler is out of heap space
[8136/12528] Building CXX object tools\flang\lib\Lower\CMakeFiles\FortranLower.dir\PFTBuilder.cpp.obj
FAILED: tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/PFTBuilder.cpp.obj 
sccache C:\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe  /nologo /TP -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\include -Itools\flang\include -Iinclude -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\mlir\include -Itools\mlir\include -Itools\clang\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\clang\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw /O2 /Ob2  -MD  /EHs-c- /GR- -UNDEBUG -std:c++17 /showIncludes /Fotools\flang\lib\Lower\CMakeFiles\FortranLower.dir\PFTBuilder.cpp.obj /Fdtools\flang\lib\Lower\CMakeFiles\FortranLower.dir\FortranLower.pdb /FS -c C:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower\PFTBuilder.cpp
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\variant(1529): fatal error C1060: compiler is out of heap space
[8137/12528] Building CXX object tools\flang\lib\Lower\CMakeFiles\FortranLower.dir\OpenMP\Decomposer.cpp.obj
FAILED: tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/Decomposer.cpp.obj 
sccache C:\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe  /nologo /TP -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\include -Itools\flang\include -Iinclude -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\mlir\include -Itools\mlir\include -Itools\clang\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\clang\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw /O2 /Ob2  -MD  /EHs-c- /GR- -UNDEBUG -std:c++17 /showIncludes /Fotools\flang\lib\Lower\CMakeFiles\FortranLower.dir\OpenMP\Decomposer.cpp.obj /Fdtools\flang\lib\Lower\CMakeFiles\FortranLower.dir\FortranLower.pdb /FS -c C:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower\OpenMP\Decomposer.cpp
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\variant(777): fatal error C1060: compiler is out of heap space
[8138/12528] Building CXX object tools\flang\lib\Lower\CMakeFiles\FortranLower.dir\OpenMP\OpenMP.cpp.obj
FAILED: tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/OpenMP.cpp.obj 
sccache C:\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe  /nologo /TP -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\include -Itools\flang\include -Iinclude -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\mlir\include -Itools\mlir\include -Itools\clang\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\clang\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw /O2 /Ob2  -MD  /EHs-c- /GR- -UNDEBUG -std:c++17 /showIncludes /Fotools\flang\lib\Lower\CMakeFiles\FortranLower.dir\OpenMP\OpenMP.cpp.obj /Fdtools\flang\lib\Lower\CMakeFiles\FortranLower.dir\FortranLower.pdb /FS -c C:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower\OpenMP\OpenMP.cpp
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\variant(479): fatal error C1060: compiler is out of heap space
[8139/12528] Building CXX object tools\flang\lib\Lower\CMakeFiles\FortranLower.dir\OpenMP\Utils.cpp.obj
FAILED: tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/Utils.cpp.obj 
sccache C:\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe  /nologo /TP -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\include -Itools\flang\include -Iinclude -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\mlir\include -Itools\mlir\include -Itools\clang\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\clang\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw /O2 /Ob2  -MD  /EHs-c- /GR- -UNDEBUG -std:c++17 /showIncludes /Fotools\flang\lib\Lower\CMakeFiles\FortranLower.dir\OpenMP\Utils.cpp.obj /Fdtools\flang\lib\Lower\CMakeFiles\FortranLower.dir\FortranLower.pdb /FS -c C:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower\OpenMP\Utils.cpp

@llvm-ci
Copy link
Collaborator

llvm-ci commented Feb 25, 2025

LLVM Buildbot has detected a new failure on builder openmp-offload-amdgpu-runtime-2 running on rocm-worker-hw-02 while building llvm at step 8 "Add check check-llvm".

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

Here is the relevant piece of the build log for the reference
Step 8 (Add check check-llvm) failure: test (failure)
******************** TEST 'LLVM :: Transforms/InstSimplify/ConstProp/logf128.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/opt < /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll -passes=instsimplify -S | /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/FileCheck /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
+ /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/opt -passes=instsimplify -S
+ /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/FileCheck /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:75:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:41:35: note: scanning from here
define fp128 @log_e_negative_2() {
                                  ^
<stdin>:42:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:107:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret fp128 0xL00000000000000007FFF800000000000
              ^
<stdin>:57:42: note: scanning from here
define fp128 @log_e_negative_infinity() {
                                         ^
<stdin>:58:2: note: possible intended match here
 ret fp128 0xL0000000000000000FFFF800000000000
 ^
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll:123:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: ret <2 x fp128> <fp128 0xL00000000000000007FFF800000000000, fp128 0xL00000000000000007FFF800000000000>
              ^
<stdin>:65:48: note: scanning from here
define <2 x fp128> @log_e_negative_2_vector() {
                                               ^
<stdin>:66:2: note: possible intended match here
 ret <2 x fp128> <fp128 0xL0000000000000000FFFF800000000000, fp128 0xL0000000000000000FFFF800000000000>
 ^

Input file: <stdin>
Check file: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/test/Transforms/InstSimplify/ConstProp/logf128.ll

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

Input was:
<<<<<<
            .
            .
            .
           36:  
           37: define fp128 @log_e_smallest_number_larger_than_one() { 
           38:  ret fp128 0xL00000000000000003F8F000000000000 
           39: } 
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmake Build system in general and CMake in particular llvm:adt llvm:analysis llvm:support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants