Cranelift: Add egraph rule to rewrite x * C ==> x << log2(C) when C is a power of two (#5647)
This commit is contained in:
@@ -7,8 +7,8 @@ function %f0(i32) -> i32 {
|
||||
block0(v0: i32):
|
||||
v1 = iconst.i32 2
|
||||
v2 = imul v0, v1
|
||||
; check: v3 = iadd v0, v0
|
||||
; check: return v3
|
||||
; check: v5 = ishl v0, v4 ; v4 = 1
|
||||
; check: return v5
|
||||
return v2
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user