[llvm] [DAG] Add freeze(assertext(x)) -> assertext(x) folds (PR #94491)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 6 02:21:15 PDT 2024


nikic wrote:

@efriedma-quic The context here is basically that we want things like `zeroext i1` to still provide useful information even after a freeze. This is sound if we say that `zeroext`/`signext` violations are IUB, and I don't think there are any concerns with saying that. However, the SDAG representation via AssertZext/AssertSext is currently poison-generating, so we lose the information when there is a freeze. And we have some uses of AssertZext that are not compatible with IUB semantics.

So I think the choices here are either:

1. Say that AssertZext violation is IUB, and remove uses of it in cases where poison semantics are necessary. (I agree that the special poison-in-poison-out handling in this PR doesn't really work.)
2. Provide a flag on AssertZext that determines whether it is IUB, or provide two separate nodes for both behaviors.

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


More information about the llvm-commits mailing list