This is an implementation of the idea I suggested in D37017 as an alternate way to solve the multiple assertzext problem. I'm posting this just so it's clear what I had drafted. It could be completely wrong for reasons I don't understand yet. :)
- I've avoided the vector problems/questions by only using the IR type in a truncate of a scalar. I don't know what mapping we use for illegal vector types or AVX512 masks to formal args, but there must be some cases where vectors are mapped to scalars because I hit asserts without that limitation.
- I loosened an assert in SelectionDAGISel::LowerArguments() to account for this new/unexpected behavior.
- The tests diffs are a superset of those in D37017 currently because we handle assertsext here.