Closed
Description
I have seen below pattern in generated code for framework libraries. We can eliminate the str
if it is storing the value from same register that was used to load in previous instruction from same memory location.
Example of ARM64 code:
B9404260 ldr w0, [x19,#64]
B9004260 str w0, [x19,#64]
Example of x64 code:
8B4640 mov eax, dword ptr [rsi+64]
894640 mov dword ptr [rsi+64], eax
There are approx. 250 such patterns in 250 methods. Details in ldr-str.txt
category:cq
theme:basic-cq
skill-level:intermediate
cost:medium