[PATCH] D21560: Relax the clearance calculating for breaking partial register dependency.

David Kreitzer via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 21 11:45:15 PDT 2016


DavidKreitzer added a comment.

I think this is a good change. The cost of inserting an xor when it is not needed is very small. The cost of failing to insert an xor when it IS needed can be huge.

But fixing the threshold isn't good enough for several reasons.
(1) It isn't always possible, because the register may hold a live value. Marina (added) is working on a patch that will fix this problem.
(2) If the instruction has a "real" XMM operand, it is better to choose that register for the undef operand rather than inserting an xor. (Doing so hides the false dependence behind a true dependence that is unavoidable.) This applies to instructions like vcvtsd2ss et al. Marina is planning to work on this also.

-Dave


================
Comment at: lib/Target/X86/X86InstrInfo.cpp:5977
@@ +5976,3 @@
+  // dependency breaking instruction, which is inexpensive and is likely to
+  // be hidden in other instruction's cycles.
+  return 64;
----------------
minor nit, instruction's --> instructions'


http://reviews.llvm.org/D21560





More information about the llvm-commits mailing list