Browse Source
Cranelift: Consider shifts as "simple" arithmetic in egraph cost model (#5646)
pull/5651/head
Nick Fitzgerald
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
1 deletions
-
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), |
|
|
|
} |
|
|
|