halide / Halide

a language for fast, portable data-parallel computation
https://halide-lang.org
Other
5.85k stars 1.07k forks source link

Multiple symbol definitions for x86-32-windows #5649

Open alexreinking opened 3 years ago

alexreinking commented 3 years ago

Compiling a multitarget generator with the following list of targets

x86-32-windows-avx-avx2-f16c-fma-sse41-no_runtime
x86-32-windows-avx-sse41-no_runtime
x86-32-windows-sse41-no_runtime
x86-32-windows-no_runtime

produces several concerning warnings:

Warning: Warning: symbol '__ymm@0000000000000200000000000000000000000000000000008000000000002000' seen multiple times in library.
Warning: Warning: symbol '__ymm@0000000000000000000000000000008000000000000000028000000000000000' seen multiple times in library.
Warning: Warning: symbol '__ymm@0000000000000100000000000000000800000000000000040000000000000000' seen multiple times in library.
Warning: Warning: symbol '__xmm@00000000000002000000000000000000' seen multiple times in library.
Warning: Warning: symbol '__xmm@00000000000000040000000000000000' seen multiple times in library.
Warning: Warning: symbol '__xmm@00000000000000028000000000000000' seen multiple times in library.
Warning: Warning: symbol '__xmm@00000000000000008000000000002000' seen multiple times in library.
Warning: Warning: symbol '__xmm@00000000000001000000000000000008' seen multiple times in library.
Warning: Warning: symbol '__ymm@0000000000000200000000000000000000000000000000008000000000002000' seen multiple times in library.
Warning: Warning: symbol '__ymm@0000000000000000000000000000008000000000000000028000000000000000' seen multiple times in library.
Warning: Warning: symbol '__ymm@0000000000000100000000000000000800000000000000040000000000000000' seen multiple times in library.
Warning: Warning: symbol '__xmm@00000000000002000000000000000000' seen multiple times in library.
Warning: Warning: symbol '__xmm@00000000000000040000000000000000' seen multiple times in library.
Warning: Warning: symbol '__xmm@00000000000000028000000000000000' seen multiple times in library.
Warning: Warning: symbol '__xmm@00000000000000008000000000002000' seen multiple times in library.
Warning: Warning: symbol '__xmm@00000000000001000000000000000008' seen multiple times in library.

Replacing 32-windows with 64-windows in the targets list does not generate these warnings.

alexreinking commented 3 years ago

The warning is generated by our code, here:

https://github.com/halide/Halide/blob/42c5182b5fbf8724b51d86316282565144f91dc9/src/LLVM_Output.cpp#L192

abadams commented 3 years ago

My wild guess: Those symbols are vector constants, where the name of the symbol is the value of the constant (in order to not store the same constant more than once)

shoaibkamil commented 3 years ago

This has been a recurring issue on Windows for us as well; @slomp might have more to say about it. AFAICT, it is exactly what Andrew says: constants are named after the value of the constant, so we end up with multiple symbols of the same name. We should either make the warning better at diagnosing real issues, or get rid of it.

slomp commented 3 years ago

Yeap, this is a minor annoyance, and it's precisely due to what Andrew stated. I once spent an hour or so trying to get to the bottom of it, but in the end just decided to suppress the warning on our generator tool.

ashishUthama commented 3 years ago

In a larger build system this would unnecessarily alarm users not in the know.

When would this warn about something not ignorable? If thats rare/benign could we remove this warning?

abadams commented 3 years ago

Yes, if this is WAI we should disable the warning for sure.