[llvm] [ValueTracking] Teach isGuaranteedNotToBeUndefOrPoison about ZExt (PR #228493)

Sayan Sivakumaran via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 4 20:57:36 PDT 2026


sivakusayan wrote:

As already implied by the description, this patch is motivated by https://github.com/llvm/llvm-project/issues/138678. I think as part of a general fix, I need to prove we store poison if and only if we load poison. However, currently `isGuaranteedNotToBeUndefOrPoison` doesn't always detect that a `zext nneg` can't be poison, so hopefully this makes the situation better. 

This also updated a test case that I wasn't initially thinking about, such as noticing `lshr` never gives a negative number, so that the `zext nneg` of an `lshr` is never poison.

https://github.com/llvm/llvm-project/pull/228493


More information about the llvm-commits mailing list