Merge commit '8c848e0604b5d26fad120914f822f564fe05c52a' into sync_cg_clif-2025-06-24

This commit is contained in:
bjorn3
2025-06-24 11:32:02 +00:00
9 changed files with 95 additions and 125 deletions

View File

@@ -228,7 +228,7 @@ fn pointer_for_allocation<'tcx>(
crate::pointer::Pointer::new(global_ptr)
}
pub(crate) fn data_id_for_alloc_id(
fn data_id_for_alloc_id(
cx: &mut ConstantCx,
module: &mut dyn Module,
alloc_id: AllocId,

View File

@@ -202,9 +202,10 @@ pub(super) fn codegen_x86_llvm_intrinsic_call<'tcx>(
};
let x = codegen_operand(fx, &x.node);
let y = codegen_operand(fx, &y.node);
let kind = match &kind.node {
Operand::Constant(const_) => crate::constant::eval_mir_constant(fx, const_).0,
Operand::Copy(_) | Operand::Move(_) => unreachable!("{kind:?}"),
let kind = if let Some(const_) = kind.node.constant() {
crate::constant::eval_mir_constant(fx, const_).0
} else {
unreachable!("{kind:?}")
};
let flt_cc = match kind

View File

@@ -205,9 +205,10 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
// Find a way to reuse `immediate_const_vector` from `codegen_ssa` instead.
let indexes = {
use rustc_middle::mir::interpret::*;
let idx_const = match &idx.node {
Operand::Constant(const_) => crate::constant::eval_mir_constant(fx, const_).0,
Operand::Copy(_) | Operand::Move(_) => unreachable!("{idx:?}"),
let idx_const = if let Some(const_) = idx.node.constant() {
crate::constant::eval_mir_constant(fx, const_).0
} else {
unreachable!("{idx:?}")
};
let idx_bytes = match idx_const {