Top "Llvm-codegen" questions

Questions about how LLVM generates machine code from LLVM-IR or high-level languages.

Why does the Rust compiler not optimize code assuming that two mutable references cannot alias?

As far as I know, reference/pointer aliasing can hinder the compiler's ability to generate optimized code, since they must …

rust compiler-optimization llvm-codegen
Does the C++ standard allow for an uninitialized bool to crash a program?

I know that an "undefined behaviour" in C++ can pretty much allow the compiler to do anything it wants. However, …

c++ llvm undefined-behavior abi llvm-codegen
Why is there a large performance impact when looping over an array with 240 or more elements?

When running a sum loop over an array in Rust, I noticed a huge performance drop when CAPACITY >= 240. CAPACITY = 239 …

arrays performance rust llvm-codegen
How does Rust's 128-bit integer `i128` work on a 64-bit system?

Rust has 128-bit integers, these are denoted with the data type i128 (and u128 for unsigned ints): let a: i128 = 170141183460469231731687303715884105727; …

rust x86-64 bigint int128 llvm-codegen
When should inline be used in Rust?

Rust has an "inline" attribute that can be used in one of those three flavors: #[inline] #[inline(always)] #[inline(never)] …

rust inline llvm-codegen
LLVM's integer types

The LLVM language specifies integer types as iN, where N is the bit-width of the integer, and ranges from 1 to 2^23…

types llvm llvm-codegen
What do the optimization levels `-Os` and `-Oz` do in rustc?

Executing rustc -C help shows (among other things): -C opt-level=val -- optimize with possible levels 0-3, s, or z …

rust llvm-codegen