[PATCH] D31610: [InstCombine] Support folding add/and/or/xor with a constant vector RHS into selects

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 3 11:16:40 PDT 2017


craig.topper created this revision.

Currently we only fold with ConstantInt RHS. This generalizes to any Constant RHS. Strangely we already got this right for subtract.

I don't have a test case for and because that tends to remove bits so I think SimplifyDemandedInstructionBits is taking care of merging it out.


https://reviews.llvm.org/D31610

Files:
  lib/Transforms/InstCombine/InstCombineAddSub.cpp
  lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
  test/Transforms/InstCombine/add.ll
  test/Transforms/InstCombine/or.ll
  test/Transforms/InstCombine/xor.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31610.93891.patch
Type: text/x-patch
Size: 3947 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170403/665b58ec/attachment.bin>


More information about the llvm-commits mailing list