[PATCH] D24279: [InstCombine] canonicalize vector select with constant vector condition to shuffle

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 6 16:21:36 PDT 2016


spatel updated this revision to Diff 70485.
spatel added a comment.

Patch updated:

1. If the select condition is a constant expression - getAggregateElement returns nullptr - bail; add test.
2. If any element of the select condition is a constant expression - ie, not {0,1,undef} - bail; add test.
3. The code grew just enough to warrant being a helper function IMO, so...
4. I didn't use Builder->getInt32Ty() to avoid needing the builder as a param.
5. Fixed to use 'reserve' and 'push_back'.
6. Fixed 'unsigned int'.


https://reviews.llvm.org/D24279

Files:
  lib/Transforms/InstCombine/InstCombineSelect.cpp
  test/Transforms/InstCombine/blend_x86.ll
  test/Transforms/InstCombine/logical-select.ll
  test/Transforms/InstCombine/select.ll
  test/Transforms/InstCombine/vec_demanded_elts.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24279.70485.patch
Type: text/x-patch
Size: 12691 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160906/65c819b9/attachment.bin>


More information about the llvm-commits mailing list