[cfe-dev] clang and Crypto++

Marshall Clow mclow.lists at gmail.com
Wed Jan 5 10:53:28 PST 2011


On Jan 5, 2011, at 10:13 AM, Marshall Clow wrote:

> 
> On Jan 5, 2011, at 10:06 AM, Chris Lattner wrote:
> 
>> 
>> On Jan 5, 2011, at 9:45 AM, Marshall Clow wrote:
>> 
>>>> Naturally, we'd like to know where in clang this time is going. Is it the front end (-fsyntax-only)? The optimizer (> -O0), and if so, which one(s)?
>>> 
>>> Looks like the optimizer.
>>> 
>>> $ time clang++ -Wno-tautological-compare -DNDEBUG -g         -arch x86_64 -arch i386 -DCRYPTOPP_DISABLE_ASM -pipe -fsyntax-only sha.cpp 
>>> real	6.234s
>>> $ time clang++ -Wno-tautological-compare -DNDEBUG -g         -arch x86_64 -arch i386 -DCRYPTOPP_DISABLE_ASM -pipe -c sha.cpp 
>>> real 7.863s
>>> $ time clang++ -Wno-tautological-compare -DNDEBUG -g -O1 -arch x86_64 -arch i386 -DCRYPTOPP_DISABLE_ASM -pipe -c sha.cpp 
>>> real 17.882s
>>> $ time clang++ -Wno-tautological-compare -DNDEBUG -g -O2 -arch x86_64 -arch i386 -DCRYPTOPP_DISABLE_ASM -pipe -c sha.cpp 
>>> .... long, long time; I killed it after 30 minutes.
>>> 
>>> How do I tell which one?
>> 
>> Try passing -ftime-report to clang.  Another silly question: did you build clang itself in debug mode?  The first few lines of:
>> 
>> $ clang -cc1 -version
>> 
>> Should show either:
>> 
>> Low Level Virtual Machine (http://llvm.org/):
>> llvm version 2.9svn
>> DEBUG build with assertions.
>> 
>> or:
>> 
>> Low Level Virtual Machine (http://llvm.org/):
>> llvm version 2.9svn
>> Optimized build.
> 
> D'oh! It's a debug build.
> I will build a non-debug one and re-run the timings.

I've closed bug #8917 (slower than gcc) with a "pilot error" notation.

Gonsolo <gonsolo at gmail.com> wrote:

> clang -cc1 -version:
>  Low Level Virtual Machine (http://llvm.org/):
>  llvm version 2.9
>  Optimized build with assertions.
> 
> svn 122890
> 
> time clang++ -Wno-tautological-compare -DNDEBUG -g -O3
> -DCRYPTOPP_DISABLE_ASM -pipe -c sha.cpp:
> 
> real    0m1.989s
> user    0m1.964s
> sys     0m0.024s
> 
> Everything's ok over here. :)

I'm on r122872 and bug #8916 (hang when compiling sha.cpp) is still happening for me. (on both -O2 and -O3)

-- Marshall





More information about the cfe-dev mailing list