[PATCH] D28304: [compiler-rt] [cmake] Disable appending -msse* flags implicitly

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 5 07:52:45 PST 2017


mgorny added a comment.

In https://reviews.llvm.org/D28304#636669, @dvyukov wrote:

> User -march flag won't help as runtime is prebuilt.


I meant the flag used by the compiler vendor when compiler-rt is built.

> SCUDO is sse4.2, but tsan is sse3. Do you actually see any problems with sse3? It's like 10 years old. I agree with you that strictly speaking we do wrong thing for old processors.

Well, it seems that SSE3 is supported since Pentium 4 / newer versions of Athlon64. I don't see a big issue enabling it for x86-64 but for 32-bit systems you're ruling out quite a lot of hardware. My only pure x86-32 box (which I use to test stuff) does not support SSE3.

> But if we disable it, we disable it for everybody.  So if you don't hit cashes with it, I would prefer to keep sse3 in tsan.

Well, I guess that depends on how you build compiler-rt. On Gentoo, we just pass user CFLAGS (I need to think more on that, tbh). I would rather see the compiler vendor deciding on which CPUs are to be supported by the compiler, rather than the build system silently bumping the minimum for one component.

That said, I think we need to work on improved portability of compiler runtimes shipped with clang. I will probably start an open discussion on that soonish. FWICS we pretty much 'officially' support building just one or two variants of compiler-rt for different ABIs of a single architecture. This doesn't scale well. While I'm not sure how significant the performance impact is but right now we either force compiler-rt to not use newer instructions (= make it slower) or randomly cause -march= not to be respected.


https://reviews.llvm.org/D28304





More information about the cfe-commits mailing list