cranelift: Generate the correct souper size for comparisons in LHSes (#5659)
This commit is contained in:
@@ -528,9 +528,16 @@ fn souper_type_of(dfg: &ir::DataFlowGraph, val: ir::Value) -> Option<ast::Type>
|
||||
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)]
|
||||
|
||||
Reference in New Issue
Block a user