[PATCH] D36781: [InstCombine] Make folding (X >s -1) ? C1 : C2 --> ((X >>s 31) & (C2 - C1)) + C1 support splat vectors

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 15 22:52:29 PDT 2017


craig.topper created this revision.

This reuses decomposeBitTestICmp to decode the compare.

I'm assuming that pointer icmps will never match decomposeBitTestICmp because we shouldn't be doing relational comparisons on points, I think? So I removed the IntegerType check, but I could be wrong.

I've deferred the equality check on the type of compare vs the select until after the decomposeBitTestICmp call because I've considering putting an m_Trunc test inside of decomposeBitTestICmp so X won't always just be the CmpLHS.


https://reviews.llvm.org/D36781

Files:
  lib/Transforms/InstCombine/InstCombineSelect.cpp
  test/Transforms/InstCombine/select.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36781.111311.patch
Type: text/x-patch
Size: 4766 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170816/2573860b/attachment.bin>


More information about the llvm-commits mailing list