Skip to content

[llvm][EmbedBitcodePass] Pre-commit test for using WPD with FatLTO #139998

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 1 commit into from
May 29, 2025

Conversation

ilovepi
Copy link
Contributor

@ilovepi ilovepi commented May 15, 2025

This is a reduced test case from #139440.

@ilovepi ilovepi requested review from nikic and pcc May 15, 2025 04:07
Copy link
Contributor Author

ilovepi commented May 15, 2025

@llvmbot
Copy link
Member

llvmbot commented May 15, 2025

@llvm/pr-subscribers-llvm-transforms

Author: Paul Kirth (ilovepi)

Changes

This is a reduced test case from #139440.


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

1 Files Affected:

  • (added) llvm/test/Transforms/EmbedBitcode/embed-wpd.ll (+32)
diff --git a/llvm/test/Transforms/EmbedBitcode/embed-wpd.ll b/llvm/test/Transforms/EmbedBitcode/embed-wpd.ll
new file mode 100644
index 0000000000000..f1f7712f54039
--- /dev/null
+++ b/llvm/test/Transforms/EmbedBitcode/embed-wpd.ll
@@ -0,0 +1,32 @@
+; RUN: opt --mtriple x86_64-unknown-linux-gnu < %s -passes="embed-bitcode<thinlto>" -S | FileCheck %s
+
+; CHECK-NOT: $_ZTV3Foo = comdat any
+$_ZTV3Foo = comdat any
+
+$_ZTI3Foo = comdat any
+
+; CHECK: @_ZTV3Foo = external hidden unnamed_addr constant { [5 x ptr] }, align 8
+; CHECK: @_ZTI3Foo = linkonce_odr hidden constant { ptr, ptr, ptr } { ptr getelementptr inbounds (ptr, ptr @_ZTVN10__cxxabiv120__si_class_type_infoE, i64 2), ptr @_ZTS3Foo, ptr @_ZTISt13runtime_error }, comdat, align 8
+; CHECK: @llvm.embedded.object = private constant {{.*}}, section ".llvm.lto", align 1
+; CHECK: @llvm.compiler.used = appending global [1 x ptr] [ptr @llvm.embedded.object], section "llvm.metadata"
+@_ZTV3Foo = linkonce_odr hidden unnamed_addr constant { [5 x ptr] } { [5 x ptr] [ptr null, ptr @_ZTI3Foo, ptr @_ZN3FooD2Ev, ptr @_ZN3FooD0Ev, ptr @_ZNKSt13runtime_error4whatEv] }, comdat, align 8, !type !0, !type !1, !type !2, !type !3, !type !4, !type !5
+@_ZTI3Foo = linkonce_odr hidden constant { ptr, ptr, ptr } { ptr getelementptr inbounds (ptr, ptr @_ZTVN10__cxxabiv120__si_class_type_infoE, i64 2), ptr @_ZTS3Foo, ptr @_ZTISt13runtime_error }, comdat, align 8
+@_ZTVN10__cxxabiv120__si_class_type_infoE = external global [0 x ptr]
+@_ZTS3Foo = constant [5 x i8] c"3Foo\00"
+@_ZTISt13runtime_error = external constant ptr
+
+declare void @_ZN3FooD2Ev()
+
+declare void @_ZN3FooD0Ev()
+
+declare ptr @_ZNKSt13runtime_error4whatEv()
+
+!llvm.module.flags = !{!6}
+
+!0 = !{i64 16, !"_ZTS3Foo"}
+!1 = !{i64 32, !"_ZTSM3FooKDoFPKcvE.virtual"}
+!2 = !{i64 16, !"_ZTSSt13runtime_error"}
+!3 = !{i64 32, !"_ZTSMSt13runtime_errorKDoFPKcvE.virtual"}
+!4 = !{i64 16, !"_ZTSSt9exception"}
+!5 = !{i64 32, !"_ZTSMSt9exceptionKDoFPKcvE.virtual"}
+!6 = !{i32 1, !"EnableSplitLTOUnit", i32 1}

@ilovepi ilovepi force-pushed the users/ilovepi/fatlto-wpd-precommit branch from d287d80 to 4a3148f Compare May 29, 2025 17:22
Copy link
Contributor Author

ilovepi commented May 29, 2025

Merge activity

  • May 29, 5:24 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • May 29, 5:26 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 29, 5:29 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 29, 5:32 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 29, 5:34 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 29, 5:37 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 29, 5:40 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 29, 5:45 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 29, 5:48 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 29, 5:58 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 29, 6:01 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 29, 6:04 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 29, 6:10 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 29, 6:13 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 29, 6:16 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 29, 6:21 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 29, 6:24 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 29, 6:28 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 29, 6:42 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 29, 6:48 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 29, 6:53 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 29, 7:23 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 29, 7:25 PM UTC: Graphite couldn't merge this PR because it was closed.
  • May 29, 8:28 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • May 29, 8:30 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 29, 8:34 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 29, 8:37 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 29, 8:39 PM UTC: @ilovepi merged this pull request with Graphite.

@ilovepi ilovepi force-pushed the users/ilovepi/fatlto-wpd-precommit branch 21 times, most recently from c312044 to 8b47987 Compare May 29, 2025 19:22
@nikic
Copy link
Contributor

nikic commented May 29, 2025

Closing this in hope that it makes Graphite shut up.

@nikic nikic closed this May 29, 2025
@nikic nikic reopened this May 29, 2025
@ilovepi ilovepi force-pushed the users/ilovepi/fatlto-wpd-precommit branch 3 times, most recently from cf9b9be to c1261cc Compare May 29, 2025 20:33
@ilovepi ilovepi force-pushed the users/ilovepi/fatlto-wpd-precommit branch from c1261cc to 1c9cca5 Compare May 29, 2025 20:37
@ilovepi ilovepi merged commit bedbc65 into main May 29, 2025
6 of 9 checks passed
@ilovepi ilovepi deleted the users/ilovepi/fatlto-wpd-precommit branch May 29, 2025 20:39
google-yfyang pushed a commit to google-yfyang/llvm-project that referenced this pull request May 29, 2025
@llvm-ci
Copy link
Collaborator

llvm-ci commented May 30, 2025

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-expensive-checks-debian running on gribozavr4 while building llvm at step 6 "test-build-unified-tree-check-all".

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

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: Transforms/EmbedBitcode/embed-wpd.ll' FAILED ********************
Exit Code: 2

Command Output (stderr):
--
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/opt --mtriple x86_64-unknown-linux-gnu < /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/Transforms/EmbedBitcode/embed-wpd.ll -passes="embed-bitcode<thinlto>" -S | /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/FileCheck /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/Transforms/EmbedBitcode/embed-wpd.ll # RUN: at line 1
+ /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/opt --mtriple x86_64-unknown-linux-gnu '-passes=embed-bitcode<thinlto>' -S
+ /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/FileCheck /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/Transforms/EmbedBitcode/embed-wpd.ll
LLVM ERROR: Module changed by EmbedBitcodePass without invalidating analyses
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/opt --mtriple x86_64-unknown-linux-gnu -passes=embed-bitcode<thinlto> -S
1.	Running pass "embed-bitcode" on module "<stdin>"
 #0 0x0000000004afedf7 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/opt+0x4afedf7)
 #1 0x0000000004afc8ae llvm::sys::RunSignalHandlers() (/b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/opt+0x4afc8ae)
 #2 0x0000000004aff4fa SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007ff4c7e6f140 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x13140)
 #4 0x00007ff4c7983d61 raise (/lib/x86_64-linux-gnu/libc.so.6+0x38d61)
 #5 0x00007ff4c796d537 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22537)
 #6 0x0000000004a5dffa llvm::report_fatal_error(llvm::Twine const&, bool) (/b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/opt+0x4a5dffa)
 #7 0x00000000026d996a void llvm::detail::UniqueFunctionBase<void, llvm::StringRef, llvm::Any, llvm::PreservedAnalyses const&>::CallImpl<llvm::PreservedCFGCheckerInstrumentation::registerCallbacks(llvm::PassInstrumentationCallbacks&, llvm::AnalysisManager<llvm::Module>&)::$_18>(void*, llvm::StringRef, llvm::Any&, llvm::PreservedAnalyses const&) StandardInstrumentations.cpp:0:0
 #8 0x000000000492733f llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/opt+0x492733f)
 #9 0x00000000008a305d llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::PassPlugin>, llvm::ArrayRef<std::function<void (llvm::PassBuilder&)>>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool, bool) (/b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/opt+0x8a305d)
#10 0x0000000000898a57 optMain (/b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/opt+0x898a57)
#11 0x00007ff4c796ed7a __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x23d7a)
#12 0x0000000000894a1a _start (/b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/opt+0x894a1a)
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/FileCheck /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/Transforms/EmbedBitcode/embed-wpd.ll

--

********************


sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Jun 3, 2025
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