-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[Analysis] Guard logf128 cst folding #106543
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
Conversation
LLVM has a CMake variable to control whether to consider logf128 constant folding which libAnalysis ignores. This patch changes the logf128 check to rely on the global LLVM_HAS_LOGF128 setting made in config-ix.cmake.
@llvm/pr-subscribers-llvm-analysis Author: Thomas Preud'homme (RoboTux) ChangesLLVM has a CMake variable to control whether to consider logf128 Full diff: https://github.com/llvm/llvm-project/pull/106543.diff 1 Files Affected:
diff --git a/llvm/lib/Analysis/CMakeLists.txt b/llvm/lib/Analysis/CMakeLists.txt
index 393803fad89383..99ce0acdabe1ba 100644
--- a/llvm/lib/Analysis/CMakeLists.txt
+++ b/llvm/lib/Analysis/CMakeLists.txt
@@ -163,8 +163,6 @@ add_llvm_component_library(LLVMAnalysis
TargetParser
)
-include(CheckCXXSymbolExists)
-check_cxx_symbol_exists(logf128 math.h HAS_LOGF128)
-if(HAS_LOGF128)
- target_compile_definitions(LLVMAnalysis PRIVATE HAS_LOGF128)
+if(LLVM_HAS_LOGF128)
+ target_compile_definitions(LLVMAnalysis PRIVATE HAS_LOGF128)
endif()
|
https://github.com/llvm/llvm-project/pull/104929/files#diff-84188b049af70f6ebc0b5a2aaa6287b2f84ca5486daa30efd18fe91140cda48c, which removes the check/target definition in Analysis completely and instead uses the more generic |
My usecase is a bit atypical in that I run CMake on one machine and build on another so it's useful for me to be able to disable features that rely on headers not available widely (in this case via LLVM_HAS_LOGF128 set to OFF). I do this because the system where I build doesn't have CMake support but as I said, I realize it's atypical though. I've left a comment about using llvm/Config/config.h.cmake which is easier for us to override and would make it more consistent with other checks of system features. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left a comment on #104929 about planning to use an opt-out cmake define. I'm happy for this change to go upstream before that potentially happens though.
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/66/builds/3218 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/108/builds/3064 Here is the relevant piece of the build log for the reference
|
I've reverted it because some tests were failing. I guess that makes sense because since LLVM_HAS_LOGF128 is OFF by default hence the test would be failing. It'll need a REQUIRE. |
…500ed5225 Local branch amd-gfx e18500e Merged main:73ef397fcba35b7b4239c00bf3e0b4e689ca0add into amd-gfx:fd70dbf23e48 Remote branch main 56152fa [Analysis] Guard logf128 cst folding (llvm#106543)
LLVM has a CMake variable to control whether to consider logf128
constant folding which libAnalysis ignores. This patch changes the
logf128 check to rely on the global LLVM_HAS_LOGF128 setting made in
config-ix.cmake.