On 02/15/2017 04:51 AM, Jakub Jelinek wrote:
On Wed, Feb 15, 2017 at 12:46:44PM +0100, Richard Biener wrote:
Possibly, but for GCC 8.

To both this switchconv patch and the potential improvement for loading
from const arrays (can create an enhancement PR for that), or just the
latter?

Both I think - the patch is pretty big.

Ok, I'll queue the patch for GCC8 then.

 Maybe we can instead make early
threading not mess this up?

Maybe, but not planning to do that myself, my knowledge about jump threading
is too limited.
The problem is at the point where we thread all we see is this:

  # s_1 = PHI <"foo"(2), "bar"(3), "spam"(4), 0B(5)>
<L7>:
  if (s_1 == 0B)
    goto <bb 7>;
  else
    goto <bb 8>;

Nothing more is needed for jump threading to do its job. This doesn't look any different to the threader than any other simple jump threading opportunity.

I guess we could look to see if the PHI is the join point for a switch, but that seems rather hacky.

jeff

Reply via email to