[PATCH] D36988: [InstCombine] fix and enhance udiv/urem narrowing

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 21 16:03:18 PDT 2017


spatel created this revision.
Herald added a subscriber: mcrosier.

There are 3 independent changes here, but I thought it would be easier to review one patch to handle them all. If it's better to review and/or commit separately, please let me know:

1. Account for multiple uses in the pattern matching: avoid the transform if it increases the instruction count.
2. Add a missing fold for the case where the numerator is the constant: http://rise4fun.com/Alive/E2p
3. Enable all folds for vector types.

There's still one more potential change - use "shouldChangeType()" to keep from transforming to an illegal integer type.


https://reviews.llvm.org/D36988

Files:
  lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
  test/Transforms/InstCombine/udivrem-change-width.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36988.112080.patch
Type: text/x-patch
Size: 7827 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170821/145751c6/attachment.bin>


More information about the llvm-commits mailing list