Allow binop C1, (select cc, CF, CT) -> select folding
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Wed, 20 Jun 2018 20:24:20 +0000 (20:24 +0000)
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Wed, 20 Jun 2018 20:24:20 +0000 (20:24 +0000)
commit20279dc0258b39d8bbe10261ba2e4442fbd0e0ae
tree58937a37ab5c2deb5190ce7866a11edab55bd97d
parent7d796ececd6323756d5b4f61ec27072e1c1deda5
Allow binop C1, (select cc, CF, CT) -> select folding

Previously this folding was done only if select is a first operand.
However, for non-commutative operations constant may go before
select.

Differential Revision: https://reviews.llvm.org/D48223

llvm-svn: 335167
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AMDGPU/dagcombine-select.ll [new file with mode: 0644]
llvm/test/CodeGen/PowerPC/select_const.ll
llvm/test/CodeGen/X86/dagcombine-select.ll