[PATCH] D15310: [X86][AVX] Fold loads + splats into broadcast instructions

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 8 09:26:35 PST 2015


RKSimon added inline comments.

================
Comment at: lib/Target/X86/X86ISelLowering.cpp:8109
@@ -8107,1 +8108,3 @@
       return SDValue();
+  } else if (MayFoldLoad(V)) {
+    // If we are broadcasting a load that is only used by the shuffle
----------------
spatel wrote:
> I don't know if this is even possible in practice: do we need to guard against volatile loads since the transform is shrinking the size of the load?
> 
> MayFoldLoad() calls isNormalLoad(), but neither of those check volatility, so if this fires on a volatile load, it looks like we get the original load and a splat load:
>   vmovaps	(%rdi), %ymm0
>   vbroadcastsd	16(%rdi), %ymm0
> 
> 
We do something similar in LowerAsSplatVectorLoad - so I'll add a !Ld->isVolatile() check.


Repository:
  rL LLVM

http://reviews.llvm.org/D15310





More information about the llvm-commits mailing list