about summary refs log tree commit diff
path: root/src/test/ui/thinlto
diff options
context:
space:
mode:
authorPeter Jin <peterhaijin@gmail.com>2018-12-31 10:58:13 -0800
committerPeter Jin <peterhaijin@gmail.com>2019-01-05 09:59:25 -0800
commitb91d211b40300a3c026b330e50a6e3e19d71351c (patch)
tree4ecf2d4b659028a9c9364e33cbeea05a7b950cd9 /src/test/ui/thinlto
parent2442823ef572a65092fbc46f6975633f983b50b6 (diff)
downloadrust-b91d211b40300a3c026b330e50a6e3e19d71351c.tar.gz
rust-b91d211b40300a3c026b330e50a6e3e19d71351c.zip
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.
Diffstat (limited to 'src/test/ui/thinlto')
0 files changed, 0 insertions, 0 deletions