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

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 3 12:17:47 PST 2016


spatel added inline comments.

================
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.
----------------
RKSimon wrote:
> This can probably be brought inside reduceMaskedStoreToScalarStore as a helper predicate
Yes - good idea. My lambda skills are non-existent.
Please double-check in the updated patch.

================
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;
----------------
RKSimon wrote:
> 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.
I'm not sure about the interaction between legalization and the IR intrinsic. I was expecting that we always get here with the IR-defined form. How about I add another 'TODO' for now? I think supporting different mask types may require careful logic because ISD::MSTORE doesn't actually define the mask format AFAICT.


http://reviews.llvm.org/D16828





More information about the llvm-commits mailing list