Combine unmerge(trunc) to enable other merge combines.
Without this combine, the scalar unmerge(trunc(merge))
pattern cannot be combined and easily lead to
hard-to-legalize merge/unmerge artifacts.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Not sure whether this combine is desired. We need it for our out-of-tree backend, as otherwise there are quite a few cases with non-power-of-2 types which fail legalization due to non-combinable unmerge(trunc(merge)) patterns.
Rebase.
I didn't bother to move your vector unmerge(trunc) combine to the new tryFoldUnmergeCast for now, @arsenm. I plan to do that after some initial feedback though
Add example comment
Set initial size to NewNumDefs
Remove dead return
Move vector unmerge(trunc) combine to tryFoldUnmergeCast
llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h | ||
---|---|---|
356–366 | I think the diff is messed up and includes one of my recent patches now. I'm assuming much of this will disappear in the final version? |
llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h | ||
---|---|---|
356–366 | Kind-of. I extracted both of our code to a new function to keep the code more readable in tryCombineMerges and to make it more easy to add other merge-cast combines, which is why most of it appears in this diff now. I'm going to land that as a separate commit though. |
I think the diff is messed up and includes one of my recent patches now. I'm assuming much of this will disappear in the final version?