[PATCH] D17485: [x86, InstCombine] transform x86 AVX masked stores to LLVM intrinsics

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 20 16:42:41 PST 2016


spatel created this revision.
spatel added reviewers: RKSimon, delena, craig.topper.
spatel added a subscriber: llvm-commits.
Herald added a subscriber: mcrosier.

The intended effect of this patch in conjunction with:
http://reviews.llvm.org/rL259392
http://reviews.llvm.org/rL260145

is that customers using the AVX intrinsics in C will benefit from combines when the store mask is constant:

  void mstore_zero_mask(float *f, __m128 v) {
    _mm_maskstore_ps(f, _mm_set1_epi32(0), v);
  }
  
  void mstore_fake_ones_mask(float *f, __m128 v) {
    _mm_maskstore_ps(f, _mm_set1_epi32(1), v);
  }
  
  void mstore_ones_mask(float *f, __m128 v) {
    _mm_maskstore_ps(f, _mm_set1_epi32(0x80000000), v);
  }
  
  void mstore_one_set_elt_mask(float *f, __m128 v) {
    _mm_maskstore_ps(f, _mm_set_epi32(0x80000000, 0, 0, 0), v);
  }

...so none of the above will actually generate a masked store for optimized code.

http://reviews.llvm.org/D17485

Files:
  lib/Transforms/InstCombine/InstCombineCalls.cpp
  test/Transforms/InstCombine/x86-masked-memops.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17485.48602.patch
Type: text/x-patch
Size: 6927 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160221/0c3e1093/attachment.bin>


More information about the llvm-commits mailing list