[PATCH] D17289: [X86] Fix False Data Dependency in popcnt

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 16 08:26:46 PST 2016


majnemer added a subscriber: majnemer.

================
Comment at: ../llvm/lib/Target/X86/X86PopcntOpt.cpp:14
@@ +13,3 @@
+// instruction on its destination register.
+// The WA is to insert xor before the popcnt so it will remove the dependency.
+//
----------------
WA?

================
Comment at: ../llvm/lib/Target/X86/X86PopcntOpt.cpp:68
@@ +67,3 @@
+  const X86Subtarget &ST = MF.getSubtarget<X86Subtarget>();
+  if (!ST.hasAVX() || !ST.hasPOPCNT())
+    return false;
----------------
We don't do this dependency breaking if we `hasPOPCNT` but not `hasAVX` ?  I'd think we'd do this if `hasPOPCNT` is true regardless of what `hasAVX` is because we might want to run our program on machines older and newer than Sandy Bridge.


Repository:
  rL LLVM

http://reviews.llvm.org/D17289





More information about the llvm-commits mailing list