RegisterCoalescer: Assume CR_Replace for SubRangeJoin
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 8 Jan 2019 23:22:18 +0000 (23:22 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 8 Jan 2019 23:22:18 +0000 (23:22 +0000)
commit0ad1b71fe37af3f3230b40e03e3a511c78152bad
tree88cd385d6590db87b131b306eedacdf5fd3db840
parentd186dbc0414b6686f1d7a64c45da6c05c66aab42
RegisterCoalescer: Assume CR_Replace for SubRangeJoin

Currently it's possible for following
check on V.WriteLanes (which is not really meaningful
during SubRangeJoin) to pass for one half of the pair,
and then fall through to to one of the impossible
or unresolved states. This then fails as inconsistent
on the other half.

During the main range join, the check between V.WriteLanes
and OtherV.ValidLanes must have passed, meaning this
should be a CR_Replace.

Fixes most of the testcases in bugs 39542 and 39602

llvm-svn: 350678
llvm/lib/CodeGen/RegisterCoalescer.cpp
llvm/test/CodeGen/AMDGPU/regcoalesce-cannot-join-failures.mir [new file with mode: 0644]