Most active commenters

    88 points bwidlar | 12 comments | | HN request time: 1.215s | source | bottom
    1. sylware ◴[] No.42156716[source]
    Have a look at QBE as it may provide basic optimizations and some significant performant boost: cproc + QBE and I get 70% of gcc 13.2 -O2 speed in my benchmarks, tinycc is 2 times slower than gcc 13.2 -O2 in the same benchmarks (my benchmarks are very basic, but it shows...).

    We are talking gcc complexity is grotesque/absurd for those 30%, not to mention this is now brain damaged c++ (one of the biggest mistakes in open source software ever).

    I know QBE is for CPUs, but maybe there is something there for GPUs.

    replies(1): >>42160142 #
    2. jesse__ ◴[] No.42159230[source]
    Haven't actually used this project yet, but I occasionally stop by his stream on twitch. Legend.
    3. c1b ◴[] No.42160022[source]
    does this also already exist on llvm toolchain?
    replies(2): >>42160075 #>>42161939 #
    4. Conscat ◴[] No.42160075[source]
    Not really. LLVM does support compute mode SPIR-V, and _very_ recently graphics-mode SPIR-V which is being dogfooded by the highly WIP HLSL front-end in Clang (I couldn't get a trivial fragment shader to build with it a few weeks ago). Clang does not support compiling graphics-mode SPIR-V from C or C++.

    This seems similar to the Vulkan Clang Compiler (which is not in-tree of LLVM), although it has some interesting differences such as implementing shader functions with new specifiers like `__hcc_vertex` rather than repurposing attributes for it like `[[clang::annotate("shady::entry_point::vertex")]]`.

    replies(1): >>42161602 #
    5. Conscat ◴[] No.42160142[source]
    QBE has no support for SIMD last I looked into it, so I don't think it would be appropriate for an SPMD language. https://todo.sr.ht/~mpu/qbe/5

    It's common for shader compilers to invent their own IR, like Shadey and Slang IR.

    replies(1): >>42163510 #
    6. LegNeato ◴[] No.42161426[source]
    Similar project but for Rust: https://github.com/Rust-GPU/rust-gpu
    7. kimixa ◴[] No.42161602{3}[source]
    The Microsoft HLSL compiler for dx12+ is based on LLVM and supports spir-v output https://github.com/microsoft/DirectXShaderCompiler

    Though my understanding is that it's a complete hackjob stuck on an old version of LLVM, and not in a remotely upstream-able state and breaks other parts of the LLVM toolchain completely. I think there was talk about trying to clean that up at the same time as bringing the baseline version forward, but I have no idea about it's progress.

    replies(1): >>42162525 #
    8. pabs3 ◴[] No.42161939[source]
    There seems to be documentation about it:

    https://llvm.org/docs/SPIRVUsage.html

    9. binary132 ◴[] No.42162067[source]
    This looks very promising on the surface. I wonder how it compares to clspv?
    10. pjmlp ◴[] No.42162525{4}[source]
    The progress is that DirectX will also support SPIR-V, going forward.

    https://devblogs.microsoft.com/directx/directx-adopting-spir...

    11. rurban ◴[] No.42163510{3}[source]
    That link just says that the maintainer of the fork mpu for hare has no will nor abilities to add full SIMD support. But qbe is still written and maintained by Brian Callahan here: https://c9x.me/compile/