[llvm-commits] [llvm] r48793 - in /llvm/trunk: include/llvm/Target/TargetOptions.h lib/Target/TargetMachine.cpp
Devang Patel
dpatel at apple.com
Tue Mar 25 14:02:35 PDT 2008
Author: dpatel
Date: Tue Mar 25 16:02:35 2008
New Revision: 48793
URL: http://llvm.org/viewvc/llvm-project?rev=48793&view=rev
Log:
Add optimize-for-size knob.
Modified:
llvm/trunk/include/llvm/Target/TargetOptions.h
llvm/trunk/lib/Target/TargetMachine.cpp
Modified: llvm/trunk/include/llvm/Target/TargetOptions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetOptions.h?rev=48793&r1=48792&r2=48793&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetOptions.h (original)
+++ llvm/trunk/include/llvm/Target/TargetOptions.h Tue Mar 25 16:02:35 2008
@@ -78,6 +78,10 @@
/// on the commandline. When the flag is on, the target will perform tail call
/// optimization (pop the caller's stack) providing it supports it.
extern bool PerformTailCallOpt;
+
+ /// OptimizeForSize - When this flags is set, code generator avoids optimization
+ /// that increases size.
+ extern bool OptimizeForSize;
} // End llvm namespace
#endif
Modified: llvm/trunk/lib/Target/TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=48793&r1=48792&r2=48793&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/TargetMachine.cpp Tue Mar 25 16:02:35 2008
@@ -34,6 +34,7 @@
Reloc::Model RelocationModel;
CodeModel::Model CMModel;
bool PerformTailCallOpt;
+ bool OptimizeForSize;
}
namespace {
cl::opt<bool, true> PrintCode("print-machineinstrs",
@@ -123,6 +124,11 @@
cl::desc("Turn on tail call optimization."),
cl::location(PerformTailCallOpt),
cl::init(false));
+ cl::opt<bool, true>
+ EnableOptimizeForSize("optimizeforsize",
+ cl::desc("Optimize for size."),
+ cl::location(OptimizeForSize),
+ cl::init(false));
}
//---------------------------------------------------------------------------
More information about the llvm-commits
mailing list