When expanding scalar packed operations, we should not introduce
illegal vector casts LegalizerHelper introduces. We're not in a
legalizer context, and there's no RegBankSelect apply or legalize
worklist.
Details
Diff Detail
Event Timeline
LGTM. Some possible improvements noted inline.
llvm/test/CodeGen/AMDGPU/GlobalISel/add.v2i16.ll | ||
---|---|---|
95 | Shouldn't this get constant folded to s_mov_b32 s4, 0xffc0ffc0 ? Or even folded into the v_pk_add_u16 if you can do that? | |
170 | This s_and is redundant. Since we're going to add something to it and then shift it left by 16 the high order bits will be lost anyway. | |
253–256 | All four of these are redundant. |
llvm/test/CodeGen/AMDGPU/GlobalISel/add.v2i16.ll | ||
---|---|---|
95 | We don't have any constant folding or really anything needed to get good vector code | |
170 | We don't have any optimizations, and don't run anything after RegBankSelect yet. Eventually a combiner pass is needed to cleanup here | |
253–256 | Same, we don't try to clean anything up yet |
Shouldn't this get constant folded to s_mov_b32 s4, 0xffc0ffc0 ? Or even folded into the v_pk_add_u16 if you can do that?