[PATCH] D140733: [InstSimplify] fold exact divide to poison if it is known to not divide evenly
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 28 11:34:36 PST 2022
nikic added inline comments.
================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:1157
+ const APInt *DivC;
+ auto *PEO = dyn_cast_if_present<PossiblyExactOperator>(Q.CxtI);
+ if (PEO && PEO->isExact() && match(Op1, m_APInt(DivC)) &&
----------------
This is not correct, Q.CxtI can be an unrelated instruction. You need to pass the exact flag down into the function.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D140733/new/
https://reviews.llvm.org/D140733
More information about the llvm-commits
mailing list