diff options
author | Anna Thomas <anna@azul.com> | 2017-03-27 13:52:51 +0000 |
---|---|---|
committer | Anna Thomas <anna@azul.com> | 2017-03-27 13:52:51 +0000 |
commit | f57ae33381f27445d2b174bfae2cd94d49852398 (patch) | |
tree | ffef4d4607f2d887aba8e6756531a810cd14468e /llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp | |
parent | 513c3e474d9e9ade4c5e232fdfd4bb962c26cab5 (diff) | |
download | bcm5719-llvm-f57ae33381f27445d2b174bfae2cd94d49852398.tar.gz bcm5719-llvm-f57ae33381f27445d2b174bfae2cd94d49852398.zip |
[InstCombine] Avoid incorrect folding of select into phi nodes when incoming element is a vector type
Summary:
We are incorrectly folding selects into phi nodes when the incoming value of a phi
node is a constant vector. This optimization is done in `FoldOpIntoPhi` when the
select condition is a phi node with constant incoming values.
Without the fix, we are miscompiling (i.e. incorrectly folding the
select into the phi node) when the vector contains non-zero
elements.
This patch fixes the miscompile and we will correctly fold based on the
select vector operand (see added test cases).
Reviewers: majnemer, sanjoy, spatel
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31189
llvm-svn: 298845
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp')
0 files changed, 0 insertions, 0 deletions