Re:Optimizing compilers reload vector constants needlessly
by andreareina on Wednesday December 07, 2022 @01:14AM
(#33891211)
Isn't compiler optimization np complete? I don't think I'd put anything there in "should". Yeah any single optimization (or permutation thereof) can be applied, but they're order-dependent and the combinatorial explosion means you can't try to apply all of them.
Re:Optimizing compilers reload vector constants needlessly
by Thiez on Wednesday December 07, 2022 @02:19AM
(#33891593)
What makes you think that humans are better at solving np complete problems?
Re:Optimizing compilers reload vector constants needlessly
by andreareina on Wednesday December 07, 2022 @04:57AM
(#33892547)
Not in general. But humans can exploit prior knowledge to select which avenues to pursue first.
It _should_ be useless (for some reasonable definition of "should") — it just isn't in practice. And I'm continually amazed at how often people confuse one for the other, across all contexts. E.g. I have family members who refuse to consider that our justice system might have deep flaws, because to their mind if it should be some other way then it already would be.