[cfe-dev] Some clang benchmarking on Windows
Óscar Fuentes
ofv at wanadoo.es
Mon Oct 11 13:12:27 PDT 2010
Francois Pichet <pichet2000 at gmail.com> writes:
> On Mon, Oct 11, 2010 at 3:12 PM, Óscar Fuentes <ofv at wanadoo.es> wrote:
>> Francois Pichet <pichet2000 at gmail.com>
>> writes:
>>
>> [snip]
>>
>>> Now we need a way to create a new configuration using CMake to enable
>>> LTO compilation with MSVC.
>>
>> If you describe the process involved on using LTO I could help a bit.
>>
>> (Is that the same LTO based on LLVM? Does it work on Windows at all? Or
>> is it the LTO provided by VS?)
>
> I am talking about the LTO (Microsoft calls it Whole Program
> Optimization) provided by VS. Being able to compile clang using VS
> with Whole Program Optimization on.
>
> Here are some docs:
> http://msdn.microsoft.com/en-us/library/0zza0de8(v=VS.90).aspx
> http://msdn.microsoft.com/en-us/library/xbf3tbeh(v=VS.90).aspx
That's trivial. Try this patch and see if the results warrants a new
cmake option for supporting LTO on MSVC:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d473f51..0f1bb24 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -224,6 +224,7 @@ if( MSVC )
add_llvm_definitions( -D_SCL_SECURE_NO_DEPRECATE )
add_llvm_definitions( -wd4146 -wd4503 -wd4996 -wd4800 -wd4244 -wd4624 )
add_llvm_definitions( -wd4355 -wd4715 -wd4180 -wd4345 -wd4224 )
+ add_llvm_definitions( /GL )
# Suppress 'new behavior: elements of array 'array' will be default initialized'
add_llvm_definitions( -wd4351 )
More information about the cfe-dev
mailing list