[PATCH] D107766: [InstCombine] Get rid of `hasOneUses()` when swapping `lshr` and `zext`

Anton Afanasyev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 9 07:31:25 PDT 2021


anton-afanasyev created this revision.
anton-afanasyev added reviewers: RKSimon, spatel, ABataev, dtemirbulatov.
Herald added a subscriber: hiraditya.
anton-afanasyev requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Get rid of redundant `hasOneUse()` check while combining `lshr` and `zext`.
Transformation `lshr (zext iM X to iN), C --> zext (lshr X, C) to iN`
may be executed when original `zext` is used multiple times if it is
not eliminated.

Fixes first part of PR50555.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107766

Files:
  llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
  llvm/test/Transforms/InstCombine/2008-01-21-MulTrunc.ll
  llvm/test/Transforms/InstCombine/apint-cast.ll
  llvm/test/Transforms/InstCombine/cast.ll
  llvm/test/Transforms/InstCombine/pr50555.ll
  llvm/test/Transforms/SLPVectorizer/X86/pr50555.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107766.365180.patch
Type: text/x-patch
Size: 13062 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210809/e83e9171/attachment.bin>


More information about the llvm-commits mailing list