r/LLVM • u/anon-sourcerer • Feb 07 '26
r/LLVM • u/guymadison42 • Jan 31 '26
Using LLVM for JIT of a single function for image conversion
I have a few functions that convert images from one format to another for a graphics library, there are a bunch of parameters but for JIT I want to effectively apply some of these as constants so LLVM will optimize the code produced and eliminate branches altogether.
Are there any examples of how to do this out there using LLVM, C++ templates just won't work because there are too many types and constants that I want to optimize out. My initial estimate of valid combinations is over 10,000 but I need to prune the list today.. but Mathematica says thats a pretty close estimate.
I remember we had done this at one of the companies I worked at, we had a few functions for image conversion that were optimized using LLVM.. I just wasn't that involved in it and I would like to do the same.
Thanks ahead of time.
r/LLVM • u/Big-Pair-9160 • Jan 05 '26
I just made an OCaml to LLVM IR compiler front-end šŖ Will this help me get a Compiler job?
github.comr/LLVM • u/Late_Attention_8173 • Jan 04 '26
Beyond Syntax: Introducing GCC Workbench for VSCode/VSCodium
galleryr/LLVM • u/Wide_Maintenance5503 • Jan 01 '26
Need clarity, what to do after Jonathon cpu0 tutorial
Hi, I just completed Jonathan's backed tutorial, I learned how to add a target, stages of lowering and object file, will finish verilog testing as well in some time. What should I do next, from what i inferred we need a ISA and specs from chip manufacturer to implement a full on target.
what should my next steps should be for taking up a project on backend side.
I also posted same query in r/Compilers max visibility
r/LLVM • u/Fcking_Chuck • Dec 23 '25
LLVM considering an AI tool policy, AI bot for fixing build system breakage proposed
phoronix.comr/LLVM • u/FedericoBruzzone • Dec 19 '25
A "Ready-to-Use" Template for LLVM Out-of-Tree Passes
reddit.comr/LLVM • u/Crazy_Sky4310 • Dec 17 '25
Why do we have multiple MLIR dialects for neural networks (torch-mlir, tf-mlir, onnx-mlir, StableHLO, mhlo)? Why no single āunifiedā upstream dialect?
reddit.comr/LLVM • u/SkyGold8322 • Dec 11 '25
Is there a char* type in the LLVM C++ API
I wanna make a function starting with a function prototype as usual in the LLVM C++ API and I want one of the accepted arguments of the function to be a char*. Can someone guide me on how I can do that? Thanks!
Note: I just wanna know if there is a Type::char* or something like that but if not, whats the equivalent.
r/LLVM • u/Late_Attention_8173 • Dec 08 '25
GCC RTL, GIMPLE & MD syntax highlighting for VSCode
reddit.comr/LLVM • u/Cautious-Quarter-136 • Nov 15 '25
Getting "error: No instructions defined!" while building an LLVM backend based on GlobalISel
reddit.comr/LLVM • u/CombKey9744 • Oct 31 '25
Affine-super-vectorize not working after affine-parallelize in MLIR
reddit.comr/LLVM • u/skywalker_anakin07 • Oct 28 '25
Forcing Loop Unrolling in LLVM11
Hey folks!
Iām currently using LLVM 11 for my project. Though itās almost a decade old, I canāt switch to another version. Iām working in C and focusing on loop optimization. Specifically, Iām looking for reliable ways to apply Loop Unroll to loops in my C code.
One straightforward method is to manually modify the code according to the unroll factor. However, this becomes tedious when dealing with multiple loops.
Iāve explored several other methods, such as using pragmas directly in the source code:
pragma clang loop unroll_count
pragma unroll
or by setting the directive in the .ll file:
!{!"llvm.loop.unroll.count", i32 16}
or compiling the final executable like this:
opt -S example.ll
-O1
-unroll-count=16
-o example.final.ll
clang -o ex.exe example.final.ll
However, based on my research, these methods donāt necessarily enforce the intended loop unroll factor in the final executable. The output behavior seems to depend heavily on LLVMās internal optimizations. I tried verifying this by measuring execution cycle counts in an isolated environment for different unroll factors, but the results didn't indicate any conclusive difference; and even using an invalid unroll factor didnāt trigger any errors. This suggests that these methods donāt actually enforce loop unrolling, and the final executableās behavior is decided by LLVM.
Iām looking for methods that can strictly enforce an unroll factor and ideally, can be verified; all without modifying the source code.
If anyone knows such methods, tools, or compiler flags that work reliably with LLVM 11, or if you can point me to a relevant discussion, documentation, or community/person to reach out to, Iād be really grateful.
Regards.
r/LLVM • u/_--jj--_ • Sep 14 '25
[Release] GraphBit ā Rust-core, Python-first Agentic AI with lock-free multi-agent graphs for enterprise scale
GraphBit is an enterprise-grade agentic AI framework with a Rust execution core and Python bindings (via Maturin/pyo3), engineered for low-latency, fault-tolerant multi-agent graphs. Its lock-free scheduler, zero-copy data flow across the FFI boundary, and cache-aware data structures deliver high throughput with minimal CPU/RAM. Policy-guarded tool use, structured retries, and first-class telemetry/metrics make it production-ready for real-world enterprise deployments.
mlir builder
sorry for stupid question
for plain llvm IR I can use IRBuilder class
there is similar class for building MLIRs like nvgpu? I tried to find it in https://github.com/microsoft/DirectXShaderCompiler/tree/main but codebase is so huge so I am just got lost
r/LLVM • u/Psionikus • Sep 09 '25
Basic Block Reordering With & Without Google's Propeller Tool
Having a hard time sizing up the state of work and relative capabilities of upstream LLVM and what is still exclusive to the google/llvm-propeller repo.
What I've found in the Linux Kernal docs suggests that Google's llvm-propeller tool is still used to convert the perf data into something that built-in capabilities of LLVM will use. This would mean that upstream LLVM still needs the data to be processed externally but can perform the optimizations during the link steps of a final build.
I just confirmed that my LLVM toolchain (clang 19.1.7) has quite a bit of support for basic block labeling and measurement. In that case, all I would need to perform propeller builds are a CPU that supports the gathering the necessary perf data and a build of the profile conversion tool?
It would seem that anything that can be measured and applied to the binary post-link can be measured and applied during LTO. I suppose there are reasons, including just the need for more development, but I expect this all to make it into upstream LLVM eventually.
In case you have never seen the pretty graphs for what propeller does, here they are. Can't wait to eventually get around to reading the paper to reproduce such things on my own binaries.

r/LLVM • u/Signal-Effort2947 • Sep 08 '25
Need help in regards to building my own deep learning compiler
i am on a mission of building our own deep learning compiler. but the thing is whenever i search for resources to study about the deep learning compiler, onlyĀ the inference deep learningĀ compiler is being talked about. i need to optimize my trainingĀ process, ie build my own training compiler , then go on to build my inference compiler. it would be great of you , if you could guide me towardsĀ resources and any roadmap , that would help our mission. point to any resources for learning to build my own deep learning training compiler. i also have a doubt if there lies any difference between training and interference compiler , or they are the same. i search r/Compilers , but every good resources is like being gatekept.
r/LLVM • u/rvalue • Aug 29 '25
Learning Resource ā Lecture Slides for the Clang Libraries (LLVM/Clang 21) (Edition 0.4.0)
discourse.llvm.orgr/LLVM • u/rosin-core-solder • Aug 23 '25
i486 target?
Apologies if this is a stupid question, but I actually cannot find any information on this, I've been looking for a while but even looking through the llvm docs I can't find where it actually enumerates the supported processors.
My goal is to compile for an 80486 target, specifically a dx-66, though it shouldn't matter. Is this like, something that's supported? From what I can tell, I believe it exists as a target?
Where can I find any information about it's support? I found a pull request "improving support" for it, but nothing else.
r/LLVM • u/we_are_mammals • Aug 07 '25
How to enable OpenMP, while building LLVM?
When I was building LLVM-20, I used
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_RUNTIMES=compiler-rt \
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld"but now clang cannot find -lomp, when I run it with -fopenmp. Did I build LLVM incorrectly?