Skip to content

[llvm-(min-)tblgen] Avoid redundant source compilation #114494

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 10 commits into from
Jan 2, 2025

Conversation

Meinersbur
Copy link
Member

@Meinersbur Meinersbur commented Nov 1, 2024

All the sources of llvm-min-tblgen are also used for llvm-tblgen, with identical compilation flags. Reuse the object files of llvm-min-tblgen for llvm-tblgen by applying the usual source structure of an executable: One file per executable which named after the executable name containing the (in this case trivial) main function, which just calls the tblgen_main in TableGen.cpp. This should also clear up any confusion (including mine) of where each executable's main function is.

While this slightly reduces build time, the main motivation is ccache. Using the hard_link option, building the object files for llvm-tblgen will result in a hard link to the same object file already used for llvm-min-tblgen. To signal the build system that the file is new, ccache will update the file's time stamp. Unfortunately, time stamps are shared between all hard-linked files s.t. this will indirectly also update the time stamps for the object files used for llvm-tblgen. At the next run, Ninja will recognize this time stamp discrepancy to the expected stamp recorded in .ninja_log and rebuild those object files for llvm-min-tblgen, which again will also update the stamp for the llvm-tblgen... . This is especially annoying for tablegen because it means Ninja will re-run all tablegenning in every build.

I am using the hard_link option because it reduces the cost of having multiple build-trees of the LLVM sources and reduces the wear to the SSD they are stored on.

@Meinersbur
Copy link
Member Author

Build failure is unrelated: lldb-api :: tools/lldb-dap/evaluate/TestDAP_evaluate.py

@Meinersbur Meinersbur marked this pull request as ready for review November 1, 2024 12:08
@llvmbot
Copy link
Member

llvmbot commented Nov 1, 2024

@llvm/pr-subscribers-backend-risc-v

@llvm/pr-subscribers-tablegen

Author: Michael Kruse (Meinersbur)

Changes

All the sources of llvm-min-tblgen are also used for llvm-tblgen, with identical compilation flags. Reuse the object files of llvm-min-tblgen for llvm-tblgen.

While this slightly reduces build time, the main motivation is ccache. Using the hard_link option, building the object files for llvm-tblgen will result in a hard link to the same object file already used for llvm-min-tblgen. To signal the build system that the file is new, ccache will update the file's time stamp. Unfortunately, time stamps a shared between all hard-linked file s.t. this will also update the time stamps for the object files used for llvm-min-tblgen. At the next run, Ninja will recognize this time stamp discrepancy to the expected stamp recorded in .ninja_log and rebuild those object files for llvm-min-tblgen, which again will also update the stamp for the llvm-min-tblgen... . This is especially annoying for llvm-(min)-tablegen because it means Ninja will rerun all tablegenning in every build.

I am using the hard_link option because it reduces the cost of having multiple build-trees of the same LLVM source tree and reduces the wear to the SSD they are stored on.


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

1 Files Affected:

  • (modified) llvm/utils/TableGen/CMakeLists.txt (+2-7)
diff --git a/llvm/utils/TableGen/CMakeLists.txt b/llvm/utils/TableGen/CMakeLists.txt
index ba1e4aa01b48d6..ded2e228dcd6de 100644
--- a/llvm/utils/TableGen/CMakeLists.txt
+++ b/llvm/utils/TableGen/CMakeLists.txt
@@ -32,10 +32,8 @@ set(LLVM_LINK_COMPONENTS
 add_tablegen(llvm-tblgen LLVM
   DESTINATION "${LLVM_TOOLS_INSTALL_DIR}"
   EXPORT LLVM
-  ARMTargetDefEmitter.cpp
   AsmMatcherEmitter.cpp
   AsmWriterEmitter.cpp
-  Attributes.cpp
   CallingConvEmitter.cpp
   CodeEmitterGen.cpp
   CodeGenMapTable.cpp
@@ -48,7 +46,6 @@ add_tablegen(llvm-tblgen LLVM
   DecoderEmitter.cpp
   DFAEmitter.cpp
   DFAPacketizerEmitter.cpp
-  DirectiveEmitter.cpp
   DisassemblerEmitter.cpp
   DXILEmitter.cpp
   ExegesisEmitter.cpp
@@ -57,18 +54,14 @@ add_tablegen(llvm-tblgen LLVM
   GlobalISelEmitter.cpp
   InstrDocsEmitter.cpp
   InstrInfoEmitter.cpp
-  IntrinsicEmitter.cpp
   MacroFusionPredicatorEmitter.cpp
   OptionParserEmitter.cpp
   OptionRSTEmitter.cpp
   PseudoLoweringEmitter.cpp
   RegisterBankEmitter.cpp
   RegisterInfoEmitter.cpp
-  RISCVTargetDefEmitter.cpp
   SearchableTableEmitter.cpp
   SubtargetEmitter.cpp
-  TableGen.cpp
-  VTEmitter.cpp
   WebAssemblyDisassemblerEmitter.cpp
   X86InstrMappingEmitter.cpp
   X86DisassemblerTables.cpp
@@ -76,6 +69,8 @@ add_tablegen(llvm-tblgen LLVM
   X86MnemonicTables.cpp
   X86ModRMFilters.cpp
   X86RecognizableInstr.cpp
+
+  $<TARGET_OBJECTS:llvm-min-tblgen>
   $<TARGET_OBJECTS:obj.LLVMTableGenBasic>
   $<TARGET_OBJECTS:obj.LLVMTableGenCommon>
 

@chapuni chapuni requested a review from Pierre-vh November 1, 2024 12:28
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.

Thanks for the information.

Looks like #80847 rewound my change.
@Pierre-vh Sorry I was not aware of changes in my review.

WebAssemblyDisassemblerEmitter.cpp
X86InstrMappingEmitter.cpp
X86DisassemblerTables.cpp
X86FoldTablesEmitter.cpp
X86MnemonicTables.cpp
X86ModRMFilters.cpp
X86RecognizableInstr.cpp

$<TARGET_OBJECTS:llvm-min-tblgen>
Copy link
Contributor

Choose a reason for hiding this comment

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

It wouldn't work. Look into 137d803.
Restoring part of 137d803 may be an option.

Copy link
Member Author

@Meinersbur Meinersbur Nov 1, 2024

Choose a reason for hiding this comment

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

In a35bd89 I created another OBJECT library. Do you think it should be merge into TableGenBasic?

Copy link
Member Author

@Meinersbur Meinersbur Nov 4, 2024

Choose a reason for hiding this comment

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

If the latter, should the "both" files moved into the Basic/ subdir?

Copy link

github-actions bot commented Nov 4, 2024

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff dd30aa83aa12e5b2b5e58cb72ec85070f725df34 a1849e68b304738573ffb5f828a8e1aa121596e4 --extensions h,cpp -- llvm/utils/TableGen/Basic/TableGen.h llvm/utils/TableGen/llvm-min-tblgen.cpp llvm/utils/TableGen/llvm-tblgen.cpp llvm/utils/TableGen/Basic/ARMTargetDefEmitter.cpp llvm/utils/TableGen/Basic/Attributes.cpp llvm/utils/TableGen/Basic/DirectiveEmitter.cpp llvm/utils/TableGen/Basic/IntrinsicEmitter.cpp llvm/utils/TableGen/Basic/RISCVTargetDefEmitter.cpp llvm/utils/TableGen/Basic/TableGen.cpp llvm/utils/TableGen/Basic/VTEmitter.cpp
View the diff from clang-format here.
diff --git a/llvm/utils/TableGen/Basic/ARMTargetDefEmitter.cpp b/llvm/utils/TableGen/Basic/ARMTargetDefEmitter.cpp
index 3b02f63e94..d4aa1bcf4e 100644
--- a/llvm/utils/TableGen/Basic/ARMTargetDefEmitter.cpp
+++ b/llvm/utils/TableGen/Basic/ARMTargetDefEmitter.cpp
@@ -275,14 +275,15 @@ static void emitARMTargetDef(const RecordKeeper &RK, raw_ostream &OS) {
     auto Name = Rec->getValueAsString("Name");
     auto Alias = Rec->getValueAsString("Alias");
     if (!Processors.contains(Alias))
-      PrintFatalError(
-          Rec, "Alias '" + Name + "' references a non-existent ProcessorModel '" + Alias + "'");
+      PrintFatalError(Rec, "Alias '" + Name +
+                               "' references a non-existent ProcessorModel '" +
+                               Alias + "'");
     if (Processors.contains(Name))
-      PrintFatalError(
-          Rec, "Alias '" + Name + "' duplicates an existing ProcessorModel");
+      PrintFatalError(Rec, "Alias '" + Name +
+                               "' duplicates an existing ProcessorModel");
     if (!Aliases.insert(Name).second)
-      PrintFatalError(
-          Rec, "Alias '" + Name + "' duplicates an existing ProcessorAlias");
+      PrintFatalError(Rec, "Alias '" + Name +
+                               "' duplicates an existing ProcessorAlias");
 
     OS << llvm::formatv(R"(  { "{0}", "{1}" },)", Name, Alias) << '\n';
   }
diff --git a/llvm/utils/TableGen/Basic/VTEmitter.cpp b/llvm/utils/TableGen/Basic/VTEmitter.cpp
index d02932dd5e..3b0809441a 100644
--- a/llvm/utils/TableGen/Basic/VTEmitter.cpp
+++ b/llvm/utils/TableGen/Basic/VTEmitter.cpp
@@ -131,7 +131,7 @@ void VTEmitter::run(raw_ostream &OS) {
     bool IsScalable = VT->getValueAsBit("isScalable");
     bool IsRISCVVecTuple = VT->getValueAsBit("isRISCVVecTuple");
     int64_t NF = VT->getValueAsInt("NF");
-    bool IsNormalValueType =  VT->getValueAsBit("isNormalValueType");
+    bool IsNormalValueType = VT->getValueAsBit("isNormalValueType");
     int64_t NElem = IsVector ? VT->getValueAsInt("nElem") : 0;
     StringRef EltName = IsVector ? VT->getValueAsDef("ElementType")->getName()
                                  : "INVALID_SIMPLE_VALUE_TYPE";

@Meinersbur
Copy link
Member Author

@chapuni ping

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.

Almost good. Please make sure merging onto main before committing.

SDNodeProperties.cpp
TableGen.cpp
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest TableGen.cpp may be individual. IIRC, some cmake generators don't like add_executable w/o any source files.

Copy link
Member Author

@Meinersbur Meinersbur Dec 16, 2024

Choose a reason for hiding this comment

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

CMake has a problem to identify which linker to use (C or C++) when there is no .c/.cpp file in the list. A strategy used elsewhere also in LLVM adds an empty dummy.cpp into the list.

Keeping TableGen.cpp (or using the same dummy.cpp) in both executables would defeat the entire purpose of this patch: The same timestamp issue still occurs with even just a single file which causes all .td files to be processed again in a no-change build (see summary).

I instead applied the usual source structure of an executable: One file per executable which named after the executable name containing the (in this case trivial) main function, which just calls the tblgen_main in TableGen.cpp. This should also clear up any confusion (including mine) of where each executable's main function is.

@Meinersbur Meinersbur requested a review from chapuni December 16, 2024 10:34
IntrinsicEmitter.cpp
RISCVTargetDefEmitter.cpp
VTEmitter.cpp
llvm-min-tblgen.cpp
Copy link
Contributor

Choose a reason for hiding this comment

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

Meant, one TableGen.cpp for multiple instances. I don't think we need to create copied files.

PARTIAL_SOURCES_INTENDED will accept duplicates.

Copy link
Member Author

@Meinersbur Meinersbur Dec 16, 2024

Choose a reason for hiding this comment

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

Please read #114494 (comment) for why not. The duplicate is the exactly the problem this PR intends to solve, even if PARTIAL_SOURCES_INTENDED accepts it.

@@ -79,6 +70,8 @@ add_tablegen(llvm-tblgen LLVM
$<TARGET_OBJECTS:obj.LLVMTableGenBasic>
$<TARGET_OBJECTS:obj.LLVMTableGenCommon>

PARTIAL_SOURCES_INTENDED
Copy link
Contributor

Choose a reason for hiding this comment

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

It may be pruned.

@Meinersbur
Copy link
Member Author

Almost good. Please make sure merging onto main before committing.

Any change in a moved/renamed file shows up in a conflict in GitHub, even if nothing in the moved file was changed, so a new conflict showing up between push and reviews is very likely. When merging main, git recogizes the renamed and automatically applies any upstream changes to the new location. GitHub's auto-merge UI does not.

This is also the reason why the code_formatter bot does not pass: it wants to reformat the moved files entirely. If we want them to be formatted, it should be done in a separate "format code" patch. Doing it here would cause actual merge conflicts with the formatted/moved and unformated/original files.

@Meinersbur
Copy link
Member Author

@chapuni You already LGTM'ed this PR and did not revoke it after the edit, so I am assuming you are still OK with it (there are no copied files, but two new boilerplate ones that in the future may diverge when adding new features to only one of them). So I will push this at the end of this week. It would still be good if you explicitly OK's this change.

@chapuni chapuni self-requested a review December 20, 2024 11:01
@chapuni
Copy link
Contributor

chapuni commented Dec 20, 2024

I don't have strong opinions of this. I misunderstood this as reduction of duplications.

I think this is the issue in ccache. That said, I don't think I should stop this.
Please wait for other opinions.

@Meinersbur
Copy link
Member Author

I think this is the issue in ccache.

Independent of whether there is an issue with ccache, compiling any file twice is redundant work that should not happen in a well-designed build system.

@Meinersbur Meinersbur merged commit f6cb569 into llvm:main Jan 2, 2025
7 of 8 checks passed
@Meinersbur Meinersbur deleted the llvm_tblgen_both branch January 2, 2025 22:22
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 2, 2025

LLVM Buildbot has detected a new failure on builder flang-aarch64-libcxx running on linaro-flang-aarch64-libcxx while building llvm at step 5 "build-unified-tree".

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

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
7.117 [6625/9/668] Copying clang's hresetintrin.h...
7.118 [6625/8/669] Copying clang's ia32intrin.h...
7.118 [6625/7/670] Copying clang's immintrin.h...
7.118 [6625/6/671] Copying clang's invpcidintrin.h...
7.118 [6625/5/672] Copying clang's keylockerintrin.h...
7.119 [6625/4/673] Copying clang's lwpintrin.h...
7.119 [6625/3/674] Copying clang's lzcntintrin.h...
7.119 [6625/2/675] Copying clang's mm3dnow.h...
7.119 [6625/1/676] Copying clang's mmintrin.h...
7.172 [6624/1/677] Linking CXX executable bin/llvm-min-tblgen
FAILED: bin/llvm-min-tblgen 
: && /usr/local/bin/c++ -stdlib=libc++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -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 -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -stdlib=libc++     -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-libcxx/build/./lib  -Wl,--gc-sections utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/Attributes.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/CodeGenIntrinsics.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/DirectiveEmitter.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/IntrinsicEmitter.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/RISCVTargetDefEmitter.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/SDNodeProperties.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/TableGen.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/VTEmitter.cpp.o utils/TableGen/CMakeFiles/llvm-min-tblgen.dir/llvm-min-tblgen.cpp.o -o bin/llvm-min-tblgen  -Wl,-rpath,"\$ORIGIN/../lib:/home/tcwg-buildbot/worker/flang-aarch64-libcxx/build/lib"  lib/libLLVMTableGen.so.20.0git  -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-libcxx/build/lib && :
/usr/bin/ld: utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o: undefined reference to symbol '_ZN4llvm23EnableABIBreakingChecksE'
/usr/bin/ld: /home/tcwg-buildbot/worker/flang-aarch64-libcxx/build/./lib/libLLVMSupport.so.20.0git: error adding symbols: DSO missing from command line
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 2, 2025

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

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

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
2.805 [2374/8/316] Building CXX object utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/Attributes.cpp.o
2.860 [2374/7/317] Building CXX object utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/TableGen.cpp.o
2.949 [2374/6/318] Building CXX object utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/VTEmitter.cpp.o
3.377 [2374/5/319] Building CXX object utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/RISCVTargetDefEmitter.cpp.o
4.340 [2374/4/320] Building CXX object utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o
4.644 [2374/3/321] Building CXX object utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/DirectiveEmitter.cpp.o
6.222 [2374/2/322] Building CXX object utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/IntrinsicEmitter.cpp.o
6.302 [2372/3/323] Linking CXX shared library lib/libLLVMTableGenBasic.so.20.0git
6.323 [2371/3/324] Creating library symlink lib/libLLVMTableGenBasic.so
6.351 [2371/2/325] Linking CXX executable bin/llvm-min-tblgen
FAILED: bin/llvm-min-tblgen 
: && /usr/bin/c++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -fuse-ld=gold     -Wl,--gc-sections utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/Attributes.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/CodeGenIntrinsics.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/DirectiveEmitter.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/IntrinsicEmitter.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/RISCVTargetDefEmitter.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/SDNodeProperties.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/TableGen.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/VTEmitter.cpp.o utils/TableGen/CMakeFiles/llvm-min-tblgen.dir/llvm-min-tblgen.cpp.o -o bin/llvm-min-tblgen  -Wl,-rpath,"\$ORIGIN/../lib:/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/lib"  lib/libLLVMTableGen.so.20.0git  -Wl,-rpath-link,/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/lib && :
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function llvm::support::detail::provider_format_adapter<llvm::StringRef&>::~provider_format_adapter(): error: undefined reference to 'vtable for llvm::support::detail::format_adapter'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function llvm::support::detail::provider_format_adapter<llvm::StringRef&>::~provider_format_adapter(): error: undefined reference to 'vtable for llvm::support::detail::format_adapter'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function llvm::support::detail::provider_format_adapter<llvm::StringRef&>::format(llvm::raw_ostream&, llvm::StringRef): error: undefined reference to 'llvm::getAsUnsignedInteger(llvm::StringRef, unsigned int, unsigned long long&)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function llvm::support::detail::provider_format_adapter<llvm::StringRef&>::format(llvm::raw_ostream&, llvm::StringRef): error: undefined reference to 'llvm::raw_ostream::write(char const*, unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function llvm::raw_ostream::operator<<(llvm::StringRef): error: undefined reference to 'llvm::raw_ostream::write(char const*, unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function llvm::raw_ostream::operator<<(char const*): error: undefined reference to 'llvm::raw_ostream::write(char const*, unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function llvm::StringMap<std::nullopt_t, llvm::MallocAllocator>::~StringMap(): error: undefined reference to 'llvm::deallocate_buffer(void*, unsigned long, unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function bool llvm::DenseMapBase<llvm::DenseMap<llvm::StringRef, llvm::Record const*, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, llvm::Record const*> >, llvm::StringRef, llvm::Record const*, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, llvm::Record const*> >::LookupBucketFor<llvm::StringRef>(llvm::StringRef const&, llvm::detail::DenseMapPair<llvm::StringRef, llvm::Record const*>*&): error: undefined reference to 'llvm::DenseMapInfo<llvm::StringRef, void>::getHashValue(llvm::StringRef)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&)::{lambda(int, int, llvm::StringRef)#3}::operator()(int, int, llvm::StringRef) const [clone .constprop.0]: error: undefined reference to 'llvm::StringRef::upper[abi:cxx11]() const'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&)::{lambda(int, int, llvm::StringRef)#3}::operator()(int, int, llvm::StringRef) const [clone .constprop.0]: error: undefined reference to 'llvm::StringRef::upper[abi:cxx11]() const'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function llvm::DenseMap<llvm::StringRef, llvm::Record const*, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, llvm::Record const*> >::grow(unsigned int): error: undefined reference to 'llvm::allocate_buffer(unsigned long, unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function llvm::DenseMap<llvm::StringRef, llvm::Record const*, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, llvm::Record const*> >::grow(unsigned int): error: undefined reference to 'llvm::DenseMapInfo<llvm::StringRef, void>::getHashValue(llvm::StringRef)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function llvm::DenseMap<llvm::StringRef, llvm::Record const*, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, llvm::Record const*> >::grow(unsigned int): error: undefined reference to 'llvm::deallocate_buffer(void*, unsigned long, unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::StringMapImpl::hash(llvm::StringRef)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::StringMapImpl::LookupBucketFor(llvm::StringRef, unsigned int)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::allocate_buffer(unsigned long, unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::StringMapImpl::RehashTable(unsigned int)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::StringMapImpl::hash(llvm::StringRef)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::StringMapImpl::LookupBucketFor(llvm::StringRef, unsigned int)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::allocate_buffer(unsigned long, unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::StringMapImpl::RehashTable(unsigned int)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::deallocate_buffer(void*, unsigned long, unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::raw_ostream::write(char const*, unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::StringRef::upper[abi:cxx11]() const'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::StringRef::upper[abi:cxx11]() const'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::raw_ostream::operator<<(unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::raw_ostream::operator<<(unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::raw_ostream::operator<<(llvm::format_object_base const&)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::raw_ostream::operator<<(llvm::format_object_base const&)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::raw_ostream::operator<<(llvm::format_object_base const&)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::raw_ostream::operator<<(unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::StringMapImpl::hash(llvm::StringRef)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::StringMapImpl::LookupBucketFor(llvm::StringRef, unsigned int)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::allocate_buffer(unsigned long, unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::StringMapImpl::RehashTable(unsigned int)'

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 2, 2025

LLVM Buildbot has detected a new failure on builder flang-aarch64-latest-gcc running on linaro-flang-aarch64-latest-gcc while building llvm at step 5 "build-unified-tree".

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

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
7.599 [6573/9/736] Copying clang's vadefs.h...
7.602 [6573/8/737] Copying clang's yvals_core.h...
7.603 [6573/7/738] Copying clang's mm_malloc.h...
7.607 [6573/6/739] Copying clang's cuda_wrappers/bits/shared_ptr_base.h...
7.607 [6573/5/740] Copying clang's cuda_wrappers/complex...
7.608 [6573/4/741] Copying clang's cuda_wrappers/new...
7.608 [6573/3/742] Copying clang's cuda_wrappers/algorithm...
7.619 [6573/2/743] Copying clang's cuda_wrappers/cmath...
7.766 [6573/1/744] Building CXX object utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/IntrinsicEmitter.cpp.o
7.893 [6572/1/745] Linking CXX executable bin/llvm-min-tblgen
FAILED: bin/llvm-min-tblgen 
: && /usr/local/bin/c++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/./lib  -Wl,--gc-sections utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/Attributes.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/CodeGenIntrinsics.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/DirectiveEmitter.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/IntrinsicEmitter.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/RISCVTargetDefEmitter.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/SDNodeProperties.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/TableGen.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/VTEmitter.cpp.o utils/TableGen/CMakeFiles/llvm-min-tblgen.dir/llvm-min-tblgen.cpp.o -o bin/llvm-min-tblgen  -Wl,-rpath,"\$ORIGIN/../lib:/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/lib"  lib/libLLVMTableGen.so.20.0git  -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/lib && :
/usr/bin/ld: utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o: undefined reference to symbol '_ZN4llvm23EnableABIBreakingChecksE'
/usr/bin/ld: /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/./lib/libLLVMSupport.so.20.0git: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 2, 2025

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

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

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
2.829 [2374/8/316] Building CXX object utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/Attributes.cpp.o
2.887 [2374/7/317] Building CXX object utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/TableGen.cpp.o
2.979 [2374/6/318] Building CXX object utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/VTEmitter.cpp.o
3.518 [2374/5/319] Building CXX object utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/RISCVTargetDefEmitter.cpp.o
3.807 [2374/4/320] Building CXX object utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o
5.292 [2374/3/321] Building CXX object utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/IntrinsicEmitter.cpp.o
5.798 [2374/2/322] Building CXX object utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/DirectiveEmitter.cpp.o
5.881 [2372/3/323] Linking CXX shared library lib/libLLVMTableGenBasic.so.20.0git
5.901 [2371/3/324] Creating library symlink lib/libLLVMTableGenBasic.so
5.930 [2371/2/325] Linking CXX executable bin/llvm-min-tblgen
FAILED: bin/llvm-min-tblgen 
: && /usr/bin/c++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -fuse-ld=gold     -Wl,--gc-sections utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/Attributes.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/CodeGenIntrinsics.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/DirectiveEmitter.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/IntrinsicEmitter.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/RISCVTargetDefEmitter.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/SDNodeProperties.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/TableGen.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/VTEmitter.cpp.o utils/TableGen/CMakeFiles/llvm-min-tblgen.dir/llvm-min-tblgen.cpp.o -o bin/llvm-min-tblgen  -Wl,-rpath,"\$ORIGIN/../lib:/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/build/lib"  lib/libLLVMTableGen.so.20.0git  -Wl,-rpath-link,/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/build/lib && :
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function llvm::support::detail::provider_format_adapter<llvm::StringRef&>::~provider_format_adapter(): error: undefined reference to 'vtable for llvm::support::detail::format_adapter'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function llvm::support::detail::provider_format_adapter<llvm::StringRef&>::~provider_format_adapter(): error: undefined reference to 'vtable for llvm::support::detail::format_adapter'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function llvm::support::detail::provider_format_adapter<llvm::StringRef&>::format(llvm::raw_ostream&, llvm::StringRef): error: undefined reference to 'llvm::getAsUnsignedInteger(llvm::StringRef, unsigned int, unsigned long long&)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function llvm::support::detail::provider_format_adapter<llvm::StringRef&>::format(llvm::raw_ostream&, llvm::StringRef): error: undefined reference to 'llvm::raw_ostream::write(char const*, unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function llvm::raw_ostream::operator<<(llvm::StringRef): error: undefined reference to 'llvm::raw_ostream::write(char const*, unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function llvm::raw_ostream::operator<<(char const*): error: undefined reference to 'llvm::raw_ostream::write(char const*, unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function llvm::StringMap<std::nullopt_t, llvm::MallocAllocator>::~StringMap(): error: undefined reference to 'llvm::deallocate_buffer(void*, unsigned long, unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function bool llvm::DenseMapBase<llvm::DenseMap<llvm::StringRef, llvm::Record const*, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, llvm::Record const*> >, llvm::StringRef, llvm::Record const*, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, llvm::Record const*> >::LookupBucketFor<llvm::StringRef>(llvm::StringRef const&, llvm::detail::DenseMapPair<llvm::StringRef, llvm::Record const*>*&): error: undefined reference to 'llvm::DenseMapInfo<llvm::StringRef, void>::getHashValue(llvm::StringRef)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&)::{lambda(int, int, llvm::StringRef)#3}::operator()(int, int, llvm::StringRef) const [clone .constprop.0]: error: undefined reference to 'llvm::StringRef::upper[abi:cxx11]() const'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&)::{lambda(int, int, llvm::StringRef)#3}::operator()(int, int, llvm::StringRef) const [clone .constprop.0]: error: undefined reference to 'llvm::StringRef::upper[abi:cxx11]() const'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function llvm::DenseMap<llvm::StringRef, llvm::Record const*, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, llvm::Record const*> >::grow(unsigned int): error: undefined reference to 'llvm::allocate_buffer(unsigned long, unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function llvm::DenseMap<llvm::StringRef, llvm::Record const*, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, llvm::Record const*> >::grow(unsigned int): error: undefined reference to 'llvm::DenseMapInfo<llvm::StringRef, void>::getHashValue(llvm::StringRef)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function llvm::DenseMap<llvm::StringRef, llvm::Record const*, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, llvm::Record const*> >::grow(unsigned int): error: undefined reference to 'llvm::deallocate_buffer(void*, unsigned long, unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::StringMapImpl::hash(llvm::StringRef)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::StringMapImpl::LookupBucketFor(llvm::StringRef, unsigned int)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::allocate_buffer(unsigned long, unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::StringMapImpl::RehashTable(unsigned int)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::StringMapImpl::hash(llvm::StringRef)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::StringMapImpl::LookupBucketFor(llvm::StringRef, unsigned int)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::allocate_buffer(unsigned long, unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::StringMapImpl::RehashTable(unsigned int)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::deallocate_buffer(void*, unsigned long, unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::raw_ostream::write(char const*, unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::StringRef::upper[abi:cxx11]() const'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::StringRef::upper[abi:cxx11]() const'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::raw_ostream::operator<<(unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::raw_ostream::operator<<(unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::raw_ostream::operator<<(llvm::format_object_base const&)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::raw_ostream::operator<<(llvm::format_object_base const&)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::raw_ostream::operator<<(llvm::format_object_base const&)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::raw_ostream::operator<<(unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::StringMapImpl::hash(llvm::StringRef)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::StringMapImpl::LookupBucketFor(llvm::StringRef, unsigned int)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::allocate_buffer(unsigned long, unsigned long)'
utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:ARMTargetDefEmitter.cpp:function emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&): error: undefined reference to 'llvm::StringMapImpl::RehashTable(unsigned int)'

Meinersbur added a commit that referenced this pull request Jan 2, 2025
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 2, 2025

LLVM Buildbot has detected a new failure on builder mlir-nvidia running on mlir-nvidia while building llvm at step 6 "build-check-mlir-build-only".

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

Here is the relevant piece of the build log for the reference
Step 6 (build-check-mlir-build-only) failure: build (failure)
...
0.829 [4617/9/428] Copying python source /vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/python/mlir/dialects/python_test.py -> /vol/worker/mlir-nvidia/mlir-nvidia/llvm.obj/tools/mlir/python_packages/mlir_core/mlir/dialects/python_test.py
0.839 [4617/8/429] Linking CXX static library lib/libMLIRTblgenLib.a
2.088 [4617/7/430] Building CXX object utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/Attributes.cpp.o
2.113 [4617/6/431] Building CXX object utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/VTEmitter.cpp.o
2.119 [4617/5/432] Building CXX object utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/TableGen.cpp.o
2.572 [4617/4/433] Building CXX object utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/RISCVTargetDefEmitter.cpp.o
2.937 [4617/3/434] Building CXX object utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o
4.707 [4617/2/435] Building CXX object utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/IntrinsicEmitter.cpp.o
5.054 [4617/1/436] Building CXX object utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/DirectiveEmitter.cpp.o
5.126 [4616/1/437] Linking CXX executable bin/llvm-min-tblgen
FAILED: bin/llvm-min-tblgen 
: && /usr/bin/clang++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -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 -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -fuse-ld=lld -Wl,--color-diagnostics     -Wl,--gc-sections utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/Attributes.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/CodeGenIntrinsics.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/DirectiveEmitter.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/IntrinsicEmitter.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/RISCVTargetDefEmitter.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/SDNodeProperties.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/TableGen.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/VTEmitter.cpp.o utils/TableGen/CMakeFiles/llvm-min-tblgen.dir/llvm-min-tblgen.cpp.o -o bin/llvm-min-tblgen  -Wl,-rpath,"\$ORIGIN/../lib:/vol/worker/mlir-nvidia/mlir-nvidia/llvm.obj/lib"  lib/libLLVMTableGen.so.20.0git  -Wl,-rpath-link,/vol/worker/mlir-nvidia/mlir-nvidia/llvm.obj/lib && :
ld.lld: error: undefined symbol: llvm::raw_ostream::write(char const*, unsigned long)
>>> referenced by ARMTargetDefEmitter.cpp
>>>               utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:(emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&))
>>> referenced by ARMTargetDefEmitter.cpp
>>>               utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:(emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&))
>>> referenced by ARMTargetDefEmitter.cpp
>>>               utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:(emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&))
>>> referenced 1019 more times

ld.lld: error: undefined symbol: llvm::StringMapImpl::hash(llvm::StringRef)
>>> referenced by ARMTargetDefEmitter.cpp
>>>               utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:(emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&))
>>> referenced by ARMTargetDefEmitter.cpp
>>>               utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:(emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&))
>>> referenced by ARMTargetDefEmitter.cpp
>>>               utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:(emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&))
>>> referenced 11 more times

ld.lld: error: undefined symbol: llvm::StringRef::upper[abi:cxx11]() const
>>> referenced by ARMTargetDefEmitter.cpp
>>>               utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:(emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&))
>>> referenced by ARMTargetDefEmitter.cpp
>>>               utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:(emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&))
>>> referenced by ARMTargetDefEmitter.cpp
>>>               utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:(emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&))
>>> referenced 12 more times

ld.lld: error: undefined symbol: llvm::raw_ostream::operator<<(unsigned long)
>>> referenced by ARMTargetDefEmitter.cpp
>>>               utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:(emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&))
>>> referenced by ARMTargetDefEmitter.cpp
>>>               utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:(emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&))
>>> referenced by ARMTargetDefEmitter.cpp
>>>               utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o:(emitARMTargetDef(llvm::RecordKeeper const&, llvm::raw_ostream&))
>>> referenced 22 more times

ld.lld: error: undefined symbol: llvm::raw_ostream::operator<<(llvm::format_object_base const&)

Meinersbur added a commit that referenced this pull request Jan 2, 2025
…)"

This reverts commit f6cb569.

Buildbot failures such as https://lab.llvm.org/buildbot/#/builders/89/builds/13541:
```
/usr/bin/ld: utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o: undefined reference to symbol '_ZN4llvm23EnableABIBreakingChecksE'
/usr/bin/ld: /home/tcwg-buildbot/worker/flang-aarch64-libcxx/build/./lib/libLLVMSupport.so.20.0git: error adding symbols: DSO missing from command line
```

Going to investigate.
@Meinersbur Meinersbur restored the llvm_tblgen_both branch January 2, 2025 22:36
Meinersbur added a commit that referenced this pull request Jan 3, 2025
All the sources of `llvm-min-tblgen` are also used for `llvm-tblgen`,
with identical compilation flags. Reuse the object files of
`llvm-min-tblgen` for `llvm-tblgen` by applying the usual source
structure of an executable: One file per executable which named after
the executable name containing the (in this case trivial) main function,
which just calls the tblgen_main in TableGen.cpp. This should also clear
up any confusion (including mine) of where each executable's main
function is.

While this slightly reduces build time, the main motivation is ccache.
Using the hard_link
option, building the object files for `llvm-tblgen` will result in a
hard link to the same object file already used for `llvm-min-tblgen`. To
signal the build system that the file is new, ccache will update the
file's time stamp. Unfortunately, time stamps are shared between all
hard-linked files s.t. this will indirectly also update the time stamps
for the object files used for `llvm-tblgen`. At the next run, Ninja will
recognize this time stamp discrepancy to the expected stamp recorded in
`.ninja_log` and rebuild those object files for `llvm-min-tblgen`, which
again will also update the stamp for the `llvm-tblgen`... . This is
especially annoying for tablegen because it means Ninja will re-run all
tablegenning in every build.

I am using the hard_link option because it reduces the cost of having
multiple build-trees of the LLVM sources and reduces the wear to the SSD
they are stored on.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants