[DebugInfo] Remove un-necessary logic from HoistThenElseCodeToIf
authorJeremy Morse <jeremy.morse.llvm@gmail.com>
Mon, 14 Jan 2019 12:13:12 +0000 (12:13 +0000)
committerJeremy Morse <jeremy.morse.llvm@gmail.com>
Mon, 14 Jan 2019 12:13:12 +0000 (12:13 +0000)
commitf216da7ee01d6fe7ec85ee1dfcd215e223d4e66b
tree732ddfd1475010ca67d36bbdfc6d89f31fe7bf51
parent67610926fc74d03061da2c1ce4c895d17bee236f
[DebugInfo] Remove un-necessary logic from HoistThenElseCodeToIf

Following PR39807, the way in which SimplifyCFG hoists common code on
branch paths was fixed in r347782. However this left extra code hanging
around HoistThenElseCodeToIf that wasn't necessary and needlessly
complicated matters -- we no longer need to look up through the 'if'
basic block to find a location for hoisted 'select' insts, we can instead
use the location chosen by applyMergedLocation.

This patch deletes that extra logic, and updates a regression test to
reflect the new logic (selects get the merged location, not a previous
insts location).

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

llvm-svn: 351058
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/test/CodeGen/X86/pr39187-g.ll