[PATCH] D23027: [X86][SSE] Avoid specifying unused arguments in SHUFPD lowering

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 22 05:42:48 PDT 2016


RKSimon added inline comments.

================
Comment at: lib/Target/X86/X86ISelLowering.cpp:8965-8966
@@ -8965,1 +8964,4 @@
+    return DAG.getNode(X86ISD::SHUFP, DL, MVT::v2f64,
+                       Mask[0] < 0 ? DAG.getUNDEF(MVT::v2f64) : V1,
+                       Mask[1] < 0 ? DAG.getUNDEF(MVT::v2f64) : V1,
                        DAG.getConstant(SHUFPDMask, DL, MVT::i8));
----------------
craig.topper wrote:
> spatel wrote:
> > I can never keep this straight, but shouldn't we use '== SM_SentinelUndef' here instead of '< 0'? 
> > 
> > Ie, we get here from lowerVectorShuffle() which uses ShuffleVectorSDNode->getMask() which says "An index of -1 is treated as undef..."
> If this comes from a generic VECTOR_SHUFFLE, then we can assume that the only value less than 0 will be -1 so the < 0 is safe. The SM_SentinelUndef is needed if you can get here using a mask from a target shuffle which uses -2 to represent zeroable. Sometimes I think we should use a zeroable bit vector for target shuffles like we do for VECTOR_SHUFFLE.
We do actually now assert in lowerVectorShuffle that we only use -1 for undefined (and permit no other -ve values) so we can safely use SM_SentinelUndef - I'll make the change.


Repository:
  rL LLVM

https://reviews.llvm.org/D23027





More information about the llvm-commits mailing list