Skip to content

Fix LTO Detection in LLVM Intrinsic Build#36

Merged
nlordell merged 1 commit into
mainfrom
llvm-instrinsic-build
Nov 16, 2023
Merged

Fix LTO Detection in LLVM Intrinsic Build#36
nlordell merged 1 commit into
mainfrom
llvm-instrinsic-build

Conversation

@nlordell

Copy link
Copy Markdown
Owner

Fixes #33

This PR fixes LTO detection in the LLVM intrinsic build script. It turns out that around Rust 1.55, cargo stopped propagating RUSTFLAGS environment variable to the build script invocation (and even actively removing it). It is replaced with CARGO_ENCODED_RUSTFLAGS which is meant to more accurately set the actual rustc flags that are being used.

Turning this on yields an immediate improvement in benchmarks:

U256::add               time:   [15.726 ns 15.764 ns 15.808 ns]
                        change: [-34.507% -34.304% -34.099%] (p = 0.00 < 0.05)
                        Performance has improved.

@nlordell nlordell merged commit b66678b into main Nov 16, 2023
@nlordell nlordell deleted the llvm-instrinsic-build branch April 16, 2025 07:09
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.

LTO doesn't appear to affect llvm intrinsics.

1 participant