[PATCH] D143368: [InstCombine] Look through truncate to fold icmp with intrinsics

chenglin.bi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 5 22:11:02 PST 2023


bcl5980 created this revision.
bcl5980 added reviewers: spatel, nikic.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
bcl5980 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The output of intrinsic functions like ctpop, cttz, ctlz have limited range from 0 to bitwidth. So if the truncate destination type can hold the source bitwidth size, we can just ignore the truncate and use the truncate src to do combination.


https://reviews.llvm.org/D143368

Files:
  llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
  llvm/lib/Transforms/InstCombine/InstCombineInternal.h
  llvm/test/Transforms/InstCombine/cmp-intrinsic.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143368.495001.patch
Type: text/x-patch
Size: 8085 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230206/f00091cb/attachment.bin>


More information about the llvm-commits mailing list