[PATCH] D102367: [Intrinsics] is_constant intrinsic on undef evaluates to false

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 13 10:45:36 PDT 2021


nickdesaulniers added a comment.

In D102367#2756322 <https://reviews.llvm.org/D102367#2756322>, @nikic wrote:

> You will not be able to get consistent semantics by special-casing undef. Yes, for your above example your new implementation will now return false, but if you do some trivial change like replacing `i` with `i & 1` it will return true again, because we fold `undef & 1` to zero. Undef can always be refined to a constant value.

Hmm...that's a fair point.  For pr/41459, I don't particularly care about the `undef` case, so I'll remove that for now, so that we can fix LowerConstantIntrinsics.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102367



More information about the llvm-commits mailing list