diff options
author | Nikita Popov <npopov@redhat.com> | 2024-04-24 10:56:26 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-24 10:56:26 +0900 |
commit | a1b1c4a6d1d52916c5d885170a5f54632d579cdc (patch) | |
tree | 6eff3a4dfd6f0c334605acc61de94feddb319459 /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | d97cdd7d088b11b45038112a5f7fe5cbf60a6461 (diff) | |
download | llvm-a1b1c4a6d1d52916c5d885170a5f54632d579cdc.zip llvm-a1b1c4a6d1d52916c5d885170a5f54632d579cdc.tar.gz llvm-a1b1c4a6d1d52916c5d885170a5f54632d579cdc.tar.bz2 |
[InstCombine] Fix miscompile in negation of select (#89698)
Swapping the operands of a select is not valid if one hand is more
poisonous that the other, because the negation zero contains poison
elements.
Fix this by adding an extra parameter to isKnownNegation() to forbid
poison elements.
I've implemented this using manual checks to avoid needing four variants
for the NeedsNSW/AllowPoison combinations. Maybe there is a better way
to do this...
Fixes https://github.com/llvm/llvm-project/issues/89669.
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
0 files changed, 0 insertions, 0 deletions