[llvm] [DAG] NFC: Reword SCALAR_TO_VECTOR poison comment in SimplifyDemandedBits (PR #226003)

Cyrus Ding via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 27 18:30:18 PDT 2026


dingcyrus wrote:

Thanks both — the PR is now updated with three commits: the original NFC reword, a TargetLowering.h doc note for the general rule Björn asked for (KnownUndef only reports known-undef elements; poison is never reported, since undef-keyed folds substitute a chosen concrete value which is invalid for poison), and the `ISD::UNDEF` guard on the `Op.isUndef()` early-out Simon flagged (`SDNode::isUndef()` covers POISON too, so a poison Op previously got all-KnownUndef), with the two PowerPC scalar_to_vector shuffle tests updated to the conservative codegen.

Simon — commit 3 supersedes the exploration in #226124 (test updates taken from there with thanks); feel free to close the draft if you'd rather see it land here. The PowerPC codegen delta is the expected soundness cost: those shuffle simpls were keyed on KnownUndef bits of poison lanes (the `AND(0, undef) -> 0` family). Restoring them soundly needs poison-aware demanded-elts folds; I'd track that separately rather than block this fix.

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


More information about the llvm-commits mailing list