Piling on:
```
(module
(memory 1)
(func $f1 (result i32)
(i32.load offset=16 (i32.const 128))))
```
turns into
```
0x1755cbc6034 52800000 mov w0, #0x0
0x1755cbc6038 91024010 add x16, x0, #0x90 (144)
0x1755cbc603c b8706aa0 ldr w0, [x21, x16]
```
which shows that the folding happens, as it should, but the code bad.
In cases where the constant is too large, just loading it into a temp is still preferable to what's generated above. Not sure yet what motivates that addition.
Bug 1709863 Comment 2 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Piling on:
```
(module
(memory 1)
(func $f1 (result i32)
(i32.load offset=16 (i32.const 128))))
```
turns into
```
0x1755cbc6034 52800000 mov w0, #0x0
0x1755cbc6038 91024010 add x16, x0, #0x90 (144)
0x1755cbc603c b8706aa0 ldr w0, [x21, x16]
```
which shows that the folding happens, as it should, but the code is bad.
In cases where the constant is too large, just loading it into a temp is still preferable to what's generated above. Not sure yet what motivates that addition.