Traverse through freeze when checking if base is constant
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
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?