------- Additional Comments From law at redhat dot com 2005-03-21 17:20 ------- Subject: Re: [4.0/4.1 regression] extra assignment inserted on the tree level
On Mon, 2005-03-21 at 15:53 +0000, amacleod at redhat dot com wrote: > ------- Additional Comments From amacleod at redhat dot com 2005-03-21 15:52 > ------- > Well, I dont think there is anything out of ssa should do here. a_1 and a_2 > are > 2 distinct live ranges, and should therefore be generated that way. There > isnt > much choice about the 2 assignments either. > > Perhaps the best thing would be a pass before out of ssa which does the > opposite > of that DOM optimization. It goes through the program looking for these > equivilences, and replaces the constant with the variable its equivilent to. Kind-of funny. I've got code somewhere around here which does that which I put on my 4.1 queue :-) What the code does is a domwalk recording a reverse mapping of equivalences created by conditionals. When we encounter a PHI node where the argument is either a constant or an SSA_NAME with a different underlying variable than the PHI result, we lookup the argument in our table of reverse equivalences and see which (if any) of the equivalences would be a better choice than the current PHI argument. This would allow us to kill the current code which runs after we go out of SSA form which tries to eliminate the constant loads and copies in arms of conditionals. Finding the code might be a PITA (it was many many months ago), it might be easier to just recreate it again -- it wasn't terribly complicated, and it did a pretty decent job at eliminating constant loads and some copies. jeff -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14627