Commit Graph

15 Commits

Author SHA1 Message Date
Taiki Endo
be71fccf11 librustc_codegen_ssa => 2018 2019-02-09 23:31:47 +09:00
Simonas Kazlauskas
f38d0da893 Implement optimize(size) and optimize(speed) 2019-01-24 20:13:50 +02:00
Peter Jin
b91d211b40 Add a target option "merge-functions" taking values in ("disabled",
"trampolines", or "aliases (the default)) to allow targets to opt out of
the MergeFunctions LLVM pass. Also add a corresponding -Z option with
the same name and values.

This works around: https://github.com/rust-lang/rust/issues/57356

Motivation:

Basically, the problem is that the MergeFunctions pass, which rustc
currently enables by default at -O2 and -O3, and `extern "ptx-kernel"`
functions (specific to the NVPTX target) are currently not compatible
with each other. If the MergeFunctions pass is allowed to run, rustc can
generate invalid PTX assembly (i.e. a PTX file that is not accepted by
the native PTX assembler ptxas). Therefore we would like a way to opt
out of the MergeFunctions pass, which is what our target option does.

Related work:

The current behavior of rustc is to enable MergeFunctions at -O2 and -O3,
and also to enable the use of function aliases within MergeFunctions.
MergeFunctions both with and without function aliases is incompatible with
the NVPTX target.

clang's "solution" is to have a "-fmerge-functions" flag that opts in to
the MergeFunctions pass, but it is not enabled by default.
2019-01-05 09:59:25 -08:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
bors
4a45578bc5 Auto merge of #56502 - Zoxc:hir-func, r=eddyb
Use a function to access the Hir map to be able to turn it into a query later

r? @eddyb
2018-12-07 20:04:06 +00:00
John Kåre Alsaker
a70babed03 Use a function to access the Hir map to be able to turn it into a query later 2018-12-06 17:24:36 +01:00
Nikita Popov
8128d0d1a9 Serialize modules into ThinBuffer after initial optimization
Instead of keeping all modules in memory until thin LTO and only
serializing them then, serialize the module immediately after
it finishes optimizing.
2018-12-04 16:24:20 +01:00
Nikita Popov
bc2db43b9e Remove unnecessary parts of run_fat_lto signature
Fat LTO merges into one module, so only return one module.
2018-12-04 16:10:24 +01:00
Nikita Popov
bdbee6311b Separate out methods for running thin and fat LTO 2018-12-04 16:10:24 +01:00
Nikita Popov
a17de6980a Separate codepaths for fat and thin LTO in write.rs
These are going to have different intermediate artifacts, so
create separate codepaths for them.
2018-12-04 16:10:24 +01:00
Nikita Popov
2c1883c1a6 Refactor LTO type determination
Instead of only determining whether some form of LTO is necessary,
determine whether thin, fat or no LTO is necessary. I've rewritten
the conditions in a way that I think is more obvious, i.e. specified
LTO type + additional preconditions.
2018-12-04 16:10:24 +01:00
Nikita Popov
9c657e82df Extract free_worker closure 2018-12-04 16:10:24 +01:00
Eduard-Mihai Burtescu
0b569249c8 [eddyb] rustc_codegen_ssa: rename interfaces to traits. 2018-11-16 15:08:18 +02:00
Eduard-Mihai Burtescu
d1410ada92 [eddyb] rustc_codegen_ssa: avoid a Clone bound on TargetMachine. 2018-11-16 15:08:18 +02:00
Denis Merigoux
b9e5cf99a9 Separating the back folder between backend-agnostic and LLVM-specific code 2018-11-16 15:08:18 +02:00