[llvm-dev] Getting differences with ldr/str instructions

Ramakota Reddy via llvm-dev llvm-dev at lists.llvm.org
Thu May 16 03:03:47 PDT 2019

Hi All,

I have fixed one issue in AArch64LoadStoreOptimizer.cpp file.

e.g:  have two instructions like below
add x8, x9,x8, lsl #2
ldr w1, [x8]

and I have merged these two instructions into one instruction like below, and I am deleting add instruction if don't have any uses.
ldr w1, [x9,x8, lsl #2]

But some llvm-test-sute tests are failing because getting difference in assembly code generation. I did bisecting with object files to find the issue.
In one failing test z12.c file, if I generate z12.o using z12.s of z12.c file it's working.
but if I generate direct z12.o using z12.c file and it's not working.

so I did disassemble the both z12.o files and I have observed below differences in one ldr instruction(above  merged ldr instruction).
F38: b869eb61   ldr w1, [x9, x8, sxtx] ( disassemble  code of z12.o generated using z12.c).
F38: b8697b61   ldr w1, [x9, x8, lsl #2] ( disassemble code of z12.o generated using z12.s).

I am getting above two differences, because of these differences test is failing.
Could any one please give your suggestions to fix this problem.

Thanks & Regards,

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190516/3e0a0eb1/attachment.html>

More information about the llvm-dev mailing list