[PATCH] D36593: [InstSimplify][InstCombine] Modify the interface of decomposeBitTestICmp and use it in the InstSimplify

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 10 14:32:07 PDT 2017


craig.topper created this revision.
Herald added a subscriber: mgorny.

This addresses a fixme in InstSimplify about using decomposeBitTest.

I've modified the interface a little to return only the APInt version of the mask that InstSimplify needs. InstCombine now has a small wrapper routine to create a Constant out of it. I've also dropped the returning of 0 since InstSimplify doesn't need that.  So InstCombine creates a zero constant itself.

I also had to make decomposeBitTest support vectors since InstSimplify needs that.

As InstSimplify can't use something from the Transforms library, I've moved the CmpInstAnalysis code to the Analysis library.

I'm happy to split this up into smaller pieces if that makes review easier.


https://reviews.llvm.org/D36593

Files:
  include/llvm/Analysis/CmpInstAnalysis.h
  include/llvm/Transforms/Utils/CmpInstAnalysis.h
  lib/Analysis/CMakeLists.txt
  lib/Analysis/CmpInstAnalysis.cpp
  lib/Analysis/InstructionSimplify.cpp
  lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
  lib/Transforms/Utils/CMakeLists.txt
  lib/Transforms/Utils/CmpInstAnalysis.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36593.110634.patch
Type: text/x-patch
Size: 20676 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170810/fceae5cd/attachment-0001.bin>


More information about the llvm-commits mailing list