- // Make sure to return the same type `immediate_llvm_type` would,
- // to avoid dealing with two types and the associated conversions.
- // This means that `(bool, bool)` is represented as `{i1, i1}`,
- // both in memory and as an immediate, while `bool` is typically
- // `i8` in memory and only `i1` when immediate. While we need to
- // load/store `bool` as `i8` to avoid crippling LLVM optimizations,
- // `i1` in a LLVM aggregate is valid and mostly equivalent to `i8`.
- if scalar.is_bool() {
+ // Make sure to return the same type `immediate_llvm_type` would when
+ // dealing with an immediate pair. This means that `(bool, bool)` is
+ // effectively represented as `{i8, i8}` in memory and two `i1`s as an
+ // immediate, just like `bool` is typically `i8` in memory and only `i1`
+ // when immediate. We need to load/store `bool` as `i8` to avoid
+ // crippling LLVM optimizations or triggering other LLVM bugs with `i1`.
+ if immediate && scalar.is_bool() {