These patterns should have a True16 version and a non-true16 version.
The assembly mnemonics do not include references to true16, only the MachineInstr/MCInst names do. I checked that the True16 version of the instruction was used via print-after-all before asm emission in this case.
Is ballot well defined for 16 bit destinations? I think ballot should work over the waveSize, so only 32 or 64 bit returns are valid.
declare i16 @llvm.amdgcn.ballot.i16(i1)
I would expect a problem here
if (Size != STI.getWavefrontSize()) return false;