[all-commits] [llvm/llvm-project] e3974c: Avoid making vector more poisonous in visitCONCAT_...
Björn Pettersson via All-commits
all-commits at lists.llvm.org
Wed Sep 16 05:08:50 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: e3974cd35965a239fc75644f249cbd24377959db
https://github.com/llvm/llvm-project/commit/e3974cd35965a239fc75644f249cbd24377959db
Author: Björn Pettersson <bjorn.a.pettersson at ericsson.com>
Date: 2026-09-16 (Wed, 16 Sep 2026)
Changed paths:
M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
A llvm/test/CodeGen/X86/dagcombine-concat-undef-vs-poison.ll
Log Message:
-----------
Avoid making vector more poisonous in visitCONCAT_VECTORS (#223492)
Fix a miscompile bug found in visitCONCAT_VECTORS.
In commit 544c300f43961 (from January 25 2026) the DAGCombiner started
to use poison instead of undef when rewriting a CONCAT_VECTORS as a
BUILD_VECTOR. Problem was that it was using poison also for elements
that were undef before the fold, making the result more poisonous. That
caused miscompiles as reported in PR #222857.
The fix is to make sure we only use a poison value as operand in the new
BUILD_VECTOR if the input to CONCAT_VECTORS also is poison.
Same kind of fixup is done for combineConcatVectorOfConcatVectors and
combineConcatVectorOfShuffleAndItsOperands (both helpers used by
visitCONCAT_VECTORS). Those funtions were also modified in commit
544c300f43961, all without any motivating test cases showing that it is
correct to use poison. I do not have any test cases proving that those
two helpers also could cause miscompiles, but neither that the rewrites
was correct after commit 544c300f43.
Fixes https://github.com/llvm/llvm-project/issues/222857
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list