-
-
Notifications
You must be signed in to change notification settings - Fork 688
Propagate constant load/store offsets more efficiently #32
Copy link
Copy link
Closed
Labels
Description
For example:
const index = 4;
store<i32>(ptr + <usize>index * sizeof<i32>(), value);
// emit as: (i32.store (i32.add (get_local $0) (i32.const 16)) (get_local $2))Good optimize to this in compile time:
store<i32>(ptr, value, 4 * sizeof<i32>());
// emit as: (i32.store offset=16 (get_local $0) (get_local $2))So may be this good doing inside load / store buildins.
That do you think?
Reactions are currently unavailable