[llvm] [InstCombine] Fixing wrong merge of vector operands with undef elements (PR #102742)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 21 12:57:46 PDT 2024


nikic wrote:

> When some vector value is used instead, the optimisation is sound (https://alive2.llvm.org/ce/z/8vB-EZ).

This is because you're running alive2 with `--disable-undef-input`. If you drop the issue, it becomes a miscompile.

The proper way to fix this is to insert a freeze instruction if !isGuaranteedNotToBeUndef().

Though generally we just treat pre-existing multi-use undef miscompiles as "won't fix", unless there is reason to believe they have real-world relevance (usually for selects only).

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


More information about the llvm-commits mailing list