14 Commits

Author SHA1 Message Date
Scott McMurray ba1a33e105 Prefer -1 for None
Currently we pick "weird" numbers like `1114112` for `None::<char>`.  While that's not *wrong*, it's kinda *unnatural* -- a human wouldn't make that choice.

This PR instead picks `-1` for thinge like `None::<char>` -- like clang's `WEOF` -- and `None::<bool>` and such.

Any enums with more than one niched value (so not `Result` nor `Option`) remain as they were before.
2026-04-25 14:57:23 -07:00
Jacob Adam fc9f492049 Add a codegen test for a missed optimisation with spare niches 2026-04-09 09:42:47 +01:00
Josh Stone 52dfa94cdc Update the minimum external LLVM to 21 2026-03-12 16:45:42 -07:00
Urhengulas 01e3d8549c Include optional dso_local marker for functions in enum-[match,transparent-extract].rs 2026-03-12 14:23:26 +01:00
Waffle Lapkin 11bcf3759e make PointeeInfo::align non-optional
Instead of defaulting to `None` it now defaults to `Align::ONE` i.e.
no alignment restriction. Codegen test changes are due to us now skipping
`align 1` annotations (they are useless; not skipping them makes all the
raw pointers gain an `align 1` annotation which doesn't seem any good)
2026-03-05 11:53:38 +01:00
Maja Kądziołka af302a67fd discriminant reads: make semantics independent of module/crate 2026-01-15 19:12:13 +01:00
Zachary S 9a8dc7e17c Replace uses of 'CHECK: br' and 'CHECK-NOT: br' with 'br {{.*}}'.
v0 mangling can produce symbols with 'br' as a substring, leading to false positives for CHECK-NOT
2025-11-21 13:04:48 -06:00
Ben Kimock 029579d177 Change int-to-ptr transmute lowering back to inttoptr 2025-10-10 20:14:23 -04:00
Josh Stone 580b4891aa Update the minimum external LLVM to 20 2025-09-16 11:49:20 -07:00
Caiweiran 9d08596a2e tests: fix RISC-V failures and adjust transmute-scalar.rs target
Resolve several ./x test failures on RISC-V caused by ABI and codegen
differences. Update multiple codegen-llvm tests for compatibility, and
explicitly set the target for transmute-scalar.rs to x86_64 to ensure
consistent behavior across hosts.
2025-08-18 19:37:13 +00:00
Scott McMurray c396521fd3 [codegen] assume the tag, not the relative discriminant 2025-08-06 09:11:35 -07:00
Nikita Popov d50b4f10f1 Adjust enum-discriminant-eq.rs for LLVM 21
The two xors get folded into the select.
2025-07-29 12:15:38 +02:00
Scott McMurray 6a5c7e0415 No longer need allocas for consuming Result<!, i32> and similar
In optimized builds GVN gets rid of these already, but in `opt-level=0` we actually make `alloca`s for this, which particularly impacts `?`-style things that use actually-only-one-variant types like this.
2025-07-23 00:09:36 -07:00
Guillaume Gomez a27f3e3fd1 Rename tests/codegen into tests/codegen-llvm 2025-07-22 14:28:48 +02:00