diff options
author | Nikita Popov <npopov@redhat.com> | 2024-01-15 10:12:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-15 10:12:33 +0100 |
commit | 87bc91d4259c53d98d8c5c6b7c622f65ddb4c62a (patch) | |
tree | 2109c6ad3b1a086ab503a4309f3e4d231d47ba7f /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 7bc170a261ae0daaddcc1abeacf7e9e0f1f66d02 (diff) | |
download | llvm-87bc91d4259c53d98d8c5c6b7c622f65ddb4c62a.zip llvm-87bc91d4259c53d98d8c5c6b7c622f65ddb4c62a.tar.gz llvm-87bc91d4259c53d98d8c5c6b7c622f65ddb4c62a.tar.bz2 |
[PowerPC] Fix shuffle combine with undef elements (#77787)
This custom DAG combine works on a shuffle where one source vector is a
zero splat, which means we can adjust the shuffle indices to refer to
any element of the splat -- as long as we stay in the same vector.
In the case where an undef (-1) index into the non-splat vector was
used, we ended up adjusting the splat index to -1+NumElements, which
points into the wrong vector.
Fix this by using the first element from the splat if the other one is undef.
There are four cases this theoretically affects, but in practice I only
managed to demonstrate a miscompile with one of them. I think two of
theses are effectively dead due to the operand canonicalization at the
start of the transform.
Fixes https://github.com/llvm/llvm-project/issues/77748.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions