Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.iecc.com!nerds-end From: amker Newsgroups: comp.compilers Subject: Re: How to eliminate redundant constant move instructions Date: Mon, 7 Nov 2011 17:33:29 -0800 (PST) Organization: Compilers Central Lines: 31 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <11-11-030@comp.compilers> References: <11-10-019@comp.compilers> <11-11-004@comp.compilers> <11-11-009@comp.compilers> <11-11-025@comp.compilers> NNTP-Posting-Host: news.iecc.com X-Trace: leila.iecc.com 1320854580 76338 64.57.183.58 (9 Nov 2011 16:03:00 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Wed, 9 Nov 2011 16:03:00 +0000 (UTC) Keywords: optimize Posted-Date: 09 Nov 2011 11:03:00 EST X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: x330-a1.tempe.blueboxinc.net comp.compilers:332 On Nov 5, 5:26 am, George Neuner wrote: > On Tue, 1 Nov 2011 19:21:54 -0700 (PDT), amker > wrote: > >Yes, I have noticed this pass. Seems it can solve the problem if I > >can: > >1, extend the pass in value numbering way, at least for const values. > >2, extend the pass in global data analysis way. > > Yes. But value numbering doesn't know or care what specific value is > in the register - it cares only whether the value in the register > might have been changed between read uses. > > Variable value tracking is the related technique used for constant > propagation. However what you are after is variable equivalence > testing - I don't think GCC even tries to do this. Yes, I guess it is the variable value tracking. But I think GCC does do such work in some passes, at least cse.c. In this pass gcc records the constant value if a quantity has a known constant value. Then gcc simplify expressions containing such constant value by calling fold_rtx. Unfortunately, cse only works on basis of extended basic block. Nothing it can do for global cases as reported in mentioned bug. Also, could you point me some papers of implementation of such variable value tracking technique? I googled and found nothing about it. Thanks