[PATCH] D37357: [x86] eliminate redundant shuffle of horizontal math ops when both inputs are the same

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 31 23:09:06 PDT 2017


craig.topper added inline comments.


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:29078
+  // shuffle (hadd X, X), undef, [low half...high half] --> hadd X, X
+  const ArrayRef<int> &Mask = cast<ShuffleVectorSDNode>(N)->getMask();
+  if (isTargetShuffleEquivalent(Mask, { 0, 0 }) ||
----------------
Take ArrayRef by value, its a pointer and size.


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:29079
+  const ArrayRef<int> &Mask = cast<ShuffleVectorSDNode>(N)->getMask();
+  if (isTargetShuffleEquivalent(Mask, { 0, 0 }) ||
+      isTargetShuffleEquivalent(Mask, { 0, 1, 0, 1 }) ||
----------------
Maybe add a TODO that this is incomplete?     {1, 1}, {1, 0} would also be redundant right?


https://reviews.llvm.org/D37357





More information about the llvm-commits mailing list