[PATCH] D45664: [InstCombine] Canonicalize variable mask in masked merge

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 15 03:11:06 PDT 2018


lebedev.ri created this revision.
lebedev.ri added reviewers: spatel, craig.topper.
lebedev.ri added a dependency: D45663: [InstCombine][NFC] Add tests for variable mask canonicalization in masked merge.

Masked merge has a pattern of: `((x ^ y) & M) ^ y`.
But, there is no difference between `((x ^ y) & M) ^ y` and `((x ^ y) & ~M) ^ x`,
We should canonicalize it and drop that `xor`.

https://rise4fun.com/Alive/Yol


Repository:
  rL LLVM

https://reviews.llvm.org/D45664

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45664.142546.patch
Type: text/x-patch
Size: 11638 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180415/da6e2ee2/attachment.bin>


More information about the llvm-commits mailing list