[llvm] [LLVM] Add constant folding for llrint, llrintf, llrintl (PR #154799)

via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 8 04:50:59 PST 2025


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results

The build failed before running any tests. Click on a failure below to see the details.

<details>
<summary>lib/Transforms/Utils/CMakeFiles/LLVMTransformUtils.dir/BuildLibCalls.cpp.o</summary>

```
FAILED: lib/Transforms/Utils/CMakeFiles/LLVMTransformUtils.dir/BuildLibCalls.cpp.o
sccache /opt/llvm/bin/clang++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_USE_CXX11_ABI=1 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/Transforms/Utils -I/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/include -I/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include -gmlt -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT lib/Transforms/Utils/CMakeFiles/LLVMTransformUtils.dir/BuildLibCalls.cpp.o -MF lib/Transforms/Utils/CMakeFiles/LLVMTransformUtils.dir/BuildLibCalls.cpp.o.d -o lib/Transforms/Utils/CMakeFiles/LLVMTransformUtils.dir/BuildLibCalls.cpp.o -c /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/BuildLibCalls.cpp
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/BuildLibCalls.cpp:1364:8: error: use of undeclared identifier 'LibFunc_llrintf'
1364 |   case LibFunc_llrintf:
|        ^~~~~~~~~~~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/BuildLibCalls.cpp:1365:8: error: use of undeclared identifier 'LibFunc_llrintl'; did you mean 'LibFunc_rintl'?
1365 |   case LibFunc_llrintl:
|        ^~~~~~~~~~~~~~~
|        LibFunc_rintl
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/include/llvm/Analysis/TargetLibraryInfo.inc:439:3: note: 'LibFunc_rintl' declared here
439 |   LibFunc_rintl,
|   ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/BuildLibCalls.cpp:1366:8: error: use of undeclared identifier 'LibFunc_llrint'; did you mean 'LibFunc_rint'?
1366 |   case LibFunc_llrint:
|        ^~~~~~~~~~~~~~
|        LibFunc_rint
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/include/llvm/Analysis/TargetLibraryInfo.inc:437:3: note: 'LibFunc_rint' declared here
437 |   LibFunc_rint,
|   ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/BuildLibCalls.cpp:1366:8: error: duplicate case value 'LibFunc_rint'
1366 |   case LibFunc_llrint:
|        ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/BuildLibCalls.cpp:1295:8: note: previous case defined here
1295 |   case LibFunc_rint:
|        ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/BuildLibCalls.cpp:1365:8: error: duplicate case value 'LibFunc_rintl'
1365 |   case LibFunc_llrintl:
|        ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/BuildLibCalls.cpp:1297:8: note: previous case defined here
1297 |   case LibFunc_rintl:
|        ^
5 errors generated.
```
</details>
<details>
<summary>lib/Transforms/Utils/CMakeFiles/LLVMTransformUtils.dir/SimplifyLibCalls.cpp.o</summary>

```
FAILED: lib/Transforms/Utils/CMakeFiles/LLVMTransformUtils.dir/SimplifyLibCalls.cpp.o
sccache /opt/llvm/bin/clang++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_USE_CXX11_ABI=1 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/Transforms/Utils -I/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/include -I/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include -gmlt -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT lib/Transforms/Utils/CMakeFiles/LLVMTransformUtils.dir/SimplifyLibCalls.cpp.o -MF lib/Transforms/Utils/CMakeFiles/LLVMTransformUtils.dir/SimplifyLibCalls.cpp.o.d -o lib/Transforms/Utils/CMakeFiles/LLVMTransformUtils.dir/SimplifyLibCalls.cpp.o -c /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:4111:8: error: use of undeclared identifier 'LibFunc_llrint'; did you mean 'LibFunc_rint'?
4111 |   case LibFunc_llrint:
|        ^~~~~~~~~~~~~~
|        LibFunc_rint
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/include/llvm/Analysis/TargetLibraryInfo.inc:437:3: note: 'LibFunc_rint' declared here
437 |   LibFunc_rint,
|   ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:4119:8: error: duplicate case value 'LibFunc_rint'
4119 |   case LibFunc_rint:
|        ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:4111:8: note: previous case defined here
4111 |   case LibFunc_llrint:
|        ^
2 errors generated.
```
</details>
<details>
<summary>lib/Analysis/CMakeFiles/LLVMAnalysis.dir/ConstantFolding.cpp.o</summary>

```
FAILED: lib/Analysis/CMakeFiles/LLVMAnalysis.dir/ConstantFolding.cpp.o
sccache /opt/llvm/bin/clang++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_USE_CXX11_ABI=1 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/Analysis -I/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/include -I/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include -gmlt -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -ftrapping-math -MD -MT lib/Analysis/CMakeFiles/LLVMAnalysis.dir/ConstantFolding.cpp.o -MF lib/Analysis/CMakeFiles/LLVMAnalysis.dir/ConstantFolding.cpp.o.d -o lib/Analysis/CMakeFiles/LLVMAnalysis.dir/ConstantFolding.cpp.o -c /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis/ConstantFolding.cpp
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis/ConstantFolding.cpp:2970:10: error: use of undeclared identifier 'LibFunc_llrint'; did you mean 'LibFunc_rint'?
2970 |     case LibFunc_llrint:
|          ^~~~~~~~~~~~~~
|          LibFunc_rint
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/include/llvm/Analysis/TargetLibraryInfo.inc:437:3: note: 'LibFunc_rint' declared here
437 |   LibFunc_rint,
|   ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis/ConstantFolding.cpp:2971:10: error: use of undeclared identifier 'LibFunc_llrintf'
2971 |     case LibFunc_llrintf:
|          ^~~~~~~~~~~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis/ConstantFolding.cpp:3026:10: error: duplicate case value 'LibFunc_rint'
3026 |     case LibFunc_rint:
|          ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis/ConstantFolding.cpp:2970:10: note: previous case defined here
2970 |     case LibFunc_llrint:
|          ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis/ConstantFolding.cpp:3199:70: error: function definition is not allowed here
3199 |                                  const ConstrainedFPIntrinsic *Call) {
|                                                                      ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis/ConstantFolding.cpp:3218:69: error: function definition is not allowed here
3218 |                                       const TargetLibraryInfo *TLI) {
|                                                                     ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis/ConstantFolding.cpp:3282:67: error: function definition is not allowed here
3282 |                                             const CallBase *Call) {
|                                                                   ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis/ConstantFolding.cpp:3843:67: error: function definition is not allowed here
3843 |                                                const APFloat &S2) {
|                                                                   ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis/ConstantFolding.cpp:3896:60: error: function definition is not allowed here
3896 |                                                  Type *Ty) {
|                                                            ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis/ConstantFolding.cpp:3940:64: error: function definition is not allowed here
3940 |                                          const CallBase *Call) {
|                                                                ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis/ConstantFolding.cpp:4104:63: error: function definition is not allowed here
4104 |                                         const CallBase *Call) {
|                                                               ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis/ConstantFolding.cpp:4130:57: error: function definition is not allowed here
4130 |     const TargetLibraryInfo *TLI, const CallBase *Call) {
|                                                         ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis/ConstantFolding.cpp:4343:57: error: function definition is not allowed here
4343 |     const TargetLibraryInfo *TLI, const CallBase *Call) {
|                                                         ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis/ConstantFolding.cpp:4405:56: error: function definition is not allowed here
4405 | ConstantFoldScalarFrexpCall(Constant *Op, Type *IntTy) {
|                                                        ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis/ConstantFolding.cpp:4431:46: error: function definition is not allowed here
4431 |                        const CallBase *Call) {
|                                              ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis/ConstantFolding.cpp:4541:17: error: cannot define or redeclare 'ConstantFoldBinaryIntrinsic' here because namespace '' does not enclose namespace 'llvm'
4541 | Constant *llvm::ConstantFoldBinaryIntrinsic(Intrinsic::ID ID, Constant *LHS,
|           ~~~~~~^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis/ConstantFolding.cpp:4549:10: error: use of undeclared identifier 'ConstantFoldIntrinsicCall2'
4549 |   return ConstantFoldIntrinsicCall2(ID, Ty, {LHS, RHS}, Call);
|          ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis/ConstantFolding.cpp:4552:17: error: cannot define or redeclare 'ConstantFoldCall' here because namespace '' does not enclose namespace 'llvm'
4552 | Constant *llvm::ConstantFoldCall(const CallBase *Call, Function *F,
|           ~~~~~~^
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis/ConstantFolding.cpp:4579:12: error: use of undeclared identifier 'ConstantFoldFixedVectorCall'
4579 |     return ConstantFoldFixedVectorCall(
|            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis/ConstantFolding.cpp:4583:12: error: use of undeclared identifier 'ConstantFoldScalableVectorCall'
4583 |     return ConstantFoldScalableVectorCall(
|            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
```
</details>
<details>
<summary>lib/Analysis/CMakeFiles/LLVMAnalysis.dir/TargetLibraryInfo.cpp.o</summary>

```
FAILED: lib/Analysis/CMakeFiles/LLVMAnalysis.dir/TargetLibraryInfo.cpp.o
sccache /opt/llvm/bin/clang++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_USE_CXX11_ABI=1 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/Analysis -I/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/include -I/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include -gmlt -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT lib/Analysis/CMakeFiles/LLVMAnalysis.dir/TargetLibraryInfo.cpp.o -MF lib/Analysis/CMakeFiles/LLVMAnalysis.dir/TargetLibraryInfo.cpp.o.d -o lib/Analysis/CMakeFiles/LLVMAnalysis.dir/TargetLibraryInfo.cpp.o -c /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis/TargetLibraryInfo.cpp
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis/TargetLibraryInfo.cpp:258:24: error: use of undeclared identifier 'LibFunc_llrintf'
258 |       TLI.setAvailable(LibFunc_llrintf);
|                        ^~~~~~~~~~~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis/TargetLibraryInfo.cpp:292:24: error: use of undeclared identifier 'LibFunc_llrintl'; did you mean 'LibFunc_rintl'?
292 |     TLI.setUnavailable(LibFunc_llrintl);
|                        ^~~~~~~~~~~~~~~
|                        LibFunc_rintl
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/include/llvm/Analysis/TargetLibraryInfo.inc:439:3: note: 'LibFunc_rintl' declared here
439 |   LibFunc_rintl,
|   ^
2 errors generated.
```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

https://github.com/llvm/llvm-project/pull/154799


More information about the llvm-commits mailing list