[all-commits] [llvm/llvm-project] 6f149a: [InstCombine] Look through truncate to fold icmp w...
chenglin.bi via All-commits
all-commits at lists.llvm.org
Thu Feb 9 18:33:23 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 6f149a17d4b1a254dd41a3b910021481c564a691
https://github.com/llvm/llvm-project/commit/6f149a17d4b1a254dd41a3b910021481c564a691
Author: chenglin.bi <chenglin.bi at linaro.org>
Date: 2023-02-10 (Fri, 10 Feb 2023)
Changed paths:
M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
M llvm/lib/Transforms/InstCombine/InstCombineInternal.h
M llvm/test/Transforms/InstCombine/cmp-intrinsic.ll
Log Message:
-----------
[InstCombine] Look through truncate to fold icmp with intrinsics
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.
Alive2 proofs:
https://alive2.llvm.org/ce/z/9D_-qP
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D143368
More information about the All-commits
mailing list