[PATCH] D150922: [KnownBits] Return `0` for poison {s,u}div inputs

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 19 13:54:34 PDT 2023


goldstein.w.n added a comment.

In D150922#4357344 <https://reviews.llvm.org/D150922#4357344>, @nikic wrote:

> IMHO we shouldn't go out of the way to handle such cases -- if we need to handle this for other reasons (e.g. for shift amounts, or for conflicts) that's one thing, but explicitly checking for poison result for known constant cases is pretty pointless -- those will get folded to actual poison values by code that can do so.

The INT_MIN / -1 case isn't necessary, but the LHS.isZero() || RHS.isZero() cases reduce the number of
checks we need elsewhere (specifically now we know MinTZ < BitWidth)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150922/new/

https://reviews.llvm.org/D150922



More information about the llvm-commits mailing list