[PATCH] D20295: When looking for a spill slot in reg scavenger, find one that matches RC

Quentin Colombet via llvm-commits llvm-commits at lists.llvm.org
Tue May 17 14:24:25 PDT 2016


qcolombet added inline comments.

================
Comment at: lib/CodeGen/RegisterScavenging.cpp:414
@@ +413,3 @@
+    // that is the best fit for this register class (in street metric).
+    unsigned D = (S-NeedSize) + (A-NeedAlign);
+    if (D < Diff) {
----------------
Did you actually see cases where we should care?

I would rather return the first matching one and be done with the loop.

================
Comment at: lib/CodeGen/RegisterScavenging.cpp:439
@@ -415,1 +438,3 @@
+      llvm_unreachable(
            "Cannot scavenge register without an emergency spill slot!");
+    }
----------------
Given that we saw it can happen, I would go with a report_fatal_error.

================
Comment at: test/CodeGen/Hexagon/reg-scavenger-valid-slot.ll:3
@@ +2,3 @@
+; REQUIRES: asserts
+
+target triple = "hexagon"
----------------
- Run opt instnamer on the input.
- Add check lines.
- Add a comment on what this test is exercising.

================
Comment at: test/CodeGen/Hexagon/reg-scavenger-valid-slot.ll:106
@@ +105,3 @@
+  %niter.ncmp.7 = icmp eq i32 %niter.nsub.7, 0
+  br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body
+
----------------
Could you make the test smaller, e.g., via using inline asm to clobber registers?
(You could also use mir input.)


Repository:
  rL LLVM

http://reviews.llvm.org/D20295





More information about the llvm-commits mailing list