From ffbcc67eb37f202d4fb9f15fc1c25505027f5957 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Fri, 27 Jan 2023 16:30:42 -0800 Subject: [PATCH] Cranelift: Consider shifts as "simple" arithmetic in egraph cost model (#5646) --- cranelift/codegen/src/egraph/cost.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cranelift/codegen/src/egraph/cost.rs b/cranelift/codegen/src/egraph/cost.rs index 8a9f852818..fd9a22ee23 100644 --- a/cranelift/codegen/src/egraph/cost.rs +++ b/cranelift/codegen/src/egraph/cost.rs @@ -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), }