diff options
| author | León Orell Valerian Liehr <me@fmease.dev> | 2024-05-22 23:41:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-22 23:41:14 +0200 |
| commit | 412c46cc140c31f3f20c8eb968267d28777d7dee (patch) | |
| tree | 3fc8ada087972b7cb7b370e6359aacb6694d1329 /compiler/rustc_codegen_llvm/src | |
| parent | 5f62a35bae82dd0c5ff9dedd83fe2cfd74b67792 (diff) | |
| parent | 8ee3d29cd93325db6f973358115f40ee1c785ef0 (diff) | |
| download | rust-412c46cc140c31f3f20c8eb968267d28777d7dee.tar.gz rust-412c46cc140c31f3f20c8eb968267d28777d7dee.zip | |
Rollup merge of #125399 - scottmcm:less-hir-in-cg_ssa, r=compiler-errors
Stop using `to_hir_binop` in codegen This came up in https://github.com/rust-lang/rust/pull/125359#discussion_r1609401311 , and looking into it we can just use the `mir::BinOp`s directly instead of `hir::BinOpKind`s. (AKA rather than going `mir::BinOp` → `hir::BinOpKind` → `IntPredicate`, just go `mir::BinOp` → `IntPredicate`.)
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/intrinsic.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/compiler/rustc_codegen_llvm/src/intrinsic.rs b/compiler/rustc_codegen_llvm/src/intrinsic.rs index 80e863af893..897132a8e9c 100644 --- a/compiler/rustc_codegen_llvm/src/intrinsic.rs +++ b/compiler/rustc_codegen_llvm/src/intrinsic.rs @@ -14,6 +14,7 @@ use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue}; use rustc_codegen_ssa::mir::place::PlaceRef; use rustc_codegen_ssa::traits::*; use rustc_hir as hir; +use rustc_middle::mir::BinOp; use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt, LayoutOf}; use rustc_middle::ty::{self, GenericArgsRef, Ty}; use rustc_middle::{bug, span_bug}; @@ -1104,12 +1105,12 @@ fn generic_simd_intrinsic<'ll, 'tcx>( let in_ty = arg_tys[0]; let comparison = match name { - sym::simd_eq => Some(hir::BinOpKind::Eq), - sym::simd_ne => Some(hir::BinOpKind::Ne), - sym::simd_lt => Some(hir::BinOpKind::Lt), - sym::simd_le => Some(hir::BinOpKind::Le), - sym::simd_gt => Some(hir::BinOpKind::Gt), - sym::simd_ge => Some(hir::BinOpKind::Ge), + sym::simd_eq => Some(BinOp::Eq), + sym::simd_ne => Some(BinOp::Ne), + sym::simd_lt => Some(BinOp::Lt), + sym::simd_le => Some(BinOp::Le), + sym::simd_gt => Some(BinOp::Gt), + sym::simd_ge => Some(BinOp::Ge), _ => None, }; |
