mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-24 22:06:06 +00:00
Revert "Constant Fold logf128 calls"
This reverts commit 088aa81a545421933254f19cd3c8914a0373b493.
This commit is contained in:
parent
034912d583
commit
efce8a05aa
@ -562,8 +562,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.")
|
||||
|
@ -257,17 +257,6 @@ else()
|
||||
set(LLVM_ENABLE_TERMINFO 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)
|
||||
|
@ -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) \
|
||||
@ -355,9 +354,6 @@ public:
|
||||
Expected<opStatus> convertFromString(StringRef, roundingMode);
|
||||
APInt bitcastToAPInt() const;
|
||||
double convertToDouble() const;
|
||||
#ifdef HAS_IEE754_FLOAT128
|
||||
float128 convertToQuad() const;
|
||||
#endif
|
||||
float convertToFloat() const;
|
||||
|
||||
/// @}
|
||||
@ -1222,15 +1218,6 @@ public:
|
||||
/// 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
|
||||
|
||||
/// Converts this APFloat to host float value.
|
||||
///
|
||||
/// \pre The APFloat must be built using semantics, that can be represented by
|
||||
|
@ -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>
|
||||
@ -1671,13 +1670,6 @@ public:
|
||||
/// 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
|
||||
|
@ -198,7 +198,4 @@
|
||||
/* Define if plugins enabled */
|
||||
#cmakedefine LLVM_ENABLE_PLUGINS
|
||||
|
||||
/* Define if logf128 is available */
|
||||
#cmakedefine LLVM_HAS_LOGF128
|
||||
|
||||
#endif
|
||||
|
@ -1,26 +0,0 @@
|
||||
//===-- llvm/Support/float128.h - Compiler abstraction support --*- C++ -*-===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_FLOAT128
|
||||
#define LLVM_FLOAT128
|
||||
|
||||
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__))
|
||||
#define HAS_IEE754_FLOAT128
|
||||
typedef _Float128 float128;
|
||||
#endif
|
||||
|
||||
} // namespace llvm
|
||||
#endif // LLVM_FLOAT128
|
@ -159,9 +159,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()
|
||||
|
@ -2089,17 +2089,6 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
|
||||
if (IntrinsicID == Intrinsic::canonicalize)
|
||||
return constantFoldCanonicalize(Ty, Call, U);
|
||||
|
||||
#if defined(HAS_IEE754_FLOAT128) && defined(HAS_LOGF128)
|
||||
if (Ty->isFP128Ty()) {
|
||||
switch (IntrinsicID) {
|
||||
default:
|
||||
return nullptr;
|
||||
case Intrinsic::log:
|
||||
return ConstantFP::get(Ty, logf128(Op->getValueAPF().convertToQuad()));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!Ty->isHalfTy() && !Ty->isFloatTy() && !Ty->isDoubleTy())
|
||||
return nullptr;
|
||||
|
||||
|
@ -3670,15 +3670,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")
|
||||
@ -5274,21 +5265,6 @@ 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();
|
||||
}
|
||||
#endif
|
||||
|
||||
float APFloat::convertToFloat() const {
|
||||
if (&getSemantics() == (const llvm::fltSemantics *)&semIEEEsingle)
|
||||
return getIEEE().convertToFloat();
|
||||
|
@ -26,7 +26,6 @@ llvm_canonicalize_cmake_booleans(
|
||||
LLVM_TOOL_LLVM_DRIVER_BUILD
|
||||
LLVM_INCLUDE_SPIRV_TOOLS_TESTS
|
||||
LLVM_APPEND_VC_REV
|
||||
LLVM_HAS_LOGF128
|
||||
)
|
||||
|
||||
configure_lit_site_cfg(
|
||||
|
@ -617,6 +617,3 @@ if "MemoryWithOrigins" in config.llvm_use_sanitizer:
|
||||
# "OBJECT_MODE" to 'any' by default on AIX OS.
|
||||
if "system-aix" in config.available_features:
|
||||
config.environment["OBJECT_MODE"] = "any"
|
||||
|
||||
if config.has_logf128:
|
||||
config.available_features.add("has_logf128")
|
||||
|
@ -63,7 +63,6 @@ config.have_llvm_driver = @LLVM_TOOL_LLVM_DRIVER_BUILD@
|
||||
config.spirv_tools_tests = @LLVM_INCLUDE_SPIRV_TOOLS_TESTS@
|
||||
config.have_vc_rev = @LLVM_APPEND_VC_REV@
|
||||
config.force_vc_rev = "@LLVM_FORCE_VC_REVISION@"
|
||||
config.has_logf128 = @LLVM_HAS_LOGF128@
|
||||
|
||||
import lit.llvm
|
||||
lit.llvm.initialize(lit_config, config)
|
||||
|
@ -80,11 +80,5 @@ if(NOT WIN32)
|
||||
export_executable_symbols_for_plugins(AnalysisTests)
|
||||
endif()
|
||||
|
||||
include(CheckCXXSymbolExists)
|
||||
check_cxx_symbol_exists(logf128 math.h HAS_LOGF128)
|
||||
if(HAS_LOGF128)
|
||||
target_compile_definitions(AnalysisTests PRIVATE HAS_LOGF128)
|
||||
endif()
|
||||
|
||||
add_subdirectory(InlineAdvisorPlugin)
|
||||
add_subdirectory(InlineOrderPlugin)
|
||||
|
Loading…
x
Reference in New Issue
Block a user