Re:Introducing a new, advanced Visual C++ code optimizer
by gratilup on Thursday May 05, 2016 @04:48PM
(#11639561)
Hi,
I'm the author of the blog post and optimizer. We had SSA since around 1999-2000, just that some important components like the expression optimizer were written before that and not updated with support for SSA. The difference is a lot more than just SSA, the blog has just a few examples. The new framework started as being somewhat similar to InstCombine, since then it got much larger and it will be the place where more optimizations will be integrated, hopefully replacing some older ones. To answer your question: SSA is built with both types of exceptions and the new optimizer works as expected, except a few cases where it would be unsafe. It seems that the rejection rules are a bit too aggressive in your example, it's obviously safe to optimize in this case - thanks for the example!
[ Parent
| on HN ]
Re:Introducing a new, advanced Visual C++ code optimizer
by cokernel_hacker on Thursday May 05, 2016 @05:11PM
(#11639684)
Cool, good to know!
Another interesting example is:
bool f(bool b) {
int x;
try {
if (b) {
x = 2;
throw 0;
}
x = 4;
throw 0.0;
} catch (...) {
}
return x & 1;
}
Here, a phi is needed on the catch.Out of curiosity, can you give details regarding how your EH representation looks like in SSA?