News for hackers. Stuff that matters.
Re:Remove the ++ and –- operators by jbert on Thursday December 03, 2015 @05:04PM (#10673041)
Is there a significant benefit to this over using a new name for the result?

    y = (x + 1) / atan(x) - x;
    x = y; // If you're in a loop and updating some value
If would hope/imagine that a compiler could reduce the two to the same code - and I don't think it reads any worse. Is there a downside beyond the extra line of code?
Re:Remove the ++ and –- operators by JoeAltmaier on Thursday December 03, 2015 @05:09PM (#10673074)
To be clear: the assignment isn't the optimization; its the use of a symbol for 'x' on the rhs so that the compiler can recognize it. To illustrate that

    X &x = { complex reference expression for x }
    y = (x + 1) / atan(x) - x;
Now the compiler has the clues it needs to write good code. And with language support I don't have to introduce new names for each occurrence; just one name like <LHS> that readers can quickly learn.
Re:Remove the ++ and –- operators by jbert on Friday December 04, 2015 @08:25AM (#10676150)
> And with language support I don't have to introduce new names for each occurrence;

Having <LHS> as a name is only useful I think if you don't want to give it another name? I was asking what's the downside of giving it a name.

Re:Remove the ++ and –- operators by JoeAltmaier on Friday December 04, 2015 @10:00AM (#10676643)
Name proliferation is a famous issue. One-use names are evil.
Re:Remove the ++ and –- operators by jbert on Thursday December 10, 2015 @02:40AM (#10709401)
I disagree. Names are comments. You don't want more mutable state across large scopes, but using intermediate names can help comprehension.
Re:Remove the ++ and –- operators by LBarret on Monday December 07, 2015 @03:00AM (#10688358)
why ? Could you elaborate ?

Because from my point of view, it could be only the case only if the scopes are weak or underused, or names are bad (too short, ect). After SSA is all about one-use names.