This is an archive of the discontinued LLVM Phabricator instance.

[libomptarget][nfc] Use unity build for nvcc to approximate LTO
AbandonedPublic

Authored by JonChesterfield on Mar 23 2020, 10:35 AM.

Details

Summary

[libomptarget][nfc] Use unity build for nvcc to approximate LTO

Nvcc doesn't support link time optimization. Including all the source
into one file is common in games dev where it is called a unity build.
The advantage is that moving functions from header to source no longer
carries a performance penalty.

A secondary advantage is we'll be able to rename the C++ files to .cpp
without confusing nvcc, provided unity.cu retains the current suffix.

This is a NFC if there are no bugs in nvcc. As there may be, I'm hoping
a reviewer will run a larger out of tree test suite against this patch.
The in tree ones pass.

Diff Detail