[PATCH] D54184: RegisterCoalescer: Don't skip resolveConflicts for SubRegJoin

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 6 14:03:48 PST 2018


arsenm created this revision.
arsenm added reviewers: MatzeB, kparzysz.
Herald added subscribers: tpr, nhaehnle, wdng, jvesely, qcolombet.

Fixes second "Couldn't join subrange!" error in bug 39542


https://reviews.llvm.org/D54184

Files:
  lib/CodeGen/RegisterCoalescer.cpp
  test/CodeGen/AMDGPU/pytorch-cannot-join-subrange2.mir


Index: test/CodeGen/AMDGPU/pytorch-cannot-join-subrange2.mir
===================================================================
--- /dev/null
+++ test/CodeGen/AMDGPU/pytorch-cannot-join-subrange2.mir
@@ -0,0 +1,17 @@
+# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
+# RUN: llc -mtriple=amdgcn-amd-amdhsa -verify-coalescing -run-pass=simple-register-coalescing -verify-machineinstrs -o - %s | FileCheck %s
+---
+name:            couldnt_join_subrange
+tracksRegLiveness: true
+body:             |
+  bb.0:
+    ; CHECK-LABEL: name: couldnt_join_subrange
+    ; CHECK: undef %0.sub0:sreg_64 = S_MOV_B32 0
+    ; CHECK: %0.sub1:sreg_64 = COPY %0.sub0
+    ; CHECK: S_ENDPGM implicit %0.sub1
+    undef %0.sub0:sreg_64 = S_MOV_B32 0
+    %1:sreg_64 = COPY %0:sreg_64
+    %0.sub1:sreg_64 = COPY %0.sub0:sreg_64
+    S_ENDPGM implicit %1.sub1:sreg_64
+
+...
Index: lib/CodeGen/RegisterCoalescer.cpp
===================================================================
--- lib/CodeGen/RegisterCoalescer.cpp
+++ lib/CodeGen/RegisterCoalescer.cpp
@@ -2787,8 +2787,6 @@
       continue;
     LLVM_DEBUG(dbgs() << "\t\tconflict at " << printReg(Reg) << ':' << i << '@'
                       << LR.getValNumInfo(i)->def << '\n');
-    if (SubRangeJoin)
-      return false;
 
     ++NumLaneConflicts;
     assert(V.OtherVNI && "Inconsistent conflict resolution.");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54184.172849.patch
Type: text/x-patch
Size: 1386 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181106/efc31bf6/attachment.bin>


More information about the llvm-commits mailing list