Browse Source

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

pull/5651/head
Nick Fitzgerald 2 years ago
committed by GitHub
parent
commit
ffbcc67eb3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      cranelift/codegen/src/egraph/cost.rs

5
cranelift/codegen/src/egraph/cost.rs

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

Loading…
Cancel
Save