Cranelift: Consider shifts as "simple" arithmetic in egraph cost model (#5646)

This commit is contained in:
Nick Fitzgerald
2023-01-27 16:30:42 -08:00
committed by GitHub
parent b47006d432
commit ffbcc67eb3

View File

@@ -90,7 +90,10 @@ pub(crate) fn pure_op_cost(op: Opcode) -> Cost {
| Opcode::BorNot
| Opcode::Bxor
| Opcode::BxorNot
| Opcode::Bnot => Cost(2),
| Opcode::Bnot
| Opcode::Ishl
| Opcode::Ushr
| Opcode::Sshr => Cost(2),
// Everything else (pure.)
_ => Cost(3),
}