[PATCH] D107829: SplitKit: Don't further split subrange mask in buildCopy

Ruiling, Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 10 07:52:19 PDT 2021


ruiling created this revision.
ruiling added reviewers: qcolombet, kparzysz, arsenm, foad.
Herald added subscribers: kerbowa, hiraditya, nhaehnle, jvesely.
ruiling requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

We may use several COPY instructions to copy the needed sub-registers
during split. But the way we split the lanes during the COPYs may be
different from the subranges of the old register. This would fail when we
extend the subranges of the new register because the LaneMasks do not
match exactly between subranges of new register and old register.
Since we are bundling the COPYs, I think there is no need to further refine the
subranges of the new register based on the set of LaneMasks of the inserted COPYs.

I am not sure if there will be further breaking cases. But as the subranges of
new register are created based on the LaneMasks of the subranges of old register,
it will be highly possible we will always find an exact LaneMask match.
We can think about how to make the extendPHIKillRanges() work for
subrange mask mismatch case if we meet more such cases in the future.

The test case was from D105065 <https://reviews.llvm.org/D105065> by @arsenm.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107829

Files:
  llvm/lib/CodeGen/SplitKit.cpp
  llvm/test/CodeGen/AMDGPU/extend-phi-subrange-not-in-parent.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107829.365476.patch
Type: text/x-patch
Size: 5930 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210810/d7ac6761/attachment.bin>


More information about the llvm-commits mailing list