This is an archive of the discontinued LLVM Phabricator instance.

[HIP] Change default optimization level to -O3
Needs ReviewPublic

Authored by yaxunl on Nov 6 2018, 1:58 PM.

Details

Reviewers
tra
Summary

The default optimization level of nvcc is -O3. There are HIP applications which expect
the default optimization level to be -O3. Most HIP applications use -O3, therefore
making it default.

Diff Detail

Event Timeline

yaxunl created this revision.Nov 6 2018, 1:58 PM
tra added a comment.Nov 6 2018, 2:16 PM

I'm not convinced that nvcc's behavior is a good guide for clang's defaults.

Considering that clang is not compatible with nvcc when it comes to command line options, whoever is using clang to compile CUDA already has to adjust command line options. Explicitly adding -O3 during the process is, IMO, better than requiring everyone to be aware that if the input file is CUDA (or HIP), then clang would default to -O3.