Skip to content

Enable LTO on the Linux Clang build on CI #3491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 14, 2021
Merged

Enable LTO on the Linux Clang build on CI #3491

merged 6 commits into from
Jan 14, 2021

Conversation

dschuff
Copy link
Member

@dschuff dschuff commented Jan 14, 2021

No description provided.

@dschuff
Copy link
Member Author

dschuff commented Jan 14, 2021

@sbc100 @kripken it looks like thinLTO pretty much just works on both the linux and mac builders here. Should we just turn it on for our existing clang and/or mac builders?

Copy link
Member

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sgtm

Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm % comments

@@ -137,7 +137,7 @@ ENDFOREACH()

option(BYN_ENABLE_LTO "Build with LTO" Off)
if(BYN_ENABLE_LTO)
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this needed? docs say it allows regexes, but the right side isn't one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apple's clang has the compiler ID AppleClang which MATCHES clang but isn't STREQUAL. Using MATCHES with bare strings seems pretty common in CMake files (it definitely is in LLVM's)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, sgtm.

@@ -70,7 +70,7 @@ jobs:
if: matrix.os == 'ubuntu-latest'

- name: cmake (macos)
run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install
run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install -DBYN_ENABLE_LTO=ON
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest not changing the mac build since it's what we ship to users atm.

(The linux "clang" build sgtm to change to LTO, since we do have a bunch of other non-LTO builds on linux anyhow.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK yeah, that's sort of what I had in mind for now too.
I think we do want to ship this to users eventually though if it doesn't end up being too much trouble.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, yeah, would be good to ship this. (And switch testing then - but I don't feel strongly about the meantime either.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Speaking of, I noticed that we still force assertions on. Are we close to no longer requiring that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(also our current command line puts a -O2 and overrides the default -O3)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the status is not changed from #3065 - we were thinking of testing with assertions but shipping to users without, which would need more work. LTO is probably a bigger deal though than assertions, from your data.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found it to be fairly evenly split between them, actually. Although those numbers were probably dominated by LLVM rather than Binaryen. For emscripten-releases I think we do want to test with assertions for LLVM as well. Not sure how much difference it makes on the standalone releases.

@dschuff dschuff changed the title [WIP] try out LTO on CI Enable LTO on the Linux Clang build on CI Jan 14, 2021
@dschuff dschuff marked this pull request as ready for review January 14, 2021 23:42
@dschuff dschuff merged commit f18c18e into master Jan 14, 2021
@dschuff dschuff deleted the ltotest branch January 14, 2021 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants