llvm 10 vs llvm 7.0, clang and gcc

21 views
Skip to first unread message

Irena Pasvinter

unread,
Jun 7, 2020, 9:01:22 AM6/7/20
to swiftshader
Hello,

Looking at the CMakeLists.txt  it seems that default llvm version is currently 7.0 and llvm 10.0 is built only when compiler is set to clang.
I'm currently building on RedHat station where clang is not readily available. So I have a couple of questions regarding llvm version.

1.In general, what is currently the advantage of using llvm10 versus llvm 7 in Swiftshader?
2.Does it make sense to try to build swiftshader's llvm10 with gcc or should it only be built with clang ?
3.On what kind of Linux platform do you currently run  your clang+llvm10 build?

Thank you,
Irena

Ben Clayton

unread,
Jun 8, 2020, 8:39:54 AM6/8/20
to Irena Pasvinter, swiftshader
Hi Irena,

> Looking at the CMakeLists.txt  it seems that default llvm version is currently 7.0 and llvm 10.0 is built only when compiler is set to clang.

I assume you're referring to these lines:


if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND # turbo-cov is only useful for clang coverage info
SWIFTSHADER_LLVM_VERSION EQUAL "10.0" AND # turbo-cov does not build with earlier llvm versions
SWIFTSHADER_EMIT_COVERAGE)
add_subdirectory(${TESTS_DIR}/regres/cov/turbo-cov)
endif()


turbo-cov requires LLVM 10 and Clang to build, which is a tool needed for generating code coverage informationturbo-cov is not an essential part of the build, and to my knowledge, is the only target that requires Clang and LLVM 10.
You should be able to build with GCC and SWIFTSHADER_LLVM_VERSION set to 10.0.

1.In general, what is currently the advantage of using llvm10 versus llvm 7 in Swiftshader?

The short answer is: very little.
The reasoning is that we like to keep SwiftShader's dependencies relatively up to date. LLVM is (usually) continually improving its code generation, and has an unstable public API, frequently making breaking changes. For these reasons, we continually try to keep our LLVM version close to latest. However, the migration to LLVM 10 is still in progress - there are some platforms that do not have the necessary LLVM config files generated yet.

2.Does it make sense to try to build swiftshader's llvm10 with gcc or should it only be built with clang ?

It should work with either. We have CI presubmit bot that build with both recent versions of Clang and GCC.

3.On what kind of Linux platform do you currently run  your clang+llvm10 build?

It is built daily using an amd64 variant of debian and Ubuntu 14.04, but I personally build with amd64 Ubuntu 18.04.

Cheers,
Ben


--
You received this message because you are subscribed to the Google Groups "swiftshader" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swiftshader...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/swiftshader/5afa7784-2f9d-4464-a49e-417c8f1d302ao%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages