We often see code like the following after running SCCP:
switch (x) { case 42: phi(42, ...); }
This tends to produce bad code as we currently materialize the constant
phi-argument in the switch-block. This increases register pressure and if the
pattern repeats for n case statements, we end up generating n constant
values.
This changes CodeGenPrepare to catch this pattern and revert it back to:
switch (x) { case 42: phi(x, ...); }
Something isn't updated properly in this patch? I don't see this TLI hook defined in the previous patches or on current main.