[PATCH] D36439: [InstCombine] Simplify and merge FoldOrWithConstants/FoldXorWithConstants

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 7 20:18:12 PDT 2017


craig.topper created this revision.

The functions seem overly complicated. The body of this function is rechecking for an And operation to find the constant, but we already know we were looking at two Ands ORed together and the pieces are in variables. So just pass the correct pieces and check for two Constants.

Also since the two functions are almost identical, just pass in the opcode for the one difference so they can be combined.

Next step is to use m_APInt instead of ConstantInt.


https://reviews.llvm.org/D36439

Files:
  lib/Transforms/InstCombine/InstCombineAndOrXor.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36439.110128.patch
Type: text/x-patch
Size: 4063 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170808/25264744/attachment.bin>


More information about the llvm-commits mailing list