How to eliminate redundant constant move instructions

"Amker.Cheng" <amker.cheng@gmail.com>
Mon, 31 Oct 2011 17:53:46 +0800

          From comp.compilers

Related articles
How to eliminate redundant constant move instructions amker.cheng@gmail.com (Amker.Cheng) (2011-10-31)
Re: How to eliminate redundant constant move instructions kaz@kylheku.com (Kaz Kylheku) (2011-10-31)
Re: How to eliminate redundant constant move instructions gneuner2@comcast.net (George Neuner) (2011-11-01)
Re: How to eliminate redundant constant move instructions gah@ugcs.caltech.edu (glen herrmannsfeldt) (2011-11-01)
Re: How to eliminate redundant constant move instructions can.finner@gmail.com (amker) (2011-11-01)
Re: How to eliminate redundant constant move instructions can.finner@gmail.com (amker) (2011-11-01)
Re: How to eliminate redundant constant move instructions can.finner@gmail.com (amker) (2011-11-01)
[12 later articles]
| List of all articles for this month |
From: "Amker.Cheng" <amker.cheng@gmail.com>
Newsgroups: comp.compilers
Date: Mon, 31 Oct 2011 17:53:46 +0800
Organization: Compilers Central
Keywords: optimize, question
Posted-Date: 31 Oct 2011 10:49:58 EDT

Hi,
I found following intermediate codes are generated in gcc


rx <- 0
...
use rx
...
ry <- 0
use ry
...


It's normally a result of const propagation.
After register allocation, It is likely rx/ry get allocated into
different hard registers.
Thus in final codes, there would be a redundant "move 0" instruction.


The story even stands for Os compiling, so the question is:
Is there any optimization technique dedicates to this kind of case?
Or is it normally handled by other optimizations as sub task?


Thanks very much.
--
Best Regards.



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.