This is a follow-up to the discussion in D12882.
authorSanjay Patel <spatel@rotateright.com>
Fri, 16 Oct 2015 16:54:30 +0000 (16:54 +0000)
committerSanjay Patel <spatel@rotateright.com>
Fri, 16 Oct 2015 16:54:30 +0000 (16:54 +0000)
commit0b3441771844d9822234f9dbc570e45b6a748a11
treea54ae8b310341bfdacab648c6c9fff9f86b560be
parent8de4d0170e677a476a5a8008713c583e82bef085
This is a follow-up to the discussion in D12882.

Ideally, we would like SimplifyCFG to be able to form select instructions even when the operands
are expensive (as defined by the TTI cost model) because that may expose further optimizations.
However, we would then like a later pass like CodeGenPrepare to undo that transformation if the
target would likely benefit from not speculatively executing an expensive op (this patch).

Once we have this safety mechanism in place, we can adjust SimplifyCFG to restore its
select-formation behavior that changed with r248439.

Differential Revision: http://reviews.llvm.org/D13297

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250527 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CodeGenPrepare.cpp
test/Transforms/CodeGenPrepare/select.ll [new file with mode: 0644]