[PATCH] D127744: freeze does not change the constant property

Danila Malyutin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 14 08:49:33 PDT 2022


danilaml added a comment.

In D127744#3581771 <https://reviews.llvm.org/D127744#3581771>, @reames wrote:

> Non blocking comment..
>
> freeze(undef) being equally null or base as undef seems questionable to me.  I think in practice it might work out okay, but there's no guarantee that the value chosen for undef isn't 0 when frozen, and 1 when not.  You might want to step back and take a deeper look at the problem you're solving here.

Hm, I don't see how the value eventually chosen for freeze/undef factor into this verifier check. It doesn't try to guess/resolve undef/poison in any way, so it should be conservative here by only treating them as some constants (`isa<Constant>(V)` is true for them). In other words, if the value is already exclusively null (=> not undef or poison), "freezing" it won't change that property (so it's safe to look through it). Similarly, if it's already a constant (including undef or poison).  Or maybe I'm approaching it wrong?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127744



More information about the llvm-commits mailing list