LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 03-20-2012, 12:56 AM   #16
ozanbaba
Member
 
Registered: May 2003
Location: Tengiz
Distribution: Slackware64 14.1
Posts: 669

Rep: Reputation: 94

Quote:
Originally Posted by Martinus2u View Post
I grew up with Pure C (formerly Turbo C) on m68k hardware which compiled 20 times faster than GCC and produced similarly well optimized code (since then optimization has improved no doubt). I believe the speed difference between CLANG and GCC is similar. That alone makes it worth it.
I did not noticed much speed difference when compiling things like Wine etc. It sure compiles Carbon fast but then there's real world.
Check out a nice detailed benchmark here.
 
Old 03-20-2012, 01:14 PM   #17
a4z
Member
 
Registered: Feb 2009
Posts: 277

Rep: Reputation: 111Reputation: 111
that's why llvm is also good for gcc

http://gcc.gnu.org/ml/gcc/2012-03/msg00256.html

http://gcc.gnu.org/ml/gcc/2012-03/msg00263.html
 
Old 05-14-2012, 05:16 AM   #18
mlpa
Member
 
Registered: May 2008
Location: Aveiro
Distribution: Slackware
Posts: 467

Original Poster
Rep: Reputation: 33
Free BSD 10 To Use Clang Compiler, Deprecate GCC, link.
Maybe there is some important advantage of LLVM on top of GCC.
 
Old 05-14-2012, 05:49 AM   #19
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Slackware
Posts: 14,880
Blog Entries: 2

Rep: Reputation: 3805Reputation: 3805Reputation: 3805Reputation: 3805Reputation: 3805Reputation: 3805Reputation: 3805Reputation: 3805Reputation: 3805Reputation: 3805Reputation: 3805
Quote:
Originally Posted by mlpa View Post
Free BSD 10 To Use Clang Compiler, Deprecate GCC, link.
Maybe there is some important advantage of LLVM on top of GCC.
Yes, there is. LLVM/Clang is licensed with a BSD license and the BSD people want to become GNU-free.
 
Old 05-14-2012, 09:04 AM   #20
mlpa
Member
 
Registered: May 2008
Location: Aveiro
Distribution: Slackware
Posts: 467

Original Poster
Rep: Reputation: 33
From what I read in the Phoronix forum the bitcode compiled by clang is 5-15% slower than the same code compiled with GCC without optimizations.

Clang is not a mature yet.
 
Old 05-18-2012, 09:50 PM   #21
leeeoooooo
Member
 
Registered: Jan 2009
Distribution: Slackware 14.0
Posts: 104

Rep: Reputation: 18
I'm delighted that LLVM was included with the new X updates in current. I've been watching this project for several years wondering if it would ever come into more general acceptance.

"GCC vs LLVM"??? I don't get it. To me they are very different tools. Yes, LLVM has a compiler--so does Perl.

To me, the compiler in LLVM has more in common with the Perl compiler than with GCC.

The LLVM compiler targets the Low Level Virtual Machine, just as the Perl compiler targets the Perl runtime. The only differences I see are that the LLVM compiler compiles C and the Perl compiler compiles Perl, and the LLVM operates more closely to the hardware than the Perl runtime does.

GCC directly targets a variety of hardware. LLVM targets a VM layer that can make compiled code more portable.

Apples and Oranges in my book.
 
Old 05-19-2012, 02:48 AM   #22
rg3
Member
 
Registered: Jul 2007
Distribution: Slackware Linux
Posts: 498

Rep: Reputation: Disabled
Sorry, but that's far from being accurate at all. GCC has front-ends to different languages, and backends to multiple architectures. When the frontends run, they translate the code to an intermediate language or virtual machine, if you prefer, like RTL. GCC and LLVM, in that sense, work very similarly. Of course, internally they're very different, but just not in that concept.

http://en.wikipedia.org/wiki/Interme...uage#Languages
http://en.wikipedia.org/wiki/Register_Transfer_Language
 
Old 05-19-2012, 02:56 AM   #23
Martinus2u
Member
 
Registered: Apr 2010
Distribution: Slackware
Posts: 338

Rep: Reputation: 41
also, for historic reasons and for different optimization steps gcc employes a variety of internal representations of the code. of course, this doesn't help performance very much.
 
Old 05-19-2012, 05:35 AM   #24
leeeoooooo
Member
 
Registered: Jan 2009
Distribution: Slackware 14.0
Posts: 104

Rep: Reputation: 18
Quote:
Originally Posted by rg3 View Post
Sorry, but that's far from being accurate at all. GCC has front-ends to different languages, and backends to multiple architectures. When the frontends run, they translate the code to an intermediate language or virtual machine, if you prefer, like RTL. GCC and LLVM, in that sense, work very similarly. Of course, internally they're very different, but just not in that concept.

http://en.wikipedia.org/wiki/Interme...uage#Languages
http://en.wikipedia.org/wiki/Register_Transfer_Language
Yes but...

How GCC works internally isn't the point. The output is raw machine code. LLVM's compiler outputs bytecode to run on top of the LLVM, rather like the .Net languages which can't run without .Net

LLVM just has a much lower level of abstraction and so, can run much faster.
 
Old 05-19-2012, 06:01 AM   #25
GazL
Senior Member
 
Registered: May 2008
Posts: 3,231

Rep: Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828
Quote:
Originally Posted by leeeoooooo View Post
Yes but...

How GCC works internally isn't the point. The output is raw machine code. LLVM's compiler outputs bytecode to run on top of the LLVM, rather like the .Net languages which can't run without .Net
Code:
gazl@darkstar:/tmp$ cat >clang-test.c      
#include <stdio.h>
int main( int argc, char ** argv )
{
  printf("I'll be damned!\n");
  return 0;
}

gazl@darkstar:/tmp$ clang -o doesitwork clang-test.c
gazl@darkstar:/tmp$ ./doesitwork
I'll be damned!
gazl@darkstar:/tmp$ su -l root -c "removepkg llvm >/dev/null 2>&1 && echo llvm removed."
Password: 
llvm removed.
gazl@darkstar:/tmp$ ./doesitwork
I'll be damned!
gazl@darkstar:/tmp$

Last edited by GazL; 05-19-2012 at 06:03 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: GCC 4.6, LLVM/Clang 3.0, Open64 Benchmarks LXer Syndicated Linux News 0 11-07-2011 12:50 PM
LXer: Compiler Benchmarks Of GCC, LLVM-GCC, DragonEgg, Clang LXer Syndicated Linux News 0 11-08-2010 05:11 PM
LXer: Benchmarking LLVM & Clang Against GCC 4.5 LXer Syndicated Linux News 0 04-21-2010 02:30 PM
What is LLVM? MTK358 Programming 2 03-22-2010 05:55 AM
LXer: GCC vs. LLVM-GCC Benchmarks LXer Syndicated Linux News 0 09-04-2009 12:10 PM


All times are GMT -5. The time now is 06:18 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration