summaryrefslogtreecommitdiffstats
path: root/llvm/tools/lto/lto.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/lto/lto.cpp')
-rw-r--r--llvm/tools/lto/lto.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/tools/lto/lto.cpp b/llvm/tools/lto/lto.cpp
index a1dd4ebbccb..e28c7aaf526 100644
--- a/llvm/tools/lto/lto.cpp
+++ b/llvm/tools/lto/lto.cpp
@@ -44,9 +44,13 @@ static cl::opt<bool>
DisableGVNLoadPRE("disable-gvn-loadpre", cl::init(false),
cl::desc("Do not run the GVN load PRE pass"));
-static cl::opt<bool>
-DisableLTOVectorization("disable-lto-vectorization", cl::init(false),
- cl::desc("Do not run loop or slp vectorization during LTO"));
+static cl::opt<bool> DisableLTOVectorization(
+ "disable-lto-vectorization", cl::init(false),
+ cl::desc("Do not run loop or slp vectorization during LTO"));
+
+static cl::opt<bool> EnableFreestanding(
+ "lto-freestanding", cl::init(false),
+ cl::desc("Enable Freestanding (disable builtins / TLI) during LTO"));
#ifdef NDEBUG
static bool VerifyByDefault = false;
@@ -159,6 +163,7 @@ static void lto_add_attrs(lto_code_gen_t cg) {
if (OptLevel < '0' || OptLevel > '3')
report_fatal_error("Optimization level must be between 0 and 3");
CG->setOptLevel(OptLevel - '0');
+ CG->setFreestanding(EnableFreestanding);
}
extern const char* lto_get_version() {
@@ -464,6 +469,7 @@ thinlto_code_gen_t thinlto_create_codegen(void) {
lto_initialize();
ThinLTOCodeGenerator *CodeGen = new ThinLTOCodeGenerator();
CodeGen->setTargetOptions(InitTargetOptionsFromCodeGenFlags());
+ CodeGen->setFreestanding(EnableFreestanding);
if (OptLevel.getNumOccurrences()) {
if (OptLevel < '0' || OptLevel > '3')
OpenPOWER on IntegriCloud