On 04/21/2015 03:18 AM, Kyrill Tkachov wrote:
Though I do wonder if, in practice, we can identify those cases that do
simplify more directly apriori and just punt everything else rather than
this rather convoluted approach.
You mean like calling simplify_binary_operation that returns NULL
if no simplification is possible?
Not entirely sure, just a general sense that we're doing far more work
here than is justified by the potential gains. The cases we care about
are very limited (negated or duplicated arguments) and I'd be surprised
if they're still showing up in combine.c these days. I didn't look at
the history of that code, but I suspect it is *very very* old.
I'm not asking you to tackle this problem, it was more meant as an
observation. But if you want to dig deeper, go for it. If it were me,
the first thing I'd do is try to construct a testcase that would get me
into that code -- I'd be it's hard, particularly with the tree and rtl
reassociations we do these days.
Jeff