Auto merge of #96862 - oli-obk:enum_cast_mir, r=RalfJung

Change enum->int casts to not go through MIR casts.

follow-up to https://github.com/rust-lang/rust/pull/96814

this simplifies all backends and even gives LLVM more information about the return value of `Rvalue::Discriminant`, enabling optimizations in more cases.
This commit is contained in:
bors
2022-07-05 09:36:29 +00:00
21 changed files with 238 additions and 143 deletions

View File

@@ -1619,7 +1619,7 @@ extern "C" {
B: &Builder<'a>,
Val: &'a Value,
DestTy: &'a Type,
IsSized: bool,
IsSigned: bool,
) -> &'a Value;
// Comparisons