Skip to content

Conversation

@mysterymath
Copy link
Contributor

@mysterymath mysterymath commented Oct 24, 2025

This patch ensures that:

  1. New bitcode is not extracted for libfuncs after LTO occurs, and
  2. Extracted bitcode for libfuncs is considered external, since new
    calls to it may be emitted.

@github-actions
Copy link

github-actions bot commented Oct 24, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@mysterymath mysterymath force-pushed the builtins-world-full branch 2 times, most recently from ca68c17 to 33aa80b Compare November 13, 2025 23:02
@mysterymath mysterymath force-pushed the builtins-world-full branch 3 times, most recently from 071e2cd to 4c644e8 Compare December 9, 2025 00:51
@mysterymath mysterymath changed the title [DRAFT] "Builtins world" for LTO [LTO][LLD] Prevent invalid LTO libfunc transforms Dec 9, 2025
This patch ensures that:
1) New bitcode is not extracted for libfuncs after LTO occurs, and
2) Extracted bitcode for libfuncs is considered external, since new
   calls to it may be emitted.
@github-actions
Copy link

github-actions bot commented Dec 9, 2025

🐧 Linux x64 Test Results

  • 84392 tests passed
  • 1730 tests skipped

All tests passed but another part of the build failed. Click on a failure below to see the details.

tools/clang/lib/CodeGen/CMakeFiles/obj.clangCodeGen.dir/BackendUtil.cpp.o
FAILED: tools/clang/lib/CodeGen/CMakeFiles/obj.clangCodeGen.dir/BackendUtil.cpp.o
sccache /opt/llvm/bin/clang++ -DCLANG_EXPORTS -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/tools/clang/lib/CodeGen -I/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CodeGen -I/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/include -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 -fno-common -Woverloaded-virtual -Wno-nested-anon-types -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/clang/lib/CodeGen/CMakeFiles/obj.clangCodeGen.dir/BackendUtil.cpp.o -MF tools/clang/lib/CodeGen/CMakeFiles/obj.clangCodeGen.dir/BackendUtil.cpp.o.d -o tools/clang/lib/CodeGen/CMakeFiles/obj.clangCodeGen.dir/BackendUtil.cpp.o -c /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CodeGen/BackendUtil.cpp
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CodeGen/BackendUtil.cpp:1446:11: error: no matching function for call to 'thinBackend'
1446 |           thinBackend(Conf, -1, AddStream, *M, *CombinedIndex, ImportList,
|           ^~~~~~~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/LTO/LTOBackend.h:62:1: note: candidate function not viable: no known conversion from 'std::nullptr_t' to 'const SmallVector<StringRef>' for 10th argument
62 | thinBackend(const Config &C, unsigned Task, AddStreamFn AddStream, Module &M,
| ^
63 |             const ModuleSummaryIndex &CombinedIndex,
64 |             const FunctionImporter::ImportMapTy &ImportList,
65 |             const GVSummaryMapTy &DefinedGlobals,
66 |             MapVector<StringRef, BitcodeModule> *ModuleMap, bool CodeGenOnly,
67 |             const SmallVector<StringRef> &BitcodeLibFuncs,
|             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

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.

@github-actions
Copy link

github-actions bot commented Dec 9, 2025

🪟 Windows x64 Test Results

  • 80010 tests passed
  • 1977 tests skipped

All tests passed but another part of the build failed. Click on a failure below to see the details.

[code=1] tools/clang/lib/CodeGen/CMakeFiles/obj.clangCodeGen.dir/BackendUtil.cpp.obj
FAILED: [code=1] tools/clang/lib/CodeGen/CMakeFiles/obj.clangCodeGen.dir/BackendUtil.cpp.obj
sccache C:\clang\clang-msvc\bin\clang-cl.exe  /nologo -TP -DCLANG_BUILD_STATIC -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\clang\lib\CodeGen -IC:\_work\llvm-project\llvm-project\clang\lib\CodeGen -IC:\_work\llvm-project\llvm-project\clang\include -Itools\clang\include -Iinclude -IC:\_work\llvm-project\llvm-project\llvm\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:__cplusplus /Oi /Brepro /bigobj /permissive- -Werror=unguarded-availability-new /W4  -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -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 /Gw /O2 /Ob2  -MD  /EHs-c- /GR- -UNDEBUG -std:c++17 /showIncludes /Fotools\clang\lib\CodeGen\CMakeFiles\obj.clangCodeGen.dir\BackendUtil.cpp.obj /Fdtools\clang\lib\CodeGen\CMakeFiles\obj.clangCodeGen.dir\ -c -- C:\_work\llvm-project\llvm-project\clang\lib\CodeGen\BackendUtil.cpp
C:\_work\llvm-project\llvm-project\clang\lib\CodeGen\BackendUtil.cpp(1446,11): error: no matching function for call to 'thinBackend'
1446 |           thinBackend(Conf, -1, AddStream, *M, *CombinedIndex, ImportList,
|           ^~~~~~~~~~~
C:\_work\llvm-project\llvm-project\llvm\include\llvm/LTO/LTOBackend.h(62,1): note: candidate function not viable: no known conversion from 'std::nullptr_t' to 'const SmallVector<StringRef>' for 10th argument
62 | thinBackend(const Config &C, unsigned Task, AddStreamFn AddStream, Module &M,
| ^
63 |             const ModuleSummaryIndex &CombinedIndex,
64 |             const FunctionImporter::ImportMapTy &ImportList,
65 |             const GVSummaryMapTy &DefinedGlobals,
66 |             MapVector<StringRef, BitcodeModule> *ModuleMap, bool CodeGenOnly,
67 |             const SmallVector<StringRef> &BitcodeLibFuncs,
|             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant