[PATCH] D65150: [InstSimplify] Drop leftover "division-by-zero guard" around `@llvm.umul.with.overflow` overflow bit

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 28 02:19:08 PDT 2019


nikic added a comment.

I think this is something of a recurring pattern (not so much the and/or forms, but the original phi/select form), where we have `select (x != C1), y, C2`, where it turns out that `y[x = C1] == C2` and thus the whole expression reduces to `y` (same with phi's). We might want to invest in a general solution to this problem. Something along the lines of finding this kind of pattern, then checking `y` backwards for uses of `x` (to a small depth) and if we find them, replace `x` with `C1`, run InstSimplify over it and see if it reduces to `C2` in the end.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65150





More information about the llvm-commits mailing list