This transform is cheap enough that there is no need to bail out. Also, the GCD calculation is unnecessary and wasteful, as it requires expensive division in the compiler. No programming languages I know of allow these numbers to be created programmatically, so there is no point in getting too smart and trying to do constant division on the keys with the GCD.
Add a second patch that changes SwitchToLookupTable
There were a number of cases where a table was smaller and we still didn't use it, and
also i8 tables are small enough that we should use them. Also, remove xor and and when producing a covered table.
see PR 39046