Recognize when source could have been unmerged to pieces with DstTy
without having to split source to smaller elements
and then merge small elements into DstTy pieces.
This happens when vector was meant to be split to sub-vectors but there
was leftover. At this point artifact combiner have already dealt with
leftover and we can continue to use sub-vectors.
Details
Diff Detail
Event Timeline
llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h | ||
---|---|---|
1173 | Wouldn't it be simpler to check that FirstEltIdx is a multiple of DstTy.getNumElements()? | |
1187 | ... and FirstEltIdx / DstTy.getNumElements() here. | |
llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp | ||
616 ↗ | (On Diff #370600) | Just use a constructor that initialized this to N copies of Res? |
llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h | ||
---|---|---|
1159 | Needs a comment. Also is misleading. What does it mean by merge exactly? Is this supposed to cover G_CONCAT_VECTORS? |
llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h | ||
---|---|---|
1159 | I thought that this combine could also work for scalar types but that can be added later (I did not consider how useful would it be for code that comes from llvm-ir, and it could introduce infinite loops if se do some legalization on merge/unmerge_values). "Merge" is any of the opcodes we could get when using buildMerge. Changing name since this patch and the next one only consider vectors. |
llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h | ||
---|---|---|
1173 | Should be the same unless this is going to handle the pointer casting (or future FP types) |
Use Value finder to search for unmerged elements. In some tests skips a few combine steps since value finder looks through artifacts.
Needs a comment. Also is misleading. What does it mean by merge exactly? Is this supposed to cover G_CONCAT_VECTORS?