[PATCH] D26437: Use -fno-unit-at-a-time and -funit-at-a-time

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 13 09:06:27 PST 2016


tejohnson added a comment.

In https://reviews.llvm.org/D26437#593762, @rampitec wrote:

> That said I believe that still makes sense to submit the current change just to connect options we already have defined to their intended functionality.


I don't think I agree. Use of the -fno-unit-at-a-time option could end up hiding other real issues (e.g. in your case with the convergent attribute), and also disable optimizations that are perfectly legal in those cases (e.g. global opt, etc). If someone wants to disable the option, it would again be worthwhile to have a discussion as to why.

I looked at the history of the clang support that gives the current error, which is from 2009, and the comment was "We could just warn about -fno-unit-at-a-time, but in practice people using it probably aren't going to get what they want out of clang." I still think that is true today, since this disables a whole lot, and looking at e.g. the gcc documentation for the option it only seems to disable a few things for very specific legacy code circumstances (the gcc docs say the option is there for compatibility, and it disables reordering of top-level functions for which new code should use attributes, e.g.).

I tried to look at the history of when/why DisableUnitAtATime was added to llvm, but wasn't able to find the commit log either via git (it was moved from a different file) or via google searches.


Repository:
  rL LLVM

https://reviews.llvm.org/D26437





More information about the llvm-commits mailing list