[PATCH] D22225: [x86, SSE] optimize pcmp results better (PR28484)

Elena Demikhovsky via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 12 02:29:31 PDT 2016


delena accepted this revision.
delena added a reviewer: delena.
This revision is now accepted and ready to land.

================
Comment at: lib/Target/X86/X86ISelLowering.cpp:28139
@@ +28138,3 @@
+  SDValue Op1 = peekThroughBitcasts(N->getOperand(1));
+  if (Op0.getOpcode() != X86ISD::PCMPEQ && Op0.getOpcode() != X86ISD::PCMPGT)
+    return SDValue();
----------------
spatel wrote:
> delena wrote:
> > We cam mark nodes like PCMP with AssertSext. And use this marker to simplify AND.
> Ah - I didn't know about AssertSext. To use it, we would add one of those nodes any time we create a PCMPEQ/PCMPGT? And then we would check for an AssertSext at this point rather than PCMPEQ/PCMPGT? 
> 
> Ok if I add a 'TODO' comment in this patch?
yes

================
Comment at: lib/Target/X86/X86ISelLowering.cpp:28152
@@ +28151,3 @@
+  // TODO: Is this possible or worthwhile for AVX-512 variants?
+  if (VT0.getSizeInBits() != 128 && VT0.getSizeInBits() != 256)
+    return SDValue();
----------------
spatel wrote:
> delena wrote:
> > On AVX-512 (skylake-avx512) the result is in a mask reg, also for 256 and 128 vector inputs.
> If it is the mask form, then wouldn't the node be PCMPEQM rather than PCMPEQ?
you are right. I think you can remove "todo AVX-512" from the comments.


http://reviews.llvm.org/D22225





More information about the llvm-commits mailing list