[PATCH] D19874: [InstSimplify] use computeKnownBits on shift amount operands

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Tue May 3 10:09:59 PDT 2016


spatel created this revision.
spatel added reviewers: escha, majnemer, hfinkel.
spatel added a subscriber: llvm-commits.
Herald added a subscriber: mcrosier.

Do some simplifications common to all shift instructions based on the amount shifted.

Note that we could generalize the shift-by-zero transform into a shift-by-constant if all of the valid bits in the shift amount are known, but I think that would have to be done in InstCombine rather than here because it would mean we need to create a new shift instruction.

http://reviews.llvm.org/D19874

Files:
  lib/Analysis/InstructionSimplify.cpp
  test/Transforms/InstSimplify/shift-knownbits.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19874.56017.patch
Type: text/x-patch
Size: 5748 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160503/3a44011d/attachment.bin>


More information about the llvm-commits mailing list