News for hackers. Stuff that matters.
Re:Intel C/C++ compilers complete adoption of LLVM by OskarS on Thursday August 12, 2021 @05:45AM (#28154147)
I'm not sure I love this. I mean, LLVM is awesome and everthing, but software monocultures are pretty bad. It's not like the situation is dire yet (given that there are also GCC and MSVC), but you can imagine a situation in a couple of years when Microsoft goes "yeah, we're also gonna go with LLVM now" and also GCC starting to fade away. It's a bit concerning.

Also: if icc is going to go with LLVM as a backend, then what is the point of using icc at all? Why not just use clang?

Re:Intel C/C++ compilers complete adoption of LLVM by MauranKilom on Thursday August 12, 2021 @05:55AM (#28154220)
> Also: if icc is going to go with LLVM as a backend, then what is the point of using icc at all? Why not just use clang?

From the blog post:

"Not all our optimization techniques get upstreamed—sometimes because they are too new, sometimes because they are very specific for Intel architecture. This is to be expected and is consistent with other compilers that have adopted LLVM."

I don't see any good technical reason in this marketing language though, tbh:

- "Our optimizations are too new" -> So put them behind a feature flag when upstreaming? And why inflict them on icx customers if they are "too new"? What does that even mean?

- "Our optimizations are architecture specific" -> ...yes? Emitting good architecture-specific code is the whole point of an optimizing compiler? How is that an argument against upstreaming?

- "Other compilers also don't upstream everything" -> That's a non-argument.

I get it, there's no money to be made in just implementing all your optimizations in clang directly. But these reasons (together with the repeated emphasis of how they do contribute to LLVM) seem silly. To be clear, I'm all for Intel helping improve LLVM, but the technical arguments for maintaining a separate commercial version don't convince me at all.

Re:Intel C/C++ compilers complete adoption of LLVM by volta83 on Thursday August 12, 2021 @06:04AM (#28154290)
What that sentence actually means is "we don't want to help our competition (AMD, NVIDIA) but we don't want to re-implement the wheel".

The API and fundamental part of LLVM is its IR, LLVM-IR, which is where most optimizations happen.

From this point-of-view, LLVM is a "platform", and an extremely brittle one: every release has breaking changes to the IR, the IR is constantly evolved to support new hardware and new optimizations, etc.

When you build a tool on top of LLVM, you are buying into this rapidly changing platform.

The only proven way of using the LLVM platform competitively is to be part of its future: follow upstream closely, upstream most of your code, and actively participate in the platform evolution so that your competitors can't turn it against you.

If you keep most of your code private, following upstream gets very hard. You skip one release, and then its 10x harder, so you skip another release and stop participating in LLVM's evolution cause you'll have to wait years for changes to upstream to land on your compiler. Your competitors do what's best for them, and those can be things that are bad for you, and then you are proper screwed, cause you can't migrate away from LLVM either.

Companies like Intel and NVIDIA do this, e.g., nvcc and ISPC are stuck on LLVM 7 (~4 years old), but these companies have built huge technology stacks like CUDA or DPC++ on top of it!

Intel and NVIDIA might have enough manpower to maintain their own outdated fork of LLVM forever, but at some point it just stops being LLVM, and these companies are not really much better off than where they started.

IMO, building all your technology on top of a platform that either is or can be under your competitors control is just a really bad idea.

One would hope that these companies would realize this and contribute back and help the community as much as possible, but in practice they just don't. By the time they realize it, it's already too late.

Re:Intel C/C++ compilers complete adoption of LLVM by floatboth on Thursday August 12, 2021 @07:59AM (#28155116)
ISPC is not stuck on LLVM 7. Only fails on 12 currently, works on 11 and earlier:

https://github.com/freebsd/freebsd-ports/blob/85cccf4f15c42d...

But hopefully that will be fixed soon.

Re:Intel C/C++ compilers complete adoption of LLVM by volta83 on Thursday August 12, 2021 @09:06AM (#28155765)
+1 thanks for the correction, should have verified this. Last time I used ISPC it was using an extremely outdated LLVM version (5) or so, and it took years to move it to LLVM 7. I wasn't aware that they have been slowly migrating to newer LLVM versions.
Re:Intel C/C++ compilers complete adoption of LLVM by thereddaikon on Thursday August 12, 2021 @11:15AM (#28157371)
I think its even simpler than that. They don't want to reveal any of their secret sauce through available source be it tipping off competitors to hardware designs or just revealing compiler optimizations they believe are valuable enough to keep as trade secrets. Why would they make AMD's job easier?

Intel's C compiler has always played games with non-intel x86 architectures compared to their own.

Re:Intel C/C++ compilers complete adoption of LLVM by varajelle on Thursday August 12, 2021 @06:51AM (#28154606)
Same thing with C++Builder whose last version from this year is still based on LLVM 5, I think. Even Apple's clang is behind LLVM upstream if I'm not mistaken.

The joy of permissive licenses!

Re:Intel C/C++ compilers complete adoption of LLVM by floatboth on Thursday August 12, 2021 @07:56AM (#28155105)
Copyleft licenses have no way of forcing anyone to follow upstreams more closely.

Android is a great example. Typical Qualcomm/Mediatek/etc. behavior: take a "stable" kernel, stuff it with custom undocumented drivers and junk, be stuck on that version forever. The only thing the GPL changes is the vendor posts a source dump of dubious usefulness in some obscure section of their website.

Re:Intel C/C++ compilers complete adoption of LLVM by qayxc on Thursday August 12, 2021 @08:12AM (#28155228)
> Android is a great example. Typical Qualcomm/Mediatek/etc. behavior: take a "stable" kernel, stuff it with custom undocumented drivers and junk, be stuck on that version forever.

I don't think that's such a great example in this context.

Qualcomm, Mediatek, etc. are hardware vendors after all. Software to them is a necessary evil, not a reason d'être or complementary tool (as it is for NVIDIA and Intel). Their customers fall in the same category - smartphone manufacturers want to sell units, not keep software up-to-date.

Re:Intel C/C++ compilers complete adoption of LLVM by jitl on Thursday August 12, 2021 @08:24AM (#28155340)
Intel and NVIDIA make their money selling hardware.
Re:Intel C/C++ compilers complete adoption of LLVM by qayxc on Thursday August 12, 2021 @09:01AM (#28155708)
> "NVIDIA is a software-defined company today," Huang said, "with rich software content like GeForce NOW, NVIDIA virtual workstation in the cloud, NVIDIA AI, and NVIDIA Drive that will add recurring software revenue to our business model."

https://www.msn.com/en-us/money/technologyinvesting/nvidia-i...

It's a very similar story for Intel. NVIDIA and Intel are selling hardware because of their software portfolio. How many GPUs would NVIDIA sell in the HPC market if it wasn't for CUDA and the various support libraries around it?

Intel's non-client solution revenue was over 40% of their total revenue in 2020. This includes their (software-) AI solutions, applications, licence business and services. So Intel, too makes a significant amount of money from software and services around their software ecosystem.

Re:Intel C/C++ compilers complete adoption of LLVM by volta83 on Friday August 13, 2021 @01:07PM (#28171607)
> How many GPUs would NVIDIA sell in the HPC market if it wasn't for CUDA and the various support libraries around it?

We don't have to hypothesize about this. The HPC GPU market has multiple vendors, just look at how many HPC GPUs AMD or Intel are selling: AMD and Intel have ~0.8% or so market share. NVIDIA has >99%.

Pretty much every review of HPC GPUs states that AMD GPUs are both faster and cheaper.

So how come they don't sell?

The answer is software.

Re:Intel C/C++ compilers complete adoption of LLVM by varajelle on Thursday August 12, 2021 @08:44AM (#28155526)
Yes that's true, the licence alone is not enough.

That said, this "junk" dump can still be used by the community of users to upgrade themselves the software on that hardware, so that's still a nice improvement.

Back to LLVM the question is whether these companies decide to not contribute upstream because they don't bother to make clean patches or because they want to keep it for themselves.

I'd argue that they would be much better off long-term making clean patches anyway, so that's not a valid reason for not contributing.

And even if theynjust dumped their patches, the community could still take them and incorporate nice optimization into upstream.

Re:Intel C/C++ compilers complete adoption of LLVM by beached_whale on Thursday August 12, 2021 @11:46AM (#28157773)
Apple's is up to 6mo old at release, so currently around clang10/11. Every so often it gets 2 releases behind as they are both on 6mo cycles. It's not bad really and currently Clang 12 brings few compelling reasons to upgrade. The issue will be Clang 13 is supposed to have a bunch of C++20 things, I think, and it will also be one of those ones that has a long time before Apple releases their next one.
Re:Intel C/C++ compilers complete adoption of LLVM by zetalyrae on Thursday August 12, 2021 @07:53AM (#28155078)
>The only proven way of using the LLVM platform competitively is to be part of its future: follow upstream closely, upstream most of your code, and actively participate in the platform evolution so that your competitors can't turn it against you.

>If you keep most of your code private, following upstream gets very hard. You skip one release, and then its 10x harder, so you skip another release and stop participating in LLVM's evolution cause you'll have to wait years for changes to upstream to land on your compiler. Your competitors do what's best for them, and those can be things that are bad for you, and then you are proper screwed, cause you can't migrate away from LLVM either.

This is an interesting take. I've heard the claim that GCC kept its codebase cryptic to prevent companies running home with it and not upstreaming changes, maybe that's LLVM's strategy.

Re:Intel C/C++ compilers complete adoption of LLVM by volta83 on Friday August 13, 2021 @04:54AM (#28166859)
This is not really a strategy, but rather a consequence of LLVM having hundreds of developers, most of which use LLVM upstream, and therefore don't care about maintaining an API compatibility that they themselves do not need.

It turns out that it is impossible to convince people working on LLVM on their free time or academics to invest part of their time on "preserving" API compatibility instead of adding new features, fixing bugs, or improving perf, for the benefit of companies that don't want to contribute their improvements to the community.

Re:Intel C/C++ compilers complete adoption of LLVM by infogulch on Thursday August 12, 2021 @10:01AM (#28156468)
I like this strategy to encourage contributing back to open source by being a huge and foundational and producing so fast that the cost of forking is almost never worth it except in extreme circumstances. This feels more like voluntary cooperation than being smacked in the face with ~~the book~~ a license. Though I suppose it wouldn't always work if you're not a big project with lots of contributions.
Re:Intel C/C++ compilers complete adoption of LLVM by pjmlp on Thursday August 12, 2021 @07:24AM (#28154871)
Besides C++ Builder already referred in a sibiling comment, that is how you get stabilitiy on bitcode for watchOS apps.
Re:Intel C/C++ compilers complete adoption of LLVM by CJefferson on Thursday August 12, 2021 @06:49AM (#28154593)
You over-estimate how much LLVM might want Intel's code dumps.

Based on (minor) personal experience of gcc forks, it's not unusual to make some fairly significant change to some major data structure to make your CPU work better, but which would break several other backends.

There may not be any nice way of integrating these changes in a way which would make the acceptable upstream, without multi-months of work refactoring huge chunks of the compiler (which would still also need lots of work on all those other architectures, to make them compatible with your changes).

Re:Intel C/C++ compilers complete adoption of LLVM by account42 on Thursday August 12, 2021 @07:40AM (#28154993)
> sometimes because they are very specific for Intel architecture

Like the famous check-for-intel-model-instead-of-feature-flag optimization? [0]

[0] https://www.agner.org/optimize/blog/read.php?i=49#49

Re:Intel C/C++ compilers complete adoption of LLVM by UncleOxidant on Thursday August 12, 2021 @01:53PM (#28159340)
I never understood why Intel sold their compilers anyway. The revenue from compilers must be a tiny drop in Intel's revenue bucket. And if you're fine tuning your compiler to work best with your architecture it seems like you'd want to be giving that away to further promote sales of your chips.

Now that they're using LLVM they should just upstream everything to the LLVM project and quit selling icc.

Re:Intel C/C++ compilers complete adoption of LLVM by pengaru on Thursday August 12, 2021 @05:35PM (#28161819)
I agree they should upstream everything to gcc/clang to make their processors smoke the competition, but always assumed icc being a paid-for product came with additional support and access to Intel's expertise in using their tools and processors.
Re:Intel C/C++ compilers complete adoption of LLVM by fsloth on Thursday August 12, 2021 @06:14AM (#28154351)
"I get it, there's no money to be made in just implementing all your optimizations in clang directly."

Sounds really shortsighted. I would imagine revenue from Intel dev tools is a rounding error in Intel's complete revenue stream?

Re:Intel C/C++ compilers complete adoption of LLVM by kevin_thibedeau on Thursday August 12, 2021 @11:48AM (#28157791)
It's a marketing tool to make their competitors look bad. That it is sometimes useful is a secondary side effect.
Re:Intel C/C++ compilers complete adoption of LLVM by CalChris on Thursday August 12, 2021 @12:23PM (#28158232)
The Intel post didn't say "Other compilers also don't upstream everything". So you shouldn't put that in quotes.

However, that is an actual argument. This isn't GCC where that would be required. This is LLVM where that is allowed. This is a choice, Intel's choice, because LLVM allows that, and it's probably at the corner case level of an Intel-specific icc-specific feature, as in, not particularly generally useful.

There is a benefit of this for normal LLVM development as well. It means that Intel is responsible for maintaining it and normal LLVM developers aren't. If I do something that breaks something in the LLVM AMD GPU backend, that's on me. If I do something that breaks something in Intel's code, that's on them.

Re:Intel C/C++ compilers complete adoption of LLVM by formerly_proven on Thursday August 12, 2021 @06:29AM (#28154461)
> I get it, there's no money to be made in just implementing all your optimizations in clang directly.

ICC Classic is legacy/dead and also free now. The LLVM-based DPC++ compilers are free as well. These are only making money indirectly and through support contracts.

Re:Intel C/C++ compilers complete adoption of LLVM by pjmlp on Thursday August 12, 2021 @07:26AM (#28154887)
Yeah, but if you give all the golden eggs away, others can offer support contracts as well.
Re:Intel C/C++ compilers complete adoption of LLVM by bluGill on Thursday August 12, 2021 @08:47AM (#28155557)
They can, but who knows more about the issue in question, Intel who designed it, or a third party? This is also a curse to Intel though: they need to ensure their people actually know something, level one support with a bad script and no access to anyone with more ability will get caught quickly when the third party offers better support and generally can figure things out.

There are pros and cons for sure. I'm not sure what it best.

Re:Intel C/C++ compilers complete adoption of LLVM by phkahler on Thursday August 12, 2021 @10:57AM (#28157115)
>> I'm all for Intel helping improve LLVM, but the technical arguments for maintaining a separate commercial version don't convince me at all.

This is exactly why GCC is GPL and why RMS didn't want to make it more modular. Taken to the extreme we could end up with proprietary hardware that requires a proprietary (closed) compiler even though it's built on open source. Going back to "trusting trust" things might not be so good, and we know Intel is happy to build untrustworthy chips.

Re:Intel C/C++ compilers complete adoption of LLVM by DSingularity on Thursday August 12, 2021 @11:04AM (#28157211)
What does “trusting trust” have to do with this? That problem is a bootstrapping problem when trying to establish a trusted base. Simple summary is: if the first compiler was backdoored to detect when it is compiling other versions of itself and then inserting the same backdoor in the assembly of the target then how can you trust anything compiled by it?
Re:Intel C/C++ compilers complete adoption of LLVM by phkahler on Friday August 13, 2021 @09:32AM (#28168611)
You're right, the "trusting trust" compiler hack is way more complicated.
Re:Intel C/C++ compilers complete adoption of LLVM by simondotau on Thursday August 12, 2021 @08:17AM (#28155265)
LLVM is a somewhat modular system. If Microsoft decided to build their own MSVC front end and AMD decided to build their own AMD64 back end, and Intel decided to build their own special set of x64 optimisers, is it really a monoculture? That sounds more like the GNU form of real software diversity—where you can make your own perfect tool by assembling it from parts.
Re:Intel C/C++ compilers complete adoption of LLVM by ainar-g on Thursday August 12, 2021 @01:48PM (#28159280)
> and AMD decided to build their own AMD64 back end

They kind of already did. And it's on LLVM, too.

https://developer.amd.com/amd-aocc/

Re:Intel C/C++ compilers complete adoption of LLVM by pjmlp on Thursday August 12, 2021 @05:49AM (#28154172)
Because not everything on icc is going to be upstreamed to clang, thanks license.

It is not like clang is enjoying C++ Builder RAD abilities, PS 4 and 5 optimizations, or bitcode format used by watchOS.

Re:Intel C/C++ compilers complete adoption of LLVM by ytch on Thursday August 12, 2021 @05:57AM (#28154238)
Yeah, I guess LLVM is preferred mostly because license.

Companies can keep their optimizations in secrets. Just like why Playststion's OS is based on BSD.

Re:Intel C/C++ compilers complete adoption of LLVM by glangdale on Thursday August 12, 2021 @06:44AM (#28154568)
LLVM is also preferred because it has much cleaner internals than gcc (although gcc has gotten hugely better over the years). And of course, all production compilers become monumentally complex over the years (I once worked with Open64 - gah).
Re:Intel C/C++ compilers complete adoption of LLVM by floatboth on Thursday August 12, 2021 @08:03AM (#28155150)
It's nearly impossible to keep optimizations secret. They are the easiest thing in the world to reverse engineer: just look at the output assembly. (And you can't exactly output obfuscated assembly because that would make the performance worse, nullifying the benefits of the optimizations.)
Re:Intel C/C++ compilers complete adoption of LLVM by simondotau on Thursday August 12, 2021 @08:20AM (#28155298)
Though in a practical sense, if you've done the work of implementing useful optimisations and keep them closed source, it's not necessarily a trivial matter for others to recognise and replicate how exactly your optimisation is implemented, when it can be used, when it can't be, etc.
Re:Intel C/C++ compilers complete adoption of LLVM by dragontamer on Thursday August 12, 2021 @12:19PM (#28158177)
I don't get it.

Looking at output assembly language won't tell me anything about the algorithms behind solving the register allocation problem (aka: live data problem, which is a knapsack problem and/or graph-coloring problem IIRC).

I'd be able to see that yes, compilers are good at deciding which registers should hold which data. But that's not sufficient at actually learning how the algorithm / register selection process works.

Re:Intel C/C++ compilers complete adoption of LLVM by mshockwave on Thursday August 12, 2021 @01:20PM (#28158954)
that is for the simpler optimization. A more complicate optimization algorithm can generate quite different code depending on the inputs. So you might need many different input codes to fully explore the internal, similar to the problem facing by fuzzing and/or symbolic execution.
Re:Intel C/C++ compilers complete adoption of LLVM by Ar-Curunir on Thursday August 12, 2021 @12:25PM (#28158261)
I don’t think the license meaningfully changes anything. For example: rustc has a WIP GCC backend, despite not being GPL. I imagine icc could do something similar
Re:Intel C/C++ compilers complete adoption of LLVM by zetalyrae on Thursday August 12, 2021 @05:47AM (#28154160)
>Also: if icc is going to go with LLVM as a backend, then what is the point of using icc at all? Why not just use clang?

I assumed the icc secret sauce was in the backend: deep knowledge of how each and every single operation is implemented in every uarch.

Maybe they've written their own x86 backend for LLVM, and are using the rest of LLVM for IR->IR transformations and vectorization?

Re:Intel C/C++ compilers complete adoption of LLVM by mshockwave on Thursday August 12, 2021 @01:24PM (#28158996)
Exactly, many comments here are saying the difference is in LLVM IR ("middle-end") optimizations but IMHO more secrets are hidden in the backend. For example the latency of different instructions (and their operands) which has huge impact on the overall scheduling.
Re:Intel C/C++ compilers complete adoption of LLVM by fay59 on Thursday August 12, 2021 @11:30AM (#28157573)
I like to think of LLVM as a piece of infrastructure, like neutral fiber wiring that any ISP is allowed to use. From that perspective, I’m a lot less concerned about having few options that I am about browsers.

Although the diversity of C/C++ compilers is descending, the number of compiler backends in general is still pretty high (Go, .NET compilers & runtimes, Java compilers & runtimes, JS engines, etc), and LLVM can’t fill all the niches. I don’t think that we’re at a point where research is stifled.

Re:Intel C/C++ compilers complete adoption of LLVM by phendrenad2 on Thursday August 12, 2021 @12:46PM (#28158554)
Everyone says software monocultures are bad, without evidence. In fact, there seems to be evidence against this: the Linux kernel.
Re:Intel C/C++ compilers complete adoption of LLVM by zamadatix on Thursday August 12, 2021 @05:11PM (#28161534)
The Linux kernel isn't a monoculture yet. For example there is no indication Apple or the BSDs are going to stop developing their kernels nor is there indication Windows is dropping NT and most anything can/is easily moved between them (particularly the *NIX kernels) still. That doesn't mean there are certain places the only choice is the Linux kernel but that alone isn't enough to make it a monoculture in this sense of nearing domination of the space.

Browsers are the most oft cited example of monoculture issues be it the old days with IE or the new days with Chrome, I'm surprised you haven't run across comments on that one over the years.

Re:Intel C/C++ compilers complete adoption of LLVM by phendrenad2 on Thursday August 12, 2021 @08:00PM (#28163436)
Linux powers most of the internet, most mobile devices, and most embedded and IoT devices. Maybe it's not a complete monopoly, but it's close.
Re:Intel C/C++ compilers complete adoption of LLVM by pjmlp on Friday August 13, 2021 @03:06AM (#28166301)
Except it doesn't, go check termux's future on Android, as its developers refuse to adopt the Java APIs that are actually what it public on Android (Linux kernel syscalls aren't a public API).

https://developer.android.com/ndk/guides/stable_apis

Re:Intel C/C++ compilers complete adoption of LLVM by lucozade on Thursday August 12, 2021 @05:49AM (#28154170)
> Also: if icc is going to go with LLVM as a backend, then what is the point of using icc at all?

They're not upstreaming all their optimisations. I'd be surprised if they upstreamed all their FPGA support as well.

Re:Intel C/C++ compilers complete adoption of LLVM by zozbot234 on Thursday August 12, 2021 @05:55AM (#28154218)
> They're not upstreaming all their optimisations

That's quite reassuring for users of LLVM on non-Intel hardware, where ICC "optimisations" turn into pessimisations.

Re:Intel C/C++ compilers complete adoption of LLVM by mumblemumble on Thursday August 12, 2021 @09:15AM (#28155875)
The recent CPPCast episode on LFortran might shed some light on that?

https://cppcast.com/lfortran/

In it, the guest talks about how he couldn't rely on LLVM for things like optimizing array operations; LLVM apparently does a poor job of that so he had to implement his own. Given that one of the key selling points of Intel's compiler is that it does a better job with SIMD optimizations, it may be exactly the same story here.

Re:Intel C/C++ compilers complete adoption of LLVM by jabl on Friday August 13, 2021 @02:26AM (#28166068)
Without listening to that podcast, I'm gonna go out on a limb and say this is a slightly Fortran-specific problem (or at least, not at problem encountered for C or C++), namely how to optimize Fortran array expressions.

The LLVM IR doesn't understand array operations, so the Fortran frontend must 'scalarize' the array expressions, that is, turn them into the equivalent loops. Only after that can the LLVM middle and back-ends try to vectorize that scalar IR for execution on SIMD (or vector, or GPU) HW. The problem is that this scalarization loses some information, and thus for good performance on array code the Fortran frontend must implement some optimizations on array operations before scalarizing.

There is an LLVM subproject called MLIR (https://mlir.llvm.org/ ) that aims to build a higher level IR that understands arrays, and can be useful for things like optimizing deep learning graphs, but also things like Fortran frontends could make use of it. AFAIK the flang Fortran project aims to make use of it, but I haven't followed development that closely.

Re:Intel C/C++ compilers complete adoption of LLVM by frjalex on Thursday August 12, 2021 @10:43AM (#28156931)
I'd imagine it'd be hard for MSVC and gcc to fade away --- gcc has some notable architectural differences from llvm (such as having multiple, layered IRs) and on some optimizations gcc is stronger. While for MSVC they target Microsoft's own ABI. Unlike other technologies that already feature a monocultural landscape I guess it's fair to say there's no one, single, best way to design a compiler that accounts for the wide-ranging differences of backend architectures and frontend languages (in addition, when you compare the costs of developing a brand new compiler with say, developing a new CPU architecture, you'll find the price associated with the former is much more affordable, and might be reasonable under different circumstances).
Re:Intel C/C++ compilers complete adoption of LLVM by lhorie on Thursday August 12, 2021 @11:29AM (#28157547)
Is gcc really starting to fade away? Wasn't Rust working on some backend interop with it? That shiny cool Cosmopolitan thingie was also built on top of it IIRC.

I was also under the impression GCC still outputs better asm than LLVM overall.

Conversely, I recall reading the zig team ran into some woes with the latest LLVM release, and that there's a lot of churn in LLVM APIs from version to version.

(I'm legitimately curious)

Re:Intel C/C++ compilers complete adoption of LLVM by andi999 on Thursday August 12, 2021 @05:47AM (#28154157)
Yes, I think though gcc will go first.
Re:Intel C/C++ compilers complete adoption of LLVM by nly on Thursday August 12, 2021 @06:03AM (#28154284)
GCC will never completely die. MS though have been moving in the Clang/LLVM direction for years, so I would have zero surprise if VC++ was completely removed tomorrow.

My feeling is, as soon as they can be sure they have achieved 100% binary compatibility, MS will jump. The optimizers in VC++ are light years behind, and companies like Apple are embarrassing them on the compatibility front with things like Rosetta 2 (which is a much harder problem to solve)

Re:Intel C/C++ compilers complete adoption of LLVM by andi999 on Thursday August 12, 2021 @06:16AM (#28154365)
My understanding was the llvm was made because the code basis of gcc is too complicated. Since seems to be a killer move.
Re:Intel C/C++ compilers complete adoption of LLVM by vlovich123 on Thursday August 12, 2021 @06:47AM (#28154581)
That was a long time ago and the actual primary reason was apparently Stallman missed an email [1], although I think the intentional technical hurdles to plugins was another of many reasons. When GNU moved all their software to GPLv3 and the business community decided they didn’t like that license and Apple brought LLVM as a serious contender.

GCC hasn’t remained stagnant though.

[1] https://lwn.net/Articles/632062/

Re:Intel C/C++ compilers complete adoption of LLVM by andi999 on Friday August 13, 2021 @01:16AM (#28165713)
Thanks for the article, I am not sure I fully understand it. Could you point to the section about the missed email? Also, do I understand it right, that emacs doesnt integrate well with llvm? (maybe that explains why in llvm presentations ppl use the 'other' editor, I always wondered why not use emacs)
Re:Intel C/C++ compilers complete adoption of LLVM by vlovich123 on Friday August 13, 2021 @12:21PM (#28170941)
> An interesting side note to the debate emerged when Liang Wang posted about LLVM creator Chris Lattner's offer to try to get LLVM's copyright assigned to the FSF back in 2005. It was part of an effort (that seemingly went nowhere) to integrate LLVM and GCC. Stallman never heard about the message:

So basically, if Stallman hadn't have missed the message, there's a very real possibility that LLVM would have ended up licensed under GPLv2 & then re-licensed to GPLv3. The engineering world would probably look radically different if that had happened.

Re:Intel C/C++ compilers complete adoption of LLVM by pjmlp on Thursday August 12, 2021 @07:28AM (#28154900)
That was ions ago, and if not for anything else, Linux kernel will keep GCC around.

Azure Sphere OS is also GCC only, despite Microsoft's new foundled love for clang.

Re:Intel C/C++ compilers complete adoption of LLVM by account42 on Thursday August 12, 2021 @08:09AM (#28155199)
There is significant investment in building Linux with Clang so I wouldn't count on Linux keeping GCC relevant forever. Doubly so with the inevitable rustc requirement.
Re:Intel C/C++ compilers complete adoption of LLVM by belgesel on Thursday August 12, 2021 @10:56AM (#28157104)
Isn't that the other way around? I thought clang was trying to support all gcc extensions to be able to build Linux kernel.

I would rather see both of these compilers to stay competitive to push themselves higher.

Re:Intel C/C++ compilers complete adoption of LLVM by jabl on Friday August 13, 2021 @02:28AM (#28166085)
Kind of both. They've added some gcc-specific extensions to clang, but also removed some gcc-ism's from the Linux kernel.
Re:Intel C/C++ compilers complete adoption of LLVM by pjmlp on Thursday August 12, 2021 @01:04PM (#28158801)
clang already builds Linux kernel on Mountain View dungeons, and it has been doing that for a couple of years now.

Those changes just don't get to upstream.

Re:Intel C/C++ compilers complete adoption of LLVM by rincebrain on Thursday August 12, 2021 @04:52PM (#28161305)
That's...not true?

https://www.kernel.org/doc/html/latest/kbuild/llvm.html

I could be missing something, but I don't see any suggestion that you need a specific forked tree with patches to build with LLVM, and I've seen people filing bugs about using LLVM sanitizers to build the vanilla tree, so I don't think the expectation is that you need to apply a huge out of tree patchset for this to work any more?

Re:Intel C/C++ compilers complete adoption of LLVM by yyyk on Thursday August 12, 2021 @07:19PM (#28162978)
There's an semi-official github[0] for this.

AFAICT from the issues page, Clang and binutils/LLVM tools work fine with no patches for the mainstream archs and when not trying to be super-fancy with custom flags. The more non-mainstream one goes with arch or flags the more likely one will run into something.

[0] https://github.com/ClangBuiltLinux/linux/issues (Note they use github for issues/wiki, not code, so no surprise the 'linux version' in code is oldish).

Re:Intel C/C++ compilers complete adoption of LLVM by pjmlp on Thursday August 12, 2021 @05:35PM (#28161812)
I follow Android, not Linux itself.

My latest update was that not all patches were accepted upstream, or Google didn't care about upstreaming them, whatever.

There are some Linux Plumbers talks, or from Linaro, about this a years back.

Re:Intel C/C++ compilers complete adoption of LLVM by pjmlp on Thursday August 12, 2021 @08:28AM (#28155375)
The ongoing efforts to add a Rust frontend to GCC prove otherwise.

No Rust in GCC? No play.

Re:Intel C/C++ compilers complete adoption of LLVM by account42 on Thursday August 12, 2021 @08:47AM (#28155558)
Unlike C/C++, there is one canonical rustc where the language is developed and GCC will likely always play catch up.
Re:Intel C/C++ compilers complete adoption of LLVM by pjmlp on Thursday August 12, 2021 @09:48AM (#28156290)
It doesn't matter, if only GCC gets to play with Linux kernel.

Rust is only following down the footsteps of D and Go.

Re:Intel C/C++ compilers complete adoption of LLVM by pjmlp on Thursday August 12, 2021 @11:28AM (#28157544)
Android Linux fork compiles with clang for ages now. Upstream doesn't want them.
Re:Intel C/C++ compilers complete adoption of LLVM by riffraff on Thursday August 12, 2021 @07:57AM (#28155109)
Why would the Linux kernel keep GCC around?

I'm fairly confident the FSF would keep it alive for a long time, but I don't see why it would be necessarily be a priority for the Linux devs to keep GCC forever.

Re:Intel C/C++ compilers complete adoption of LLVM by pjmlp on Thursday August 12, 2021 @08:01AM (#28155132)
Linux kernel makes use of GCC C, not ISO C, also targets hardware that LLVM doesn't support.

Android Linux kernel fork actually builds with clang, and Linux kernel is yet to accept the changes made by Google.

Re:Intel C/C++ compilers complete adoption of LLVM by malkia on Thursday August 12, 2021 @11:46AM (#28157772)
There are probably lots of MSVC specific extension (COM, C++/CLR, some pragma file_hash-ing https://www.reddit.com/r/cpp/comments/ep77ey/cl_ph_or_pragma... that would neeed to get ported) - just some examples that come to mind.
Re:Intel C/C++ compilers complete adoption of LLVM by TillE on Thursday August 12, 2021 @12:05PM (#28157996)
They could deprecate most of that stuff and let the old compiler still exist for those who need it, much like how they've been handling XP compatibility for the past several years.

But I see no signs of MSVC going away any time soon; Microsoft has a very active and capable compiler team.

Re:Intel C/C++ compilers complete adoption of LLVM by fomine3 on Thursday August 12, 2021 @02:01PM (#28159430)
But they also had active and capable browser engine team, isn't it?
Re:Intel C/C++ compilers complete adoption of LLVM by spookthesunset on Thursday August 12, 2021 @11:00AM (#28157160)
I mean GCC kinda picked their path back when they made it hard to be modular. The market has spoken and looks like LLVM made the right call.
Re:Intel C/C++ compilers complete adoption of LLVM by knxl on Thursday August 12, 2021 @06:00AM (#28154260)
> Why not just use clang?

Because clang is painful to use.

Re:Intel C/C++ compilers complete adoption of LLVM by nsizx on Thursday August 12, 2021 @08:10AM (#28155204)
GCC still has time to relicence if they want to survive.
Re:Intel C/C++ compilers complete adoption of LLVM by GuB-42 on Thursday August 12, 2021 @12:01PM (#28157946)
Why would GCC relicense? It exists for the license, not the other way around.

The entire point of GCC and the GNU project is to have an entire system with only free software, and the way to achieve that is not by allowing in more proprietary code.

Let GCC die if it has to die, but changing the license would make it meaningless.