Announcement

Collapse
No announcement yet.

Rust GCC Code Generator "rustc_codegen_gcc" Can Now Bootstrap Rustc

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Rust GCC Code Generator "rustc_codegen_gcc" Can Now Bootstrap Rustc

    Phoronix: Rust GCC Code Generator "rustc_codegen_gcc" Can Now Bootstrap Rustc

    A huge milestone has been reached in the rustc_codegen_gcc effort that aims to offer a GCC-based Rust compiler alternative to the LLVM-based official Rust compiler...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    Boomers: Just pull yourselves up by your bootstraps.

    GCC: Hold my beer.

    Comment


    • #3
      Before anybody is asking: there are currently two efforts for code generation via GCC. This news is about the GCC backend of the official rust compiler. Everything is written in Rust and lives in rustc's git repo - well, except gcc's libgccjit.

      The other effort is written in c++ and will live in gcc's repo. Along with libgccjit.

      Comment


      • #4
        So this LLVM backend to export GCC-JIT could be used with any LLVM frontend like a converter between LLVM-IR and GCC-JIT? Would be interesting to see how much performance can be squeezed out when applying LLVM's optimizations and afterwards GCC one's.

        Comment


        • #5
          Originally posted by darkdragon-001 View Post
          So this LLVM backend to export GCC-JIT could be used with any LLVM frontend like a converter between LLVM-IR and GCC-JIT? Would be interesting to see how much performance can be squeezed out when applying LLVM's optimizations and afterwards GCC one's.
          The
          Code:
          rustc_codegen_gcc
          project is a backend for
          Code:
          rustc
          , not for LLVM. It translates
          Code:
          rustc
          ’s “MIR” into GIMPLE rather than into LLVM IR. So no, it can't be used the way you describe.

          Comment


          • #6
            Originally posted by darkdragon-001 View Post
            So this LLVM backend to export GCC-JIT could be used with any LLVM frontend like a converter between LLVM-IR and GCC-JIT? Would be interesting to see how much performance can be squeezed out when applying LLVM's optimizations and afterwards GCC one's.
            It doesn't use LLVM-IR at all, it translates directly from rustc's internal IR (MIR) to gcc-jit.

            Comment


            • #7
              After reading [1] I really have to wonder if the output is truly correct or how they can verify correctness. Does the GCC IR even support the necessary annotations and controls? Already GCC and LLVM can't agree on how a 128 bit integer is laid out in memory.

              [1] https://gankra.github.io/blah/c-isnt-a-language/

              Comment


              • #8
                I can’t say I’m seeing anyone clamouring for GCC hackery to be injected into rust

                Comment


                • #9
                  Originally posted by scottishduck View Post
                  I can’t say I’m seeing anyone clamouring for GCC hackery to be injected into rust
                  The goal seems to be the large number of targets GCC supports, which might help with kernel adoption down the road (rust can only be optional if it doesn't support all target architectures). But I agree, I think they're probably loosing a lot of control over the generated code and it's correctness.

                  Comment


                  • #10
                    Originally posted by Developer12 View Post

                    The goal seems to be the large number of targets GCC supports, which might help with kernel adoption down the road (rust can only be optional if it doesn't support all target architectures).
                    The kernel will be able to use rust for any architecture for which the code is appropriate. As (almost all) initial thinking is that rust is going to be introduced with hardware drivers, one only has to look at what architectures can support that hardware that the drivers will be targeted at. In practice, that is a small subset of the architectures (as no one is going to create something like a 800GbE ethernet card for the microblaze architecture)).

                    On the other hand, there are a lot of architectures (pretty much everything) for which rust code can, in some cases, be beneficial, and for which the vendors of the architecture have not yet decided to create back-ends for LLVM.
                    Last edited by CommunityMember; 02 April 2022, 05:16 PM.

                    Comment

                    Working...
                    X