3 Commits

Author SHA1 Message Date
Paul Kirth
9179322447
Revert "[llvm][EmbedBitcodePass] Prevent modifying the module with ThinLTO" (#145987)
Reverts llvm/llvm-project#139999

This has a reported crash in
https://github.com/llvm/llvm-project/pull/139999#issuecomment-2993622494

This PR was intended to fix an error when linking, which is
unfortunately preferable to crashing clang. For now, we'll revert and
investigate the problem.
2025-06-26 22:35:38 -07:00
Paul Kirth
55c7d5cdad
[llvm][EmbedBitcodePass] Prevent modifying the module with ThinLTO (#139999)
Since ThinLTOBitcodeWriterPass handles many things for CFI and WPD, like
updating vtable linkage, we need to prevent those changes from
persisting in the non-LTO object code we will compile under FatLTO.

The only non-invasive way to do that is to clone the module when
serializing the module in ThinLTOBitcodeWriterPass. We may be able to
avoid cloning in the future with additional infrastructure to restore
the IR to its original state.

Fixes #139440
2025-05-29 13:42:48 -07:00
Paul Kirth
bedbc65871
[llvm][EmbedBitcodePass] Pre-commit test for using WPD with FatLTO (#139998)
This is a reduced test case from #139440.
2025-05-29 13:39:45 -07:00