[PATCH]Fix for PR14824: Optimization arm_ldst_opt inserts newly generated instruction vldmia at incorrect position

Hao Liu Hao.Liu at arm.com
Wed Apr 17 23:43:27 PDT 2013


Hi Renato,

 

To simplify the test cases, I removed 30 lines at the end of the test case. 

 

I split the test into 3 parts: load %source, load %secondSource, operations
about both variables. But I can’t split the code into several basic blocks,
as the generated code will be changed and the bug will not be exposed. So I
added some comments to distinguish the three parts. I can’t do any further
modification. By removing any instruction, the bug will not be reproduced.

 

The final assembly code is simple and it is mixed from the load operations
of %source and %secondSource, so it only needs to check once.

 

The attached is a new patch. Is is OK?

 

Thanks,

-Hao

 

From: Renato Golin [mailto:renato.golin at linaro.org] 
Sent: 2013年4月17日 18:13
To: Hao Liu
Cc: LLVM Commits
Subject: Re: [PATCH]Fix for PR14824: Optimization arm_ldst_opt inserts newly
generated instruction vldmia at incorrect position

 

Hi Hao,

 

The patch looks good, but would be good to have the test split into their
functional semantics, ie. each block that starts by loading from %source.
Feel free to check for { function name + not vldmia + add } on each one, so
it's easier to change it in the future, as the test comment seem to imply.

 

cheers,

--renato

 

On 15 April 2013 04:23, Hao Liu <Hao.Liu at arm.com> wrote:

Hi,

 

Please consider a patch in the attachment as fix for PR14824: Optimization
arm_ldst_opt inserts newly generated instruction vldmia at incorrect.
http://llvm.org/bugs/show_bug.cgi?id=14824

 

The problem is that there is overlap for lack of WAW (write after write)
dependence check in ARMLoadStoreOpt::LoadStoreMultipleOpti. So we check the
dependence before inserting an instruction into optimizing queue. If the
dependence does exist, we will optimize all the instructions already in the
queue.

 

The attached patch fixes that problem. BTW, to write a simple test case is
hard, as the overlapped instructions are removed as dead instructions in
usual. So the regression test attached is the original test case by
Jiangning who found this bug. There is no unexpected failure of the
regression test. The test-suite hasn’t been tested for the lack of
equipment.

 

Thanks,

-Hao


_______________________________________________
llvm-commits mailing list
llvm-commits at cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130418/662970c8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ARMLdStOpti-2013-04-18.patch
Type: application/octet-stream
Size: 7236 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130418/662970c8/attachment.obj>


More information about the llvm-commits mailing list