[PATCH] D26802: [X86][AVX512] Detect repeated constant patterns in BUILD_VECTOR suitable for broadcasting.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 28 09:53:25 PST 2016


spatel added inline comments.


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:6107-6108
+      MVT PVT = TLI.getPointerTy(DAG.getDataLayout());
+      if (Subtarget.hasAVX2()) {
+        if (SplatBitSize <= 32 || (Subtarget.is64Bit() && SplatBitSize <= 64)) {
+          // Splatted value can fit in one constant in constant pool.
----------------
aymanmus wrote:
> spatel wrote:
> > If you cast the SplatValue to an APFloat, can you expand the target check to 'hasAVX()' and remove the is64Bit() restriction?
> AVX have no 16bit broadcast (float or int), so we will miss the cases where splatValue is of size 16. 
Ok, but this check is artificially limiting the 32-bit and 64-bit cases from firing on an AVX target and the 64-bit case from firing on a 32-bit target, right? Can you allow those cases or add a FIXME comment to allow it in a follow-up patch?


https://reviews.llvm.org/D26802





More information about the llvm-commits mailing list