I've started playing with LLVM, making a pet language. I'm using the C-API. I have a parser and basic AST, but I am at a bit of a road block with LLVM ...
I've started playing with LLVM, making a pet language. I'm using the C-API. I have a parser and basic AST, but I am at a bit of a road block with LLVM ...
I'm relatively new to LLVM, and I'm attempting to generate LLVM IR that calls a C function (growDictionary). This is on x86_64 Linux, using llvm 12: ...
Trying to generate a very simple object file with LLVM-C. Unfortunately I'm still stuck on "TargetMachine can't emit a file of this type" tried reorde ...
The LLVM MISched instruction scheduler uses declarative TableGen descriptions of the processor functional units, pipelines and latencies. Imagine tryi ...
Rust treats signed integer overflow differently in debug and release mode. When it happens, Rust panics in debug mode while silently performs two's co ...
Here's a simple C file with an enum definition and a main function: It transpiles to the following LLVM IR: %2 is evidently the d variable, whic ...
I've written this very simple Rust function: I've written a basic benchmark that invokes the method with an ordered array and a shuffled one: I' ...
When running a sum loop over an array in Rust, I noticed a huge performance drop when CAPACITY >= 240. CAPACITY = 239 is about 80 times faster. I ...
Rust has 128-bit integers, these are denoted with the data type i128 (and u128 for unsigned ints): How does Rust make these i128 values work on a 6 ...
As far as I know, reference/pointer aliasing can hinder the compiler's ability to generate optimized code, since they must ensure the generated binary ...
On page 322 of Programming Rust by Blandy and Orendorff is this claim: ...Rust...recognizes that there's a simpler way to sum the numbers from one ...
I know that an "undefined behaviour" in C++ can pretty much allow the compiler to do anything it wants. However, I had a crash that surprised me, as I ...
I am disassembling this code on llvm clang Apple LLVM version 8.0.0 (clang-800.0.42.1): I compiled with no -O specifications, but I also tried with ...
The code is naive: use std::time; fn main() { const NUM_LOOP: u64 = std::u64::MAX; let mut sum = 0u64; let now = time::Instant::now(); ...
I have two (equivalent?) programs, one in Go the other in Rust. The average execution time is: Go ~169ms Rust ~201ms Go package main impor ...
I have a Box<dyn Any> and I know the underlying type so I want to optimize away the test in Box::downcast() (source). First I tried with std::h ...
If I compile with cargo rustc -- --emit=llvm-ir the compiler will emit LLVM IR. Here are the LLVM passes that Rust uses. What LLVM passes, if any, ha ...
If the loops are of the different type then I can easily identify them with the name but if there are multiple same type loops (say 5 while loops), ho ...
I am currently playing around with LLVM and am trying to write a few optimizers to familiarize myself with opt and clang. I wrote a test.c file that i ...
Executing rustc -C help shows (among other things): The levels 0 to 3 are fairly intuitive, I think: the higher the level, the more aggressive op ...