This is an archive of the discontinued LLVM Phabricator instance.

gold, libLTO: Add new flags to support bit set lowering.
AbandonedPublic

Authored by pcc on Mar 17 2015, 3:39 PM.

Details

Summary

Add lowerbitsets flag to gold plugin and libLTO, and add disable-opt flag to
gold plugin. These flags can be used by the compiler driver to enable/disable
various parts of the compilation pipeline in cases where they are not needed.

In particular, this helps reduce link time in cases where the bit set lowering
pass is needed for control flow integrity, but the rest of LTO is not needed.

Diff Detail

Event Timeline

pcc updated this revision to Diff 22139.Mar 17 2015, 3:39 PM
pcc retitled this revision from to gold, libLTO: Add new flags to support bit set lowering..
pcc updated this object.
pcc edited the test plan for this revision. (Show Details)
pcc added a reviewer: rafael.
pcc added subscribers: kcc, Unknown Object (MLST).
rafael added inline comments.Mar 17 2015, 4:02 PM
lib/Transforms/IPO/PassManagerBuilder.cpp
530

Should these still be enabled at -O0?

tools/gold/gold-plugin.cpp
98

DisableOpt.
LowerBitSets.

pcc updated this revision to Diff 22147.Mar 17 2015, 5:22 PM
  • Rename flags
lib/Transforms/IPO/PassManagerBuilder.cpp
530

The first one is essentially a compile-time optimization that happens to be run at link time due to technical restrictions. I guess we can't easily get the compile-time optimization level here.

The second one is basically dead stripping, which the linker would try to do anyway (but not necessarily very well depending on the object file format etc). I've also found that dead stripping is also less expensive here overall as we save time in the backend.

Because this flag + disable-opt is exposed to users in D8402, it seems reasonable to do these types of things here for the sake of efficiency (and, as a bonus, code size in some cases). We might want to change this set of passes later -- for example, if we parallelize the backend, DCE would be less useful here.

tools/gold/gold-plugin.cpp
98

Done

pcc abandoned this revision.Mar 19 2015, 3:08 PM

We went with r232769 instead.