Fix SpeculativelyExecuteBB to either speculate all or none of the phis
authorDan Gohman <gohman@apple.com>
Thu, 5 Jan 2012 23:58:56 +0000 (23:58 +0000)
committerDan Gohman <gohman@apple.com>
Thu, 5 Jan 2012 23:58:56 +0000 (23:58 +0000)
commit3b205175ea417349ab96f3525d730e005e12c0f9
tree33b98cf9ccedfefa32755014b961a9071908a033
parentfb54ad19e7ef1b4f7177a005332ca8aca9bdbcb1
Fix SpeculativelyExecuteBB to either speculate all or none of the phis
present in the bottom of the CFG triangle, as the transformation isn't
ever valuable if the branch can't be eliminated.

Also, unify some heuristics between SimplifyCFG's multiple
if-converters, for consistency.

This fixes rdar://10627242.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147630 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/SimplifyCFG.cpp
test/Transforms/SimplifyCFG/2009-01-19-UnconditionalTrappingConstantExpr.ll
test/Transforms/SimplifyCFG/multiple-phis.ll [new file with mode: 0644]
test/Transforms/SimplifyCFG/select-gep.ll
test/Transforms/SimplifyCFG/switch-masked-bits.ll
test/Transforms/SimplifyCFG/switch-on-const-select.ll