diff options
author | Björn Pettersson <bjorn.a.pettersson@ericsson.com> | 2024-07-22 17:19:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-22 17:19:46 +0200 |
commit | 2b78303e3f78c1eeb4b1362933290c490ce5fff6 (patch) | |
tree | ecaecf8ad1e14ef4b3a96aad32b67394f06fe701 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | cda5b2b4b843635f0824c228f14f747361727a5e (diff) | |
download | llvm-2b78303e3f78c1eeb4b1362933290c490ce5fff6.zip llvm-2b78303e3f78c1eeb4b1362933290c490ce5fff6.tar.gz llvm-2b78303e3f78c1eeb4b1362933290c490ce5fff6.tar.bz2 |
[DAGCombiner] Freeze maybe poison operands when folding select to logic (#84924)
Just like for regular IR we need to treat SELECT as conditionally
blocking poison in SelectionDAG. So (unless the condition itself is
poison) the result is only poison if the selected true/false value is
poison.
Thus, when doing DAG combines that turn SELECT into arithmetic/logical
operations (e.g. AND/OR) we need to make sure that the new operations
aren't more poisonous. One way to do that is to use FREEZE to make
sure the operands aren't posion.
This patch aims at fixing the kind of miscompiles reported in
https://github.com/llvm/llvm-project/issues/84653
and
https://github.com/llvm/llvm-project/issues/85190
Solution is to make sure that we insert FREEZE, if needed to make
the fold sound, when using the foldBoolSelectToLogic and
foldVSelectToSignBitSplatMask DAG combines.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions