Lower consecutive select instructions correctly.
authorDehao Chen <dehao@google.com>
Mon, 12 Sep 2016 20:23:28 +0000 (20:23 +0000)
committerDehao Chen <dehao@google.com>
Mon, 12 Sep 2016 20:23:28 +0000 (20:23 +0000)
commit9bbb941acfba70d557c572d102412dba91fbd128
treec42ff036e39bd292d81496696ebdf00fa2343fb1
parentd0c1c3220a1c16a9f8d903c190bc0bdfdc008954
Lower consecutive select instructions correctly.

Summary: If consecutive select instructions are lowered separately in CGP, it will introduce redundant condition check and branches that cannot be removed by later optimization phases. This patch lowers all consecutive select instructions at the same to to avoid inefficent code as demonstrated in https://llvm.org/bugs/show_bug.cgi?id=29095

Reviewers: davidxl

Subscribers: vsk, llvm-commits

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

llvm-svn: 281252
llvm/lib/CodeGen/CodeGenPrepare.cpp
llvm/test/CodeGen/X86/pseudo_cmov_lower2.ll