DescriptionAdded implementation in Assembler::ldr() to recognize and optimize the following pattern sequences (tested v8 regression tests, mozilla, sputnik on Arm-Simulator & ARMv7 target)
1) Pattern: Ldr/str same fp+offset, same register
Example:
The following:
str rx, [fp, #-12]
ldr rx, [fp, #-12]
Becomes:
str rx, [fp, #-12]
2) Pattern.Ldr/str same fp+offset, different register
Example:
The following:
str rx, [fp, #-12]
ldr ry, [fp, #-12]
Becomes:
str rx, [fp, #-12]
mov ry, rx
3) Pattern: push & pop from/to same register,
with a fp+offset ldr in between
Example:
The following:
str rx, [sp, #-4]!
ldr rz, [fp, #-24]
ldr rx, [sp], #+4
Becomes:
3.1 if(rx == rz)
delete all instructions
3.2 if(rx != rz)
just becomes: ldr rz, [fp, #-24]
4) Pattern: push & pop from/to different registers
with a fp+offset ldr in between
Example:
The following:
str rx, [sp, #-4]!
ldr rz, [fp, #-24]
ldr ry, [sp], #+4
Becomes:
4.1 if(ry == rz)
just becomes: mov ry, rx; // since ldr rz is dead code.
4.2 if(rx != rz) just becomes:
ldr rz, [fp, #-24]
mov ry, rx
4.3 if((ry != rz) || (rx == rz)) just becomes:
mov ry, rx
ldr rz, [fp, #-24]
This change now also integrates http://codereview.chromium.org/2001008/show, i.e., "optimize push/pop on diff reg as reg move", as both the changes share the same set of APIs.
Example) the following:
push rx
pop ry
Can be replaced as:
mov ry, rx
Patch Set 1 #
Total comments: 18
Patch Set 2 : '' #
Total comments: 5
Patch Set 3 : '' #
Messages
Total messages: 8 (0 generated)
|