[PATCH] D45654: [InstCombine][NFC] Add tests for mask canonicalization in masked merge

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 14 08:14:25 PDT 2018


lebedev.ri created this revision.

While this is NFC, i don't know if we do want to do this, so for now it's not a commit.

Masked merge has a pattern of: `((x ^ y) & M) ^ y`.
Once PR6773 <https://bugs.llvm.org/show_bug.cgi?id=6773> fold is done, that pattern will be produced.

But, if the mask is constant, there is no difference between `((x ^ y) & M) ^ y` and `((x ^ y) & ~M) ^ x` and `((x ^ y) & ~(~M)) ^ y`,
I think the constant mask should be canonicalized.


Repository:
  rL LLVM

https://reviews.llvm.org/D45654

Files:
  test/Transforms/InstCombine/invert-mask-in-masked-merge-scalar.ll
  test/Transforms/InstCombine/invert-mask-in-masked-merge-vector.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45654.142514.patch
Type: text/x-patch
Size: 28902 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180414/87f1a281/attachment.bin>


More information about the llvm-commits mailing list