[PATCH] D15739: AVX-512: Kreg set 0/1 optimization

David Kreitzer via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 23 06:49:28 PST 2015


DavidKreitzer added inline comments.

================
Comment at: ../lib/Target/X86/X86InstrInfo.cpp:5287
@@ +5286,3 @@
+/// to:
+///   %k4 = KXNORrr %k0, %k0
+static bool Expand2AddrKreg(MachineInstrBuilder &MIB,
----------------
It would be a good idea to explain why it is preferable to read %k0 here, e.g. "KNL does not recognize dependency-breaking idioms for mask registers, so kxnor %k1, %k1, %k2 has a RAW dependence on %k1. Using %k0 as the undef input register is a performance heuristic based on the assumption that %k0 is used less frequently than the other mask registers, since it is not usable as a write mask.  FIXME: A more advanced approach would be to choose the best input mask register based on context."


================
Comment at: ../lib/Target/X86/X86InstrInfo.cpp:5373
@@ -5358,3 +5372,3 @@
   case X86::KSET0D: return Expand2AddrUndef(MIB, get(X86::KXORDrr));
   case X86::KSET0Q: return Expand2AddrUndef(MIB, get(X86::KXORQrr));
   case X86::KSET1B:
----------------
These SET0 opcodes should also call Expand2AddrKreg with %k0, as KNL doesn't recognize kxor as an idiom either.


http://reviews.llvm.org/D15739





More information about the llvm-commits mailing list