This change fixes a "local linkage requires default visibility" assert when attempting to build LLVM with ThinLTO on Windows.
Details
Diff Detail
- Build Status
Buildable 5299 Build 5299: arc lint + arc unit
Event Timeline
I see the clang test. We try to keep our testing at the IR level though. Is there anything specific that prevents it in this case?
@mehdi_amini: This is reduced from a C++ program that triggered the problem. The compiler failed before outputing IR, which is why it is C++. I can try to see if I can create some IR that will reproduce the problem, but it will have to wait until tomorrow.
Thanks, @pcc for helping me look into this and realizing that doing the alias processing first fixes the problem. I've also included a small change to use GA-> instead of I->, which prevents us from using the iterator in an invalid state and hitting another assert.
test/ThinLTO/X86/promote-internals.ll | ||
---|---|---|
1 | This is a test of the ThinLTOBitcodeWriter so it should live in test/Transforms/ThinLTOBitcodeWriter. | |
2 | Please use llvm-modextract and llvm-dis to check that the IR is as expected. | |
13–21 | Do you need these functions? I think you should be able to trigger the bug without them if you give @al external linkage. |
test/ThinLTO/X86/promote-internals.ll | ||
---|---|---|
13–21 | Doing that leads to a different error ("GlobalValue not found in index"). That error is also addressed by this patch (specifically, by the change from I-> to GA->), but can be triggered with or without the change to when we process aliases. For that reason, I've elected to keep the functions in the test - but I can remove them if you really want me to. |
test/ThinLTO/X86/promote-internals.ll | ||
---|---|---|
13–21 | If I make just the I-> to GA-> change locally I still get the "GlobalValue not found in index" assertion failure with your test case with the functions removed. I would just remove them because the assertion failure is being caused by the same underlying issue. |
test/Transforms/ThinLTOBitcodeWriter/promote-internals.ll | ||
---|---|---|
2 ↗ | (On Diff #94137) | Please also check the contents of both modules here. |
LGTM
test/Transforms/ThinLTOBitcodeWriter/promote-internals.ll | ||
---|---|---|
1 ↗ | (On Diff #94147) | Nit: rename filter-alias.ll |
This is a test of the ThinLTOBitcodeWriter so it should live in test/Transforms/ThinLTOBitcodeWriter.