[PATCH] D50914: [RegisterCoalescer] Fix for assert in removePartialRedundancy

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 22 10:47:33 PDT 2018


MatzeB accepted this revision.
MatzeB added a comment.
This revision is now accepted and ready to land.

LGTM with nitpicks addressed.



================
Comment at: lib/CodeGen/RegisterCoalescer.cpp:1141
+    for (unsigned I = 0; I != EndPoints.size(); ) {
+      if (!EndPoints[I].getInstrDistance(CopyIdx)) {
+        EndPoints[I] = EndPoints.back();
----------------
Using SlotIndex::isSameInstr() would make the intention more clear.


================
Comment at: test/CodeGen/AMDGPU/regcoalescing-remove-partial-redundancy-assert.mir:11-14
+registers:       
+  - { id: 0, class: sreg_128 }
+  - { id: 1, class: sreg_128 }
+  - { id: 2, class: sreg_128 }
----------------
Could you try if the test still works with the `registers:` block removed? It seems the machine operands below have the register classes annotated anyway.


Repository:
  rL LLVM

https://reviews.llvm.org/D50914





More information about the llvm-commits mailing list