diff --git a/cranelift/codegen/src/souper_harvest.rs b/cranelift/codegen/src/souper_harvest.rs index d24b58b997..a690fa7262 100644 --- a/cranelift/codegen/src/souper_harvest.rs +++ b/cranelift/codegen/src/souper_harvest.rs @@ -528,9 +528,16 @@ fn souper_type_of(dfg: &ir::DataFlowGraph, val: ir::Value) -> Option let ty = dfg.value_type(val); assert!(ty.is_int()); assert_eq!(ty.lane_count(), 1); - Some(ast::Type { - width: ty.bits().try_into().unwrap(), - }) + let width = match dfg.value_def(val).inst() { + Some(inst) + if dfg.insts[inst].opcode() == ir::Opcode::IcmpImm + || dfg.insts[inst].opcode() == ir::Opcode::Icmp => + { + 1 + } + _ => ty.bits().try_into().unwrap(), + }; + Some(ast::Type { width }) } #[derive(Debug)]