fix rdar://8785296 - -fcatch-undefined-behavior generates inefficient code
authorChris Lattner <sabre@nondot.org>
Sat, 15 Jan 2011 07:36:13 +0000 (07:36 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 15 Jan 2011 07:36:13 +0000 (07:36 +0000)
commiteeba3f5695e39ca970a7aeb161558575216005b2
tree2f42b2f1c59fe0888c4357c3a3b0f68db85a29fb
parent1a8943a1f872a47b821fe7075f07b42403fa1a3f
fix rdar://8785296 - -fcatch-undefined-behavior generates inefficient code

The basic issue is that isel (very reasonably!) expects conditional branches
to be folded, so CGP leaving around a bunch dead computation feeding
conditional branches isn't such a good idea.  Just fold branches on constants
into unconditional branches.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123526 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/CodeGenPrepare.cpp
test/Transforms/CodeGenPrepare/basic.ll