[PATCH] [X86][SSE] Improved (v)insertps shuffle matching

Chandler Carruth chandlerc at gmail.com
Thu Jan 8 16:16:34 PST 2015


Additional nits from Quentin's comments. Please try to work on some of the coding style issues.


REPOSITORY
  rL LLVM

================
Comment at: lib/Target/X86/X86ISelLowering.cpp:8182-8197
@@ +8181,18 @@
+  // Attempt to find a single V1 or V2 input out of place.
+  for (int i = 0; i < 4; i++) {
+    if (Zeroable[i]) {
+      ZMask |= 1 << i;
+    } else if (Mask[i] < 4) {
+      if (i != Mask[i]) {
+        if (V1DstIndex != -1 || V2DstIndex != -1)
+          return SDValue(); // more than one element insertion.
+        V1DstIndex = i;
+      } else
+        V1InPlace++;
+    } else {
+      if (V1DstIndex != -1 || V2DstIndex != -1)
+        return SDValue(); // more than one element insertion.
+      V2DstIndex = i;
+    }
+  }
+
----------------
I've made this comment is several review threads. *please* use continue rather than long if-else chains in loops.

================
Comment at: lib/Target/X86/X86ISelLowering.cpp:8190-8191
@@ +8189,4 @@
+        V1DstIndex = i;
+      } else
+        V1InPlace++;
+    } else {
----------------
assymetric braces are really werid.

================
Comment at: lib/Target/X86/X86ISelLowering.cpp:8222
@@ +8221,3 @@
+  return DAG.getNode(X86ISD::INSERTPS, DL, MVT::v4f32, V1, V2,
+    DAG.getConstant(InsertPSMask, MVT::i8));
+}
----------------
Indent is wrong here. Again, please use clang-format.

http://reviews.llvm.org/D6879

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list