[PATCH] D16828: [x86] convert masked store of one element to scalar store

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 3 07:38:10 PST 2016

RKSimon added a comment.

Some minor comments. I wonder if this could be moved to DAGCombiner - possibly with a test for scalar store legality and  TLI.isExtractVectorElementCheap()?

Comment at: lib/Target/X86/X86ISelLowering.cpp:26727
@@ +26726,3 @@
+/// Otherwise, return -1.
+static int getOneTrueElt(const SDValue V) {
+  // This needs to be a build vector of booleans.
This can probably be brought inside reduceMaskedStoreToScalarStore as a helper predicate

Comment at: lib/Target/X86/X86ISelLowering.cpp:26730
@@ +26729,3 @@
+  auto *BV = dyn_cast<BuildVectorSDNode>(V);
+  if (!BV || BV->getValueType(0).getVectorElementType() != MVT::i1)
+    return -1;
Don't we have cases where the build vector input operands are implicitly truncated to i1? For instance vector constant folding is likely to have created legal types that are larger.


More information about the llvm-commits mailing list