[PATCH] D28747: [X86] Don't create VBROADCAST nodes with 256-bit or 512-bit input types

Zvi Rackover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 16 14:27:57 PST 2017


zvi added inline comments.


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:5479
+        N->getOperand(0).getOperand(0).getValueType() == VT) {
+      if (auto *C = dyn_cast<ConstantSDNode>(N->getOperand(0).getOperand(1))) {
+        if (C->getZExtValue() == 0) {
----------------
EXTRACT_SUBVECTOR's Index operand must be a constant, so you don't need a dyn_cast<>.


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:5484
+        }
+      }
+    }
----------------
You can drop the outter braces


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:5487
+
     // We only decode broadcasts of same-sized vectors at the moment.
+    if (N->getOperand(0).getValueType() == VT || FromExtract) {
----------------
Comment need to be updated


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:9677
 
+  if (SrcVT.getSizeInBits() > 128)
+    V = extract128BitVector(V, 0, DAG, DL);
----------------
Can you please add here a comment explaining why?


https://reviews.llvm.org/D28747





More information about the llvm-commits mailing list