[llvm] [InstCombine] Infer zext nneg flag directly (PR #71906)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 10 03:55:15 PST 2023
================
@@ -543,6 +543,8 @@ static Instruction *foldCttzCtlz(IntrinsicInst &II, InstCombinerImpl &IC) {
auto *Cttz = IC.Builder.CreateBinaryIntrinsic(Intrinsic::cttz, X,
IC.Builder.getTrue());
auto *ZextCttz = IC.Builder.CreateZExt(Cttz, II.getType());
+ if (auto *ZextInst = dyn_cast<PossiblyNonNegInst>(ZextCttz))
+ ZextInst->setNonNeg();
----------------
dtcxzyw wrote:
It is correct for i1.
Alive2: https://alive2.llvm.org/ce/z/CvSF2z
https://github.com/llvm/llvm-project/pull/71906
More information about the llvm-commits
mailing list