LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 03-20-2012, 12:56 AM   #16
ozanbaba
Member
 
Registered: May 2003
Location: İzmir
Distribution: Slackware64 15.0 Multilib
Posts: 778

Rep: Reputation: 135Reputation: 135

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
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
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: 542

Original Poster
Rep: Reputation: 50
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: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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: 542

Original Poster
Rep: Reputation: 50
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: Slackware64 14.2 (current)
Posts: 126

Rep: Reputation: 20
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: Fedora
Posts: 527

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: 497

Rep: Reputation: 119Reputation: 119
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: Slackware64 14.2 (current)
Posts: 126

Rep: Reputation: 20
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
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
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



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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:16 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration