aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorBjörn Pettersson <bjorn.a.pettersson@ericsson.com>2024-07-22 17:19:46 +0200
committerGitHub <noreply@github.com>2024-07-22 17:19:46 +0200
commit2b78303e3f78c1eeb4b1362933290c490ce5fff6 (patch)
treeecaecf8ad1e14ef4b3a96aad32b67394f06fe701 /clang/lib/CodeGen/CodeGenModule.cpp
parentcda5b2b4b843635f0824c228f14f747361727a5e (diff)
downloadllvm-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