[PATCH] D74685: [InstCombine] Fix multi-use handling in cttz transform

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 16 02:03:40 PST 2020


nikic created this revision.
nikic added reviewers: spatel, lebedev.ri.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

The select-of-cttz transform can currently duplicate cttz intrinsics and zext/trunc ops. The cause is that it unnecessarily duplicates the intrinsic and the zext/trunc when setting the "undef_on_zero" flag to false. However, it's always legal to set the flag from true to false, so we can make this replacement even if there are extra users.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74685

Files:
  llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
  llvm/test/Transforms/InstCombine/select-cmp-cttz-ctlz.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74685.244859.patch
Type: text/x-patch
Size: 20008 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200216/ca9d05af/attachment.bin>


More information about the llvm-commits mailing list