[llvm] using UNDEF SDNode instead of Constant SDNode when extend the UNDEF SDNode (PR #122741)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 16 11:05:29 PST 2025


topperc wrote:

> > According to InstCombine, (sext/zext poison) can constant fold to poison in the larger type.
> 
> It sounds like you have more context than I do then. I believe that the description of `sext`, `zext`, etc. in the IR will benefit from this clarification. Are you open to posting a PR?

There's a general statement in the Poison Values section. https://llvm.org/docs/LangRef.html#poison-values

```
Most instructions return ‘poison’ when one of their arguments is ‘poison’. A notable exception is the [select instruction](https://llvm.org/docs/LangRef.html#i-select). Propagation of poison can be stopped with the [freeze instruction](https://llvm.org/docs/LangRef.html#i-freeze).
```

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


More information about the llvm-commits mailing list