Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion gc/mmtk/depend
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,22 @@ $(TARGET_SO): $(MMTK_BUILD)/$(LIBMMTK_RUBY)

$(OBJS): Makefile

# A raised LLVM inline threshold for the Rust GC code: this is what fuses the
# per-object marking pipeline (work packet loop, closure trampoline, type fast
# paths, mark enqueue) into straight-line code. Without it the fast paths in
# scanning.rs stay behind real calls and the win evaporates.
#
# The flag must reach rustc either via the target-scoped RUSTFLAGS in
# MMTK_CARGO_ENV (LTO builds, see extconf.rb) or via plain RUSTFLAGS. Never
# set both: plain RUSTFLAGS has higher precedence in Cargo and would clobber
# the target-scoped flags.
MMTK_INLINE_THRESHOLD = 5000
MMTK_THRESHOLD_RUSTFLAGS = -Cllvm-args=-inline-threshold=$(MMTK_INLINE_THRESHOLD)

release/$(LIBMMTK_RUBY) debug/$(LIBMMTK_RUBY): $(RUSTSRCS) $(srcdir)/Cargo.toml $(srcdir)/Cargo.lock Makefile

release/$(LIBMMTK_RUBY):
CARGO_TARGET_DIR="." $(MMTK_CARGO_ENV) cargo build --manifest-path=$(srcdir)/Cargo.toml --release $(MMTK_CARGO_FLAGS)
CARGO_TARGET_DIR="." $(if $(MMTK_CARGO_ENV),,RUSTFLAGS="$(RUSTFLAGS) $(MMTK_THRESHOLD_RUSTFLAGS)") $(MMTK_CARGO_ENV) cargo build --manifest-path=$(srcdir)/Cargo.toml --release $(MMTK_CARGO_FLAGS)
$(MMTK_CARGO_FIXUP)

debug/$(LIBMMTK_RUBY):
Expand Down
2 changes: 1 addition & 1 deletion gc/mmtk/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def filter_warnflags(cc, flags)
CFLAGS += #{cflags}
DLDFLAGS += #{ldflags}
warnflags = #{warnflags}
MMTK_CARGO_ENV = #{env}="-Clinker-plugin-lto -C target-cpu=native"
MMTK_CARGO_ENV = #{env}="-Clinker-plugin-lto -C target-cpu=native -Cllvm-args=-inline-threshold=$(MMTK_INLINE_THRESHOLD)"
MMTK_CARGO_FLAGS = --target #{lto[:host]}
MMTK_CARGO_FIXUP = mkdir -p release && cp -f #{lto[:host]}/release/$(LIBMMTK_RUBY) release/$(LIBMMTK_RUBY)
endif
Expand Down
Loading