rust/compiler/rustc_codegen_ssa/src
Stuart Cook 7ffa56c3a3
Rollup merge of #139098 - scottmcm:assert-impossible-tags, r=WaffleLapkin
Tell LLVM about impossible niche tags

I was trying to find a better way of emitting discriminant calculations, but sadly had no luck.

So here's a fairly small PR with the bits that did seem worth bothering:

1. As the [`TagEncoding::Niche` docs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_abi/enum.TagEncoding.html#variant.Niche) describe, it's possible to end up with a dead value in the input that's not already communicated via the range parameter attribute nor the range load metadata attribute.  So this adds an `llvm.assume` in non-debug mode to tell LLVM about that.  (That way it can tell that the sides of the `select` have disjoint possible values.)

2. I'd written a bunch more tests, or at least made them parameterized, in the process of trying things out, so this checks in those tests to hopefully help future people not trip on the same weird edge cases, like when the tag type is `i8` but yet there's still a variant index and discriminant of `258` which doesn't fit in that tag type because the enum is really weird.
2025-04-08 20:55:03 +10:00
..
back refactor: Move env parsing of deployment target to rustc_session 2025-04-04 15:02:22 +02:00
debuginfo Flatten ifs in rustc_codegen_ssa 2025-03-17 18:56:52 +00:00
mir Address PR feedback 2025-04-07 18:12:06 -07:00
traits Auto merge of #133984 - DaniPopes:scmp-ucmp, r=scottmcm 2025-03-24 22:53:12 +00:00
assert_module_sources.rs Move methods from Map to TyCtxt, part 4. 2025-03-12 08:55:37 +11:00
base.rs Auto merge of #138629 - Zoxc:graph-anon-hashmap, r=oli-obk 2025-03-24 15:02:09 +00:00
codegen_attrs.rs Rollup merge of #137880 - EnzymeAD:autodiff-batching, r=oli-obk 2025-04-05 13:18:13 +11:00
common.rs Test fixing raw-dylib 2024-09-24 10:10:31 -07:00
errors.rs refactor: Move env parsing of deployment target to rustc_session 2025-04-04 15:02:22 +02:00
lib.rs refactor: Move Apple OSVersion (back) to rustc_target 2025-04-04 15:01:27 +02:00
meth.rs More assertions, tests, and miri coverage 2025-01-30 17:44:28 +00:00
mono_item.rs Make a fake body to store typeck results for global_asm 2025-02-22 00:12:07 +00:00
size_of_val.rs Set both nuw and nsw in slice size calculation 2025-02-13 21:26:48 -08:00
target_features.rs Simplify implied_target_features. 2025-03-05 09:20:28 +11:00