[PATCH] D124921: [SCEV] Fold umin_seq to umin using implied poison reasoning

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 4 06:11:49 PDT 2022


nikic created this revision.
nikic added reviewers: lebedev.ri, reames, fhahn, nlopes, aqjune.
Herald added a subscriber: hiraditya.
Herald added a project: All.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Similar to how we convert logical and/or to bitwise and/or, we should also convert umin_seq to umin based on implied poison reasoning. In `%x umin_seq %y`, if `%y` being poison implies `%x` being poison, then we don't need the sequential evaluation: Having `%y` contribute towards the result will never make the result more poisonous. An important corollary of this is that if `%y` is never poison, we also don't need the sequential evaluation.

This avoids some of the regressions in D124910 <https://reviews.llvm.org/D124910>.


https://reviews.llvm.org/D124921

Files:
  llvm/lib/Analysis/ScalarEvolution.cpp
  llvm/test/Analysis/ScalarEvolution/exit-count-select-safe.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124921.426979.patch
Type: text/x-patch
Size: 13566 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220504/16b6a527/attachment.bin>


More information about the llvm-commits mailing list