Skip to content

Commit 96662e4

Browse files
committed
fix best-not-chosen stat
1 parent 6bb5e46 commit 96662e4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cranelift/codegen/src/egraph/elaborate.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,10 @@ impl<'a> Elaborator<'a> {
337337
" -> best of union({:?}, {:?}) = {:?}",
338338
best[x], best[y], best[value]
339339
);
340-
let not_chosen = if best[value] == best[x] { y } else { x };
341-
Self::mark_not_chosen(&mut self.not_chosen, &self.func.dfg, not_chosen);
340+
if best[x].0 != best[y].0 {
341+
let not_chosen = if best[value] == best[x] { y } else { x };
342+
Self::mark_not_chosen(&mut self.not_chosen, &self.func.dfg, not_chosen);
343+
}
342344
}
343345

344346
ValueDef::Param(_, _) => {

0 commit comments

Comments
 (0)