This makes another 13 tests pass in the test-suite for me.
I'm not sure if we could tablegen the functionality I'm touching in this patch.
Even if we did, I think that manually fixing this is helpful, as it results in other issues being hidden less while we don't have tablegen for this.